Prefix 'kdump-' to cmdline config files used for bringing up network. This gives flexibilty in handling network configuration gracefully in different scenarios.
Signed-off-by: Hari Bathini hbathini@linux.ibm.com ---
Changes in v3: * added kdump prefix to other network interface files.
dracut-module-setup.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index db7cd23..578a7b3 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -243,11 +243,11 @@ kdump_setup_bridge() { else _mac=$(kdump_get_mac_addr $_dev) _kdumpdev=$(kdump_setup_ifname $_dev) - echo -n " ifname=$_kdumpdev:$_mac" >> ${initdir}/etc/cmdline.d/41bridge.conf + echo -n " ifname=$_kdumpdev:$_mac" >> ${initdir}/etc/cmdline.d/41kdump-bridge.conf fi _brif+="$_kdumpdev," done - echo " bridge=$_netdev:$(echo $_brif | sed -e 's/,$//')" >> ${initdir}/etc/cmdline.d/41bridge.conf + echo " bridge=$_netdev:$(echo $_brif | sed -e 's/,$//')" >> ${initdir}/etc/cmdline.d/41kdump-bridge.conf }
kdump_setup_bond() { @@ -256,16 +256,16 @@ kdump_setup_bond() { for _dev in `cat /sys/class/net/$_netdev/bonding/slaves`; do _mac=$(kdump_get_perm_addr $_dev) _kdumpdev=$(kdump_setup_ifname $_dev) - echo -n " ifname=$_kdumpdev:$_mac" >> ${initdir}/etc/cmdline.d/42bond.conf + echo -n " ifname=$_kdumpdev:$_mac" >> ${initdir}/etc/cmdline.d/42kdump-bond.conf _slaves+="$_kdumpdev," done - echo -n " bond=$_netdev:$(echo $_slaves | sed 's/,$//')" >> ${initdir}/etc/cmdline.d/42bond.conf + echo -n " bond=$_netdev:$(echo $_slaves | sed 's/,$//')" >> ${initdir}/etc/cmdline.d/42kdump-bond.conf # Get bond options specified in ifcfg
source_ifcfg_file $_netdev
bondoptions="$(echo :$BONDING_OPTS | sed 's/\s+/,/')" - echo "$bondoptions" >> ${initdir}/etc/cmdline.d/42bond.conf + echo "$bondoptions" >> ${initdir}/etc/cmdline.d/42kdump-bond.conf }
kdump_setup_team() { @@ -274,10 +274,10 @@ kdump_setup_team() { for _dev in `teamnl $_netdev ports | awk -F':' '{print $2}'`; do _mac=$(kdump_get_perm_addr $_dev) _kdumpdev=$(kdump_setup_ifname $_dev) - echo -n " ifname=$_kdumpdev:$_mac" >> ${initdir}/etc/cmdline.d/44team.conf + echo -n " ifname=$_kdumpdev:$_mac" >> ${initdir}/etc/cmdline.d/44kdump-team.conf _slaves+="$_kdumpdev," done - echo " team=$_netdev:$(echo $_slaves | sed -e 's/,$//')" >> ${initdir}/etc/cmdline.d/44team.conf + echo " team=$_netdev:$(echo $_slaves | sed -e 's/,$//')" >> ${initdir}/etc/cmdline.d/44kdump-team.conf #Buggy version teamdctl outputs to stderr! #Try to use the latest version of teamd. teamdctl "$_netdev" config dump > ${initdir}/tmp/$$-$_netdev.conf @@ -307,10 +307,10 @@ kdump_setup_vlan() { exit 1 elif kdump_is_bond "$_phydev"; then kdump_setup_bond "$_phydev" - echo " vlan=$_netdev:$_phydev" > ${initdir}/etc/cmdline.d/43vlan.conf + echo " vlan=$_netdev:$_phydev" > ${initdir}/etc/cmdline.d/43kdump-vlan.conf else _kdumpdev="$(kdump_setup_ifname $_phydev)" - echo " vlan=$_netdev:$_kdumpdev ifname=$_kdumpdev:$_netmac" > ${initdir}/etc/cmdline.d/43vlan.conf + echo " vlan=$_netdev:$_kdumpdev ifname=$_kdumpdev:$_netmac" > ${initdir}/etc/cmdline.d/43kdump-vlan.conf fi }
@@ -346,7 +346,7 @@ kdump_setup_netdev() { _proto=dhcp fi
- _ip_conf="${initdir}/etc/cmdline.d/40ip.conf" + _ip_conf="${initdir}/etc/cmdline.d/40kdump-ip.conf" _ip_opts=" ip=${_static}$(kdump_setup_ifname $_netdev):${_proto}"
# dracut doesn't allow duplicated configuration for same NIC, even they're exactly the same. @@ -415,9 +415,9 @@ kdump_install_net() { # call kdump_install_net again and we don't want eth1 to be the default # gateway. if [ ! -f ${initdir}/etc/cmdline.d/60kdumpnic.conf ] && - [ ! -f ${initdir}/etc/cmdline.d/70bootdev.conf ]; then + [ ! -f ${initdir}/etc/cmdline.d/70kdump-bootdev.conf ]; then echo "kdumpnic=$(kdump_setup_ifname $_netdev)" > ${initdir}/etc/cmdline.d/60kdumpnic.conf - echo "bootdev=$(kdump_setup_ifname $_netdev)" > ${initdir}/etc/cmdline.d/70bootdev.conf + echo "bootdev=$(kdump_setup_ifname $_netdev)" > ${initdir}/etc/cmdline.d/70kdump-bootdev.conf fi }