Change all the ifcfg file users to call get_ifcfg_filename().
Signed-off-by: Xunlei Pang xlpang@redhat.com --- dracut-module-setup.sh | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 4cd7107..350864e 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -66,7 +66,12 @@ kdump_is_vlan() { kdump_setup_dns() { local _nameserver _dns local _dnsfile=${initdir}/etc/cmdline.d/42dns.conf - . /etc/sysconfig/network-scripts/ifcfg-$1 + local ifcfg_file + + ifcfg_file=$(get_ifcfg_filename $1) + if [ -f "${ifcfg_file}" ]; then + . ${ifcfg_file} + fi
[ -n "$DNS1" ] && echo "nameserver=$DNS1" > "$_dnsfile" [ -n "$DNS2" ] && echo "nameserver=$DNS2" >> "$_dnsfile" @@ -181,6 +186,8 @@ kdump_setup_bridge() { kdump_setup_bond() { local _netdev=$1 local _dev _mac _slaves _kdumpdev + local ifcfg_file + for _dev in `cat /sys/class/net/$_netdev/bonding/slaves`; do _mac=$(kdump_get_perm_addr $_dev) _kdumpdev=$(kdump_setup_ifname $_dev) @@ -189,7 +196,12 @@ kdump_setup_bond() { done echo -n " bond=$_netdev:$(echo $_slaves | sed 's/,$//')" >> ${initdir}/etc/cmdline.d/42bond.conf # Get bond options specified in ifcfg - . /etc/sysconfig/network-scripts/ifcfg-$_netdev + + ifcfg_file=$(get_ifcfg_filename $_netdev) + if [ -f "${ifcfg_file}" ]; then + . ${ifcfg_file} + fi + bondoptions="$(echo :$BONDING_OPTS | sed 's/\s+/,/')" echo "$bondoptions" >> ${initdir}/etc/cmdline.d/42bond.conf } @@ -244,7 +256,13 @@ kdump_setup_vlan() { # $1: netdev name kdump_setup_znet() { local _options="" - . /etc/sysconfig/network-scripts/ifcfg-$1 + local ifcfg_file + + ifcfg_file=$(get_ifcfg_filename $1) + if [ -f "${ifcfg_file}" ]; then + . ${ifcfg_file} + fi + for i in $OPTIONS; do _options=${_options},$i done