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@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
This commit is contained in:
WANG Chao 2013-06-13 10:06:28 +08:00 committed by Baoquan He
parent 76602596e0
commit dd7ce4b5fd
1 changed files with 3 additions and 1 deletions

View File

@ -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() {