diff options
author | Christophe GUIBOUT <christophe.guibout@st.com> | 2020-09-10 14:06:31 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-09-11 18:05:17 +0100 |
commit | 88b8b94bd2d052bca29d27bd5cd00eddb0f5999d (patch) | |
tree | 201104c1f0580b71b9296666db1c4dbc45fd2840 /meta/recipes-core | |
parent | f5f97d33a1703d75b9fd9760f2c7767081538e00 (diff) | |
download | openembedded-core-contrib-88b8b94bd2d052bca29d27bd5cd00eddb0f5999d.tar.gz |
initramfs-framework: support kernel cmdline with double quotes
It avoids init to crash when kernel cmdline contains a string with
spaces inside, like that:
dyndbg="file drivers/usb/core/hub.c +pltf"
Signed-off-by: Christophe Guibout <christophe.guibout@st.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core')
-rwxr-xr-x | meta/recipes-core/initrdscripts/initramfs-framework/init | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/init b/meta/recipes-core/initrdscripts/initramfs-framework/init index c71ce0ce8c..567694aff7 100755 --- a/meta/recipes-core/initrdscripts/initramfs-framework/init +++ b/meta/recipes-core/initrdscripts/initramfs-framework/init @@ -88,12 +88,25 @@ fi # populate bootparam environment for p in `cat /proc/cmdline`; do + if [ -n "$quoted" ]; then + value="$value $p" + if [ "`echo $p | sed -e 's/\"$//'`" != "$p" ]; then + eval "bootparam_${quoted}=${value}" + unset quoted + fi + continue + fi + opt=`echo $p | cut -d'=' -f1` opt=`echo $opt | sed -e 'y/.-/__/'` if [ "`echo $p | cut -d'=' -f1`" = "$p" ]; then eval "bootparam_${opt}=true" else value="`echo $p | cut -d'=' -f2-`" + if [ "`echo $value | sed -e 's/^\"//'`" != "$value" ]; then + quoted=${opt} + continue + fi eval "bootparam_${opt}=\"${value}\"" fi done |