summaryrefslogtreecommitdiff
path: root/src/init
diff options
context:
space:
mode:
Diffstat (limited to 'src/init')
-rwxr-xr-xsrc/init/vyos-router26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/init/vyos-router b/src/init/vyos-router
index f109b95da..8978d4157 100755
--- a/src/init/vyos-router
+++ b/src/init/vyos-router
@@ -357,7 +357,9 @@ clear_or_override_config_files ()
update_interface_config ()
{
- if [ -d /run/udev/vyos ]; then
+ # add a configuration node for any interface the name store knows about
+ # that does not have one yet
+ if [ -f /opt/vyatta/etc/config/interface-mapping.json ]; then
$vyos_libexec_dir/vyos-interface-rescan.py $BOOTFILE
fi
}
@@ -369,17 +371,29 @@ warn_missing_interface_hardware ()
local status_file="/run/vyos-net-name-resolve.json"
[ -f "${status_file}" ] || return 0
- jq -r '.missing // {} | to_entries[] | "\(.value) \(.key)"' "${status_file}" \
+ jq -r '.missing // {} | to_entries[] | "\(.key) \(.value)"' "${status_file}" \
2>/dev/null | while read -r intf hwid; do
[ -n "${intf}" ] || continue
- log_failure_msg "hw-id ${hwid} configured as '${intf}' was not found during boot - check cabling, hardware and driver/firmware"
+ log_failure_msg "interface '${intf}' (${hwid}) did not appear during boot - check cabling, hardware and driver/firmware. Its name stays reserved."
done
- jq -r '.pending_unresolved // [] | .[]' "${status_file}" 2>/dev/null | \
- while read -r intf; do
+ # A replacement NIC inheriting a slot's name also inherits that
+ # interface's addresses, so say so rather than doing it silently.
+ jq -r '.matched_by_path // {} | to_entries[] | "\(.key) \(.value)"' "${status_file}" \
+ 2>/dev/null | while read -r intf hwid; do
[ -n "${intf}" ] || continue
- log_failure_msg "interface '${intf}' still has no hw-id configured after this boot's naming pass - bind it manually, e.g. 'set interfaces ethernet ${intf} hw-id <mac>', or remove the node if it is no longer needed"
+ log_warning_msg "interface '${intf}' was matched to new hardware ${hwid} by slot - verify it is the port you expect before relying on its configuration"
done
+
+ jq -r '.adopted // {} | to_entries[] | "\(.key) \(.value)"' "${status_file}" \
+ 2>/dev/null | while read -r intf hwid; do
+ [ -n "${intf}" ] || continue
+ log_warning_msg "interface '${intf}' had no NIC this boot and was given to the new Hyper-V NIC ${hwid} - verify it is the port you expect before relying on its configuration"
+ done
+
+ if [ "$(jq -r '.persisted // true' "${status_file}" 2>/dev/null)" = "false" ]; then
+ log_failure_msg "interface names could not be persisted - the configuration volume is not mounted"
+ fi
}
cleanup_post_commit_hooks () {