[kexec-tools] add s390x netdev setup

Dave Young yangrr at fedoraproject.org
Thu Jul 5 09:01:38 UTC 2012


commit 7148c0a30dfc48221eadf255e8a89619f98a8752
Author: dyoung at redhat.com <dyoung at redhat.com>
Date:   Fri Jun 22 14:50:40 2012 +0800

    add s390x netdev setup
    
    s390x netdev need special cmdline to bring up
    parse the ifcfg file to append proper cmdline, also add znet dracut module
    
    Signed-off-by: Dave Young <dyoung at redhat.com>
    Acked-by: Vivek Goyal <vgoyal at redhat.com>

 dracut-module-setup.sh |   15 +++++++++++++++
 mkdumprd               |    4 ++++
 2 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 496a6a9..c1c6929 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -102,11 +102,26 @@ kdump_setup_vlan() {
     fi
 }
 
+# setup s390 znet cmdline
+# $1: netdev name
+kdump_setup_znet() {
+    local _options=""
+    . /etc/sysconfig/network-scripts/ifcfg-$1
+    for i in $OPTIONS; do
+        _options=${_options},$i
+    done
+    echo rd.znet=${NETTYPE},${SUBCHANNELS}${_options} > ${initdir}/etc/cmdline.d/30znet.conf
+}
+
 # Setup dracut to bringup a given network interface
 kdump_setup_netdev() {
     local _netdev=$1
     local _static _proto
 
+    if [ "$(uname -m)" = "s390x" ]; then
+        kdump_setup_znet $_netdev
+    fi
+
     _netmac=`ip addr show $_netdev 2>/dev/null|awk '/ether/{ print $2 }'`
     _static=$(kdump_static_ip $_netdev)
     if [ -n "$_static" ]; then
diff --git a/mkdumprd b/mkdumprd
index d1f7e15..81627c8 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -175,6 +175,10 @@ if [ -f "$keyfile" ]; then
     SSH_KEY_LOCATION=$(/usr/bin/readlink -m $keyfile)
 fi
 
+if [ "$(uname -m)" = "s390x" ]; then
+    add_dracut_module "znet"
+fi
+
 while read config_opt config_val;
 do
     case "$config_opt" in


More information about the scm-commits mailing list