summaryrefslogtreecommitdiff
path: root/sysconf
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 /sysconf
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 'sysconf')
-rw-r--r--sysconf/65-vyatta-net.rules13
-rw-r--r--sysconf/69-vyatta-net.rules25
2 files changed, 13 insertions, 25 deletions
diff --git a/sysconf/65-vyatta-net.rules b/sysconf/65-vyatta-net.rules
new file mode 100644
index 00000000..1372110f
--- /dev/null
+++ b/sysconf/65-vyatta-net.rules
@@ -0,0 +1,13 @@
+# These rules use vyatta_net_name to persistently name network interfaces
+# per "hwid" association in the Vyatta configuration file.
+
+ACTION!="add", GOTO="vyatta_net_end"
+SUBSYSTEM!="net", GOTO="vyatta_net_end"
+
+# ignore the interface if a name has already been set
+NAME=="?*", GOTO="vyatta_net_end"
+
+# Do name change for ethernet and wireless devices only
+KERNEL=="eth*|wlan*", PROGRAM="vyatta_net_name %k $attr{address}", NAME="%c"
+
+LABEL="vyatta_net_end"
diff --git a/sysconf/69-vyatta-net.rules b/sysconf/69-vyatta-net.rules
deleted file mode 100644
index 9e874381..00000000
--- a/sysconf/69-vyatta-net.rules
+++ /dev/null
@@ -1,25 +0,0 @@
-# These rules use vyatta_net_name to persistently name network interfaces
-# per "hwid" association with the interface block of the vyatta config file.
-
-# note that this is actually invoked twice: once during early rcS (udev)
-# and the second time during rl-system (rescan). pre-mendocino, ACTION is
-# "add" on both invocations, so the original rule looks for "add".
-#
-# however, in mendocino, the squeeze udev performs the second invocation with
-# ACTION "change", so the original rule does not get applied on the second
-# invocation, and therefore config.boot is not updated by rl-system.
-#
-# to emulate the previous behavior, invoke vyatta_net_name for both "add" and
-# "change" for now. however, the two-pass approach should be revisited to
-# determine if it is still necessary.
-
-ACTION!="add", ACTION!="change", GOTO="vyatta_net_end"
-SUBSYSTEM!="net", GOTO="vyatta_net_end"
-
-# ignore the interface if a name has already been set
-NAME=="?*", GOTO="vyatta_net_end"
-
-# Do name change for ethernet devices only
-KERNEL=="eth*", PROGRAM="vyatta_net_name %k $attr{address}", NAME="%c"
-
-LABEL="vyatta_net_end"