From 233bd8765e222e9e7adcaf8d1d6f12903295db14 Mon Sep 17 00:00:00 2001 From: WANG Chao Date: Mon, 8 Apr 2013 18:02:21 +0800 Subject: [PATCH] Add support for bridge over bond/team/vlan. Kdump module doesn't check if bridge is stack on other complex interface and setup proper dracut cmdline. That makes dracut fail to setup a working network environment in 2nd kernel. This patch adds the ability to setup proper dracut cmdline for bridge over bond/team/vlan. Although in this timeframe, drauct only supports bridge over bond among these three complex network, it's worth fixing the other two types (bridge over team/vlan) along with. It would be much easier for us once the dracut part is done. Signed-off-by: WANG Chao Acked-by: Baoquan He --- dracut-module-setup.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 4b0852a..2e48057 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -91,7 +91,15 @@ kdump_get_perm_addr() { kdump_setup_bridge() { local _netdev=$1 for _dev in `ls /sys/class/net/$_netdev/brif/`; do - echo -n " ifname=$_dev:$(kdump_get_mac_addr $_dev)" >> ${initdir}/etc/cmdline.d/41bridge.conf + if kdump_is_bond "$_dev"; then + kdump_setup_bond "$_dev" + elif kdump_is_team "$_dev"; then + kdump_setup_team "$_dev" + elif kdump_is_vlan "$_dev"; then + kdump_setup_vlan "$_dev" + else + echo -n " ifname=$_dev:$(kdump_get_mac_addr $_dev)" >> ${initdir}/etc/cmdline.d/41bridge.conf + fi done echo " bridge=$_netdev:$(cd /sys/class/net/$_netdev/brif/; echo * | sed -e 's/ /,/g')" >> ${initdir}/etc/cmdline.d/41bridge.conf }