From 4a92157b9e077514fdbf5845169323ed7370bedb Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Thu, 21 Oct 2010 16:57:16 -0700 Subject: Change vyatta_net_name into a perl script Use existing config parser and perl to handle udev device naming. Do renaming early in udev boot, and fixup config file later. This avoids rescanning udev devices on boot and adds preliminary support for hotplug. --- scripts/rl-system.init | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'scripts/rl-system.init') diff --git a/scripts/rl-system.init b/scripts/rl-system.init index 3e07e11e..989c51e4 100755 --- a/scripts/rl-system.init +++ b/scripts/rl-system.init @@ -105,20 +105,10 @@ clear_or_override_config_files () done } -udev_rescan () -{ - rm -f /tmp/vyatta_net_name_* - udevadm trigger --subsystem-match=net && udevadm settle --quiet - for ff in /tmp/vyatta_net_name_* ; do - f=${ff##*/} - cmd_name_hwid=${f/vyatta_net_name_/} - cmd=${cmd_name_hwid%%_*} - name_hwid=${cmd_name_hwid#*_} - name=${name_hwid%_*} - hwid=${name_hwid#*_} - syslog $cmd $name $hwid - $vyatta_sbindir/${cmd}_bootfile_eth_hwid $BOOTFILE $name $hwid - done +update_interface_config () { + if [ -d /dev/.udev/vyatta ]; then + $vyatta_sbindir/vyatta_interface_rescan /dev/.udev/vyatta $BOOTFILE + fi } create_ssh_host_keys () { @@ -190,7 +180,7 @@ start () { mkdir -p /var/run/vyatta mkdir -p /var/log/vyatta - udev_rescan + update_interface_config create_ssh_host_keys || \ log_failure_msg "can't initialize ssh host keys" clear_or_override_config_files || \ -- cgit v1.2.3