[kexec-tools/f19] dracut-module-setup.sh: improve the approach to get a bridged interface list
Baoquan He
baoquan at fedoraproject.org
Tue Jun 18 09:26:07 UTC 2013
commit 29009939636126d58292fc626f66798473cefeb5
Author: WANG Chao <chaowang at redhat.com>
Date: Thu Jun 13 10:06:28 2013 +0800
dracut-module-setup.sh: improve the approach to get a bridged interface list
When directory is empty, echo * will output *, not empty string. That's
not intended.
Also it looks a little bit nicer now.
Signed-off-by: WANG Chao <chaowang at redhat.com>
Acked-by: Baoquan He <bhe at redhat.com>
dracut-module-setup.sh | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 87d0a20..725eecf 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -100,6 +100,7 @@ kdump_get_perm_addr() {
kdump_setup_bridge() {
local _netdev=$1
+ local _brif=""
for _dev in `ls /sys/class/net/$_netdev/brif/`; do
if kdump_is_bond "$_dev"; then
kdump_setup_bond "$_dev"
@@ -110,8 +111,9 @@ kdump_setup_bridge() {
else
echo -n " ifname=$_dev:$(kdump_get_mac_addr $_dev)" >> ${initdir}/etc/cmdline.d/41bridge.conf
fi
+ _brif+="$_dev,"
done
- echo " bridge=$_netdev:$(cd /sys/class/net/$_netdev/brif/; echo * | sed -e 's/ /,/g')" >> ${initdir}/etc/cmdline.d/41bridge.conf
+ echo " bridge=$_netdev:$(echo $_brif | sed -e 's/,$//')" >> ${initdir}/etc/cmdline.d/41bridge.conf
}
kdump_setup_bond() {
More information about the scm-commits
mailing list