diff options
author | Hans de Goede <hdegoede@redhat.com> | 2009-09-14 11:42:52 +0200 |
---|---|---|
committer | Harald Hoyer <harald@redhat.com> | 2009-09-15 15:13:21 +0200 |
commit | 68f28d69765f6ead72a63a3ddf6a54e2f30a7aff (patch) | |
tree | 9c22d7251b3354180963877aa0b7f2d0a1737688 | |
parent | 5c3f5746bb07c3b702d2fcfda91e5132bb3b3da6 (diff) | |
download | dracut-68f28d69765f6ead72a63a3ddf6a54e2f30a7aff.tar.gz dracut-68f28d69765f6ead72a63a3ddf6a54e2f30a7aff.tar.bz2 dracut-68f28d69765f6ead72a63a3ddf6a54e2f30a7aff.zip |
Add ifname= argument for persistent netdev names
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
-rw-r--r-- | dracut.8 | 6 | ||||
-rwxr-xr-x | modules.d/40network/install | 2 | ||||
-rwxr-xr-x | modules.d/40network/net-genrules.sh | 2 | ||||
-rwxr-xr-x | modules.d/95fcoe/fcoe-genrules.sh | 2 | ||||
-rwxr-xr-x | modules.d/95fcoe/parse-fcoe.sh | 2 |
5 files changed, 11 insertions, 3 deletions
@@ -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> diff --git a/modules.d/40network/install b/modules.d/40network/install index 34aed932..ded70daf 100755 --- a/modules.d/40network/install +++ b/modules.d/40network/install @@ -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 diff --git a/modules.d/40network/net-genrules.sh b/modules.d/40network/net-genrules.sh index 04e0528b..ba369cc4 100755 --- a/modules.d/40network/net-genrules.sh +++ b/modules.d/40network/net-genrules.sh @@ -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 diff --git a/modules.d/95fcoe/fcoe-genrules.sh b/modules.d/95fcoe/fcoe-genrules.sh index b5d6f072..e9d01573 100755 --- a/modules.d/95fcoe/fcoe-genrules.sh +++ b/modules.d/95fcoe/fcoe-genrules.sh @@ -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 diff --git a/modules.d/95fcoe/parse-fcoe.sh b/modules.d/95fcoe/parse-fcoe.sh index 81ec760b..b35680fc 100755 --- a/modules.d/95fcoe/parse-fcoe.sh +++ b/modules.d/95fcoe/parse-fcoe.sh @@ -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=) |