dracut-module-setup.sh: use perm addr of slaves to setup bonding network

Currently we use runtime mac addr to 2nd kernel to setup bonding
interface. But Bonding master will modify its slaves' mac addr and
incorrect mac addr is passed to 2nd kernel. Thus dracut in 2nd kernel
can't find expected slaves and bonding will fail.

Fix this issue by using perm address.

Tested in Fedora 19 KVM guest configured bonding with two slaves.

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
This commit is contained in:
WANG Chao 2013-06-13 10:06:25 +08:00 committed by Baoquan He
parent cd0a7a87d0
commit 671e18f43b

View File

@ -117,7 +117,7 @@ kdump_setup_bridge() {
kdump_setup_bond() {
local _netdev=$1
for _dev in `cat /sys/class/net/$_netdev/bonding/slaves`; do
echo -n " ifname=$_dev:$(kdump_get_mac_addr $_dev)" >> ${initdir}/etc/cmdline.d/42bond.conf
echo -n " ifname=$_dev:$(kdump_get_perm_addr $_dev)" >> ${initdir}/etc/cmdline.d/42bond.conf
done
echo -n " bond=$_netdev:$(sed -e 's/ /,/g' /sys/class/net/$_netdev/bonding/slaves)" >> ${initdir}/etc/cmdline.d/42bond.conf
# Get bond options specified in ifcfg