summaryrefslogtreecommitdiff
path: root/scripts/rl-system.init
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2010-10-21 16:57:16 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2010-10-26 14:06:00 -0700
commit4a92157b9e077514fdbf5845169323ed7370bedb (patch)
tree404806994809509f52b2f39fc67975900c24b42a /scripts/rl-system.init
parent28abf7773e5fc6c26725340e19dade4166d930cd (diff)
downloadvyatta-cfg-system-4a92157b9e077514fdbf5845169323ed7370bedb.tar.gz
vyatta-cfg-system-4a92157b9e077514fdbf5845169323ed7370bedb.zip
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.
Diffstat (limited to 'scripts/rl-system.init')
-rwxr-xr-xscripts/rl-system.init20
1 files changed, 5 insertions, 15 deletions
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 || \