Commit b9073da4 authored by Martin Peres's avatar Martin Peres
Browse files

initscript/cmdline parsing: handle quoted strings

parent 6a20ecd8
......@@ -51,8 +51,15 @@ ARG_CACHE_DEVICE="none"
function parse_cmdline {
cmdline=$(busybox cat /proc/cmdline)
# TODO: add a parameter to download a volume with firmwares and modules
for param in $(echo "$cmdline" | busybox tr ' ' '\n'); do
# Go through the list of options in the commandline, but remove the quotes
# around multi-words arguments. Awk seems to be doing that best.
IFS=$'\n'
for param in $(echo "$cmdline" | awk -F\" 'BEGIN { OFS = "" } {
for (i = 1; i <= NF; i += 2) {
gsub(/[ \t]+/, "\n", $i)
}
print
}'); do
value="${param#*=}"
case $param in
b2c.insmods=*)
......@@ -66,6 +73,7 @@ function parse_cmdline {
;;
esac
done
# TODO: add a parameter to download a volume with firmwares and modules
}
function load_modules {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment