dracut-module-setup: fix bond ifcfg processing

Bond options in ifcfg is space separated, dracut expected it to be comma
separated, so it have to be parsed and converted during initramfs
building.

The currently parsing and convert pattern is flawed, for example:
" downdelay=0 miimon=100 mode=802.3ad updelay=0 "

is converted to :
":,downdelay=0 miimon=100 mode=802.3ad updelay=0 "

should be:
":downdelay=0,miimon=100,mode=802.3ad,updelay=0"

So fix this issue by using more simple but robust method for processing
the options.

Signed-off-by: Kairui Song <kasong@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
This commit is contained in:
Kairui Song 2019-08-21 10:59:49 +08:00
parent a5ea190af2
commit 75297d6f20

View File

@ -264,7 +264,7 @@ kdump_setup_bond() {
source_ifcfg_file $_netdev source_ifcfg_file $_netdev
bondoptions="$(echo :$BONDING_OPTS | sed 's/\s\+/,/')" bondoptions=":$(echo $BONDING_OPTS | xargs echo | tr " " ",")"
echo "$bondoptions" >> ${initdir}/etc/cmdline.d/42bond.conf echo "$bondoptions" >> ${initdir}/etc/cmdline.d/42bond.conf
} }