[kexec-tools/f19] dracut-module-setup.sh: use kernel exported mac address in kdump_get_mac_addr()

Baoquan He baoquan at fedoraproject.org
Tue Jun 18 09:25:57 UTC 2013


commit d406c5903c5f1a619f96f832491967210b75a35d
Author: WANG Chao <chaowang at redhat.com>
Date:   Thu Jun 13 10:06:26 2013 +0800

    dracut-module-setup.sh: use kernel exported mac address in kdump_get_mac_addr()
    
    kernel has exported mac address for each interface, we can get it
    directly instead of parsing the output from ip address show.
    
    Signed-off-by: WANG Chao <chaowang at redhat.com>
    Acked-by: Baoquan He <bhe at redhat.com>

 dracut-module-setup.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 23f7bd6..428918c 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -83,7 +83,7 @@ kdump_static_ip() {
 }
 
 kdump_get_mac_addr() {
-    echo `ip addr show $1 2>/dev/null|awk '/ether/{ print $2 }'`
+    cat /sys/class/net/$1/address
 }
 
 #Bonding or team master modifies the mac address


More information about the scm-commits mailing list