From cbc9578ade6afaf6db039401182b6cfe14e73ff9 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Thu, 7 Oct 2010 13:16:57 -0700 Subject: Put udev rules in /lib/udev Udev rules have moved from /etc/udev to /lib/udev on Debian Squeeze --- Makefile.am | 4 ++-- debian/vyatta-cfg-system.postinst.in | 11 ----------- debian/vyatta-cfg-system.postrm | 2 -- sysconf/69-vyatta-net.rules | 25 +++++++++++++++++++++++++ sysconf/vyatta-net.rules | 25 ------------------------- 5 files changed, 27 insertions(+), 40 deletions(-) create mode 100644 sysconf/69-vyatta-net.rules delete mode 100644 sysconf/vyatta-net.rules diff --git a/Makefile.am b/Makefile.am index a25f32cf..0502fcb4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,7 @@ cfgdir = $(datadir)/vyatta-cfg/templates share_perl5dir = $(datarootdir)/perl5/Vyatta/Login libudevdir = /lib/udev -etcudevdir = /etc/udev +udevrulesdir = /lib/udev/rules.d bin_sudo_usersdir = $(bindir)/sudo-users curverdir = $(sysconfdir)/config-migrate/current netplugupdir = /etc/netplug/linkup.d @@ -85,7 +85,7 @@ sysconf_DATA += sysconf/filecaps sysconf_DATA += sysconf/capability.conf libudev_SCRIPTS = scripts/vyatta_net_name -etcudev_DATA = sysconf/vyatta-net.rules +udevrules_DATA = sysconf/69-vyatta-net.rules curver_DATA = cfg-version/vrrp@1 curver_DATA += cfg-version/system@3 diff --git a/debian/vyatta-cfg-system.postinst.in b/debian/vyatta-cfg-system.postinst.in index 95a1a764..daecb83f 100644 --- a/debian/vyatta-cfg-system.postinst.in +++ b/debian/vyatta-cfg-system.postinst.in @@ -25,17 +25,6 @@ if ! grep -q '^tss' /etc/passwd; then adduser --system --group --shell /usr/sbin/nologin --home /var/lib/tpm tss fi -case `grep '^RULES_FILE=' /lib/udev/write_net_rules` in -*z25_persistent-net.rules* ) - vyatta_net_rules=z24_vyatta-net.rules;; -*70-persistent-net.rules* ) - vyatta_net_rules=69-vyatta-net.rules;; -* ) - vyatta_net_rules=21-vyatta-net.rules;; -esac - -ln -sf ../vyatta-net.rules /etc/udev/rules.d/$vyatta_net_rules - if [ "$sysconfdir" != "/etc" ]; then touch /etc/sudoers cp -p /etc/sudoers /etc/sudoers.bak diff --git a/debian/vyatta-cfg-system.postrm b/debian/vyatta-cfg-system.postrm index 5b22f66b..89d919ce 100644 --- a/debian/vyatta-cfg-system.postrm +++ b/debian/vyatta-cfg-system.postrm @@ -1,8 +1,6 @@ #!/bin/bash if [ "$1" = "purge" ]; then - rm -f /etc/udev/rules.d/*vyatta-net.rules - sed -i -e '/### BEGIN VYATTA/,/### END VYATTA/d' /etc/sudoers sed -i -e 'g/^password/d' /etc/pam.d/password fi diff --git a/sysconf/69-vyatta-net.rules b/sysconf/69-vyatta-net.rules new file mode 100644 index 00000000..9e874381 --- /dev/null +++ b/sysconf/69-vyatta-net.rules @@ -0,0 +1,25 @@ +# 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" diff --git a/sysconf/vyatta-net.rules b/sysconf/vyatta-net.rules deleted file mode 100644 index 9e874381..00000000 --- a/sysconf/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" -- cgit v1.2.3