On 2016/05/19 at 16:15, Xunlei Pang wrote:
On 2016/05/19 at 15:49, Dave Young wrote:
Hi, Xunlei
On 04/25/16 at 12:39pm, Xunlei Pang wrote:
Change all the ifcfg file users to call get_ifcfg_filename().
A bit more explanation why we should do it here, what is the problem etc..
Ok, will add more explanation later.
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
Have it been tested on other arch other than x86?
Good point, I will check the implementation and do some test on other ARCHs.
I checked the script and also tested on ppc64 and s390, get_ifcfg_filename() can work properly like x86.
Regards, Xunlei
Regards, Xunlei
for i in $OPTIONS; do _options=${_options},$i done
-- 1.8.3.1 _______________________________________________ kexec mailing list kexec@lists.fedoraproject.org http://lists.fedoraproject.org/admin/lists/kexec@lists.fedoraproject.org
Thanks Dave