aboutsummaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-03-30 11:27:54 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-03-30 11:27:54 +0200
commita222b03d3942d380e24042cc8c14f6215cd45749 (patch)
tree5601a13c55e3f863007726a9f616af160afc5e2a /init
parent73dfb006998bfca6410411c698ac52595264bb9c (diff)
Add support for having multiple toolchains on single OS instance
Diffstat (limited to 'init')
-rwxr-xr-xinit14
1 files changed, 10 insertions, 4 deletions
diff --git a/init b/init
index 64016a1..89191de 100755
--- a/init
+++ b/init
@@ -88,13 +88,19 @@ readarray -t cmdline < <(cat /proc/cmdline | \
#
info "command line:"
for v in "${cmdline[@]}"; do
- var="$(sed -r -n -e 's/^buildos\.([^=]+)=.*$/\1/p' <<<"$v")" # Extract name.
+ var="$(sed -n -re 's/^buildos\.([^=]+)=.*$/\1/p' <<<"$v")" # Extract name.
if [ -n "$var" ]; then
- val="$(sed -r -e 's/^[^=]+=(.*)$/\1/' <<<"$v")" # Extract value.
- val="$(sed -r -e "s/^('(.*)'|\"(.*)\")$/\2\3/" <<<"$val")" # Strip quoted.
+ val="$(sed -re 's/^[^=]+=(.*)$/\1/' <<<"$v")" # Extract value.
+ val="$(sed -re "s/^('(.*)'|\"(.*)\")$/\2\3/" <<<"$val")" # Strip quoted.
info " $var=$val"
- declare "$var=$val"
+
+ # If the variable contains a dot, then it is a toolchain variable and we
+ # don't care about those in init.
+ #
+ if [[ "$var" != *.* ]]; then
+ declare "$var=$val"
+ fi
fi
done