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@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
This commit is contained in:
dyoung@redhat.com 2012-06-22 14:50:40 +08:00 committed by Dave Young
parent e8693e46f6
commit 7148c0a30d
2 changed files with 19 additions and 0 deletions

View File

@ -102,11 +102,26 @@ kdump_setup_vlan() {
fi 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 # Setup dracut to bringup a given network interface
kdump_setup_netdev() { kdump_setup_netdev() {
local _netdev=$1 local _netdev=$1
local _static _proto 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 }'` _netmac=`ip addr show $_netdev 2>/dev/null|awk '/ether/{ print $2 }'`
_static=$(kdump_static_ip $_netdev) _static=$(kdump_static_ip $_netdev)
if [ -n "$_static" ]; then if [ -n "$_static" ]; then

View File

@ -175,6 +175,10 @@ if [ -f "$keyfile" ]; then
SSH_KEY_LOCATION=$(/usr/bin/readlink -m $keyfile) SSH_KEY_LOCATION=$(/usr/bin/readlink -m $keyfile)
fi fi
if [ "$(uname -m)" = "s390x" ]; then
add_dracut_module "znet"
fi
while read config_opt config_val; while read config_opt config_val;
do do
case "$config_opt" in case "$config_opt" in