[kexec-tools/f17] deal with nic rename issue

Dave Young yangrr at fedoraproject.org
Thu Apr 19 05:59:05 UTC 2012


commit 68da2e965e6ed2599fa53b62106602de72c66ec3
Author: Dave Young <dyoung at redhat.com>
Date:   Wed Apr 18 11:12:17 2012 +0800

    deal with nic rename issue
    
    Resolves: bz810107
    
    in case nic renaming we will failed to bring up network.
    Resolve this issue by pass mac addr to 2nd kernel cmdline, let dracut deal
    with the udev rename
    [v1->v2]: amwang: use ip instead of ifconfig
    
    Signed-off-by: Dave Young <dyoung at redhat.com>

 kdump_dracut_modules/99kdumpbase/module-setup.sh |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/kdump_dracut_modules/99kdumpbase/module-setup.sh b/kdump_dracut_modules/99kdumpbase/module-setup.sh
index 6eaa040..f1d1336 100755
--- a/kdump_dracut_modules/99kdumpbase/module-setup.sh
+++ b/kdump_dracut_modules/99kdumpbase/module-setup.sh
@@ -71,7 +71,8 @@ install() {
                 # we are on the same subnet
                 _netdev=`echo $_netdev|awk '{print $3}'|head -n 1`
             fi
-            echo " ip=$_netdev:dhcp rd.neednet=1" > ${initdir}/etc/cmdline.d/40ip.conf
+            _netmac=`ip addr show $_netdev 2>/dev/null|awk '/ether/{ print $2 }'`
+            echo " ip=$_netdev:dhcp ifname=$_netdev:$_netmac rd.neednet=1" > ${initdir}/etc/cmdline.d/40ip.conf
             if is_bridge "$_netdev"; then
                 echo " bridge=$_netdev:$(cd /sys/class/net/$_netdev/brif/; echo *)" > ${initdir}/etc/cmdline.d/41bridge.conf
             elif is_bond "$_netdev"; then


More information about the scm-commits mailing list