You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently booster reads proc/cmdline and splits it by space. It works for majority of simple cases but it will fail if something more advanced is used in the command line.
For example parameters itself may use space. In this case quoting around the params need to be used. Per kernel documentation:
Double-quotes can be used to protect spaces in values
But it also looks like some bootloaders (e.g. grub) add quoting in a different way, like this "param=value with a space". So booster needs to handle quoting in both ways: param="value with a space" and "param=value with a space". This in addition to quotes around UUID handled here #6.
Besides spaces the values might contain escape symbols param="foo \" bar". And parser probably needs to handle other param delimiter, e.g. params might be separated with tabs.
TestLUKS2WithQuotesOverUUID test is failing now with
[ 0.807449] booster: while parsing cmdline parameter unexpected " found at 98, input may be malformed, attempting to proceed
[ 0.808704] booster: while parsing cmdline parameter unexpected " found at 135, input may be malformed, attempting to proceed
[ 0.809946] booster: root=UUID="7bbf9363-eb42-4476-8c1c-9f1f4d091385": unable to parse UUID parameter UUID="7bbf9363-eb42-4476-8c1c-9f1f4d091385": expected input length is 36, got length 38
[ 0.811831] booster: Press ENTER to reboot
Currently booster reads
proc/cmdline
and splits it by space. It works for majority of simple cases but it will fail if something more advanced is used in the command line.For example parameters itself may use space. In this case quoting around the params need to be used. Per kernel documentation:
But it also looks like some bootloaders (e.g. grub) add quoting in a different way, like this
"param=value with a space"
. So booster needs to handle quoting in both ways:param="value with a space"
and"param=value with a space"
. This in addition to quotes around UUID handled here #6.Besides spaces the values might contain escape symbols
param="foo \" bar"
. And parser probably needs to handle other param delimiter, e.g. params might be separated with tabs.It looks like we need a real advanced parser that handles all these cases. It worth reviewing kmod cmdline parser here to see if we can go similar way https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git/tree/libkmod/libkmod-config.c?id=8742be0aa5ed14d28980eb706b08e8bdf650f21c#n528
The text was updated successfully, but these errors were encountered: