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
--- Update from V1: - Add a xargs call to deduplicate the spaces. Although bash should convert the unquated string into a list of parameters and deduplicate the spaces automatically, but if someone add quotes it will break and it's confusing. --- dracut-module-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 3fa696d..b395160 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -264,7 +264,7 @@ kdump_setup_bond() {
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 }
On 08/26/19 at 01:00pm, Kairui Song wrote:
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
Update from V1:
- Add a xargs call to deduplicate the spaces. Although bash should convert the unquated string into a list of parameters and deduplicate the spaces automatically, but if someone add quotes it will break and it's confusing.
dracut-module-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 3fa696d..b395160 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -264,7 +264,7 @@ kdump_setup_bond() {
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
}
-- 2.21.0 _______________________________________________ kexec mailing list -- kexec@lists.fedoraproject.org To unsubscribe send an email to kexec-leave@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/kexec@lists.fedoraproject.org
Ack
Thanks Dave