]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Add ifname= argument for persistent netdev names
authorHans de Goede <hdegoede@redhat.com>
Mon, 14 Sep 2009 09:42:52 +0000 (11:42 +0200)
committerHarald Hoyer <harald@redhat.com>
Tue, 15 Sep 2009 13:13:21 +0000 (15:13 +0200)
ifname=<interface>:<MAC>
Assign network device name <interface> (ie eth0) to the NIC with MAC <MAC>.
Note that if you use this option you *must* specify an ifname= argument
for all interfaces used in ip= or fcoe= arguments

dracut.8
modules.d/40network/install
modules.d/40network/net-genrules.sh
modules.d/95fcoe/fcoe-genrules.sh
modules.d/95fcoe/parse-fcoe.sh

index 5ebcd16c5af514bf862a4506e4d52601b45d1c45..18594e596b29e95e91453f17c897b677be7f31bc 100644 (file)
--- a/dracut.8
+++ b/dracut.8
@@ -256,6 +256,12 @@ explicit network configuration
 .B rd_NO_PLYMOUTH
 do not start plymouth. This will not work with encrypted partitions.
 
+.TP
+.B ifname=<interface>:<MAC>
+Assign network device name <interface> (ie eth0) to the NIC with MAC <MAC>.
+Note that if you use this option you \fBmust\fR specify an ifname= argument
+for all interfaces used in ip= or fcoe= arguments
+
 .SH Misc
 .TP
 .B rdblacklist=<drivername>
index 34aed93256be3cfc5cae37e4f1f9b259a1a5046e..ded70dafe403211acebde4335eacb3d0eed93c03 100755 (executable)
@@ -4,10 +4,12 @@ inst "$moddir/ifup" "/sbin/ifup"
 inst "$moddir/netroot" "/sbin/netroot"
 inst "$moddir/dhclient-script" "/sbin/dhclient-script"
 inst "$moddir/dhclient.conf" "/etc/dhclient.conf" 
+inst_hook pre-udev 50 "$moddir/ifname-genrules.sh"
 inst_hook pre-udev 60 "$moddir/net-genrules.sh"
 inst_hook cmdline 91 "$moddir/dhcp-root.sh"
 inst_hook cmdline 99 "$moddir/parse-ip-opts.sh"
 inst_hook cmdline 98 "$moddir/parse-bridge.sh"
+inst_hook cmdline 99 "$moddir/parse-ifname.sh"
 inst_hook pre-pivot 10 "$moddir/kill-dhclient.sh"
 
 # TODO ifcfg config style is redhat specific, this should probably
index 04e0528b592bfaeaff9f33954e58f66564b81013..ba369cc4e1eac21bebe84a99a5960c588eb29376 100755 (executable)
@@ -29,7 +29,7 @@ fix_bootif() {
     # If we have to handle multiple interfaces, handle only them.
     elif [ -n "$IFACES" ] ; then
        for iface in $IFACES ; do
-           printf 'ACTION=="add", SUBSYSTEM=="net", KERNEL=="%s", RUN+="/sbin/ifup $env{INTERFACE}"\n' "$iface"
+           printf 'ACTION=="add", SUBSYSTEM=="net", NAME=="%s", RUN+="/sbin/ifup $env{INTERFACE}"\n' "$iface"
        done
 
     # Default: We don't know the interface to use, handle all
index b5d6f07227dc5e8b43cbc76baf546b2913c5cad3..e9d01573306ff32f294fe64253780371c7076749 100755 (executable)
@@ -9,6 +9,6 @@
     if [ -n "$fcoe_mac" ] ; then
        printf 'ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="%s", RUN+="/sbin/fcoe-up $env{INTERFACE} %s"\n' "$fcoe_mac" "$fcoe_dcb"
     else
-       printf 'ACTION=="add", SUBSYSTEM=="net", KERNEL=="%s", RUN+="/sbin/fcoe-up $env{INTERFACE} %s"\n' "$fcoe_interface" "$fcoe_dcb"
+       printf 'ACTION=="add", SUBSYSTEM=="net", NAME=="%s", RUN+="/sbin/fcoe-up $env{INTERFACE} %s"\n' "$fcoe_interface" "$fcoe_dcb"
     fi
 } > /etc/udev/rules.d/60-fcoe.rules
index 81ec760ba16681fedb4c31b29ae4c323251ab28f..b35680fce44a95ce24364bf0a298dd5a077d562c 100755 (executable)
@@ -11,7 +11,7 @@
 #
 # Examples:
 # fcoe=eth0:nodcb
-# fcoe=4A:3F:4C:04:F8:D7:nodcb
+# fcoe=4a:3f:4c:04:f8:d7:nodcb
 
 [ -z "$fcoe" ] && fcoe=$(getarg fcoe=)