mirror of
https://git.yoctoproject.org/poky
synced 2026-02-20 08:29:42 +01:00
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" (From OE-Core rev: 16bad6260a6a25b2ec25c7eb0dfe526db56f166e) Signed-off-by: Christophe Guibout <christophe.guibout@st.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 88b8b94bd2d052bca29d27bd5cd00eddb0f5999d) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
99d2fe8638
commit
fe87efd920
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user