aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-03-26 15:21:16 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-03-26 15:21:16 +0200
commite98ae6619dc9ec3201c47589476e84dda7406e71 (patch)
treefc56cea4bc0fedbd5c57741eb0085fcd08abddbf
parent82e00e4f4e8f3c8ac5b59576d976e060e8186aa1 (diff)
Add buildos.interactive.<toolchain>=true|false|both cmdline variable
-rwxr-xr-xbuildos13
1 files changed, 12 insertions, 1 deletions
diff --git a/buildos b/buildos
index 2e372a2..a52a5e7 100755
--- a/buildos
+++ b/buildos
@@ -129,7 +129,8 @@ fi
# Process toolchains.
#
-# Return the value of one of the toolchain_* variables for this toolchain.
+# Return the value of one of the <variable>.<toolchain> variables for this
+# toolchain.
#
function toolchain_value () # <toolchain-prefix> <variable>
{
@@ -171,6 +172,12 @@ for tn in "${!toolchains[@]}"; do
instances=$(($instances + $(toolchain_value "$tp" instances)))
+ # Default to non-interactive-only.
+ #
+ if [ -z "$(toolchain_value "$tp" interactive)" ]; then
+ declare "${tp}interactive=false"
+ fi
+
# Default to 0 nice value.
#
if [ -z "$(toolchain_value "$tp" nice)" ]; then
@@ -276,12 +283,14 @@ function print ()
tc="$(toolchain_value "$tp" nice)"
tb="$(toolchain_value "$tp" bridge)"
ti="$(toolchain_value "$tp" instances)"
+ ta="$(toolchain_value "$tp" interactive)"
tu="$(toolchain_value "$tp" toolchain_url)"
tt="$(toolchain_value "$tp" toolchain_trust)"
echo "$tn.nice: $tc"
echo "$tn.bridge: $tb"
echo "$tn.instances: $ti"
+ echo "$tn.interactive: $ta"
echo "$tn.toolchain_url: $tu"
echo "$tn.toolchain_trust: $tt"
@@ -801,6 +810,7 @@ function bbot_start () # <toolchain-name> <toolchain-index>
local tc="$(toolchain_value "$tp" nice)"
local tb="$(toolchain_value "$tp" bridge)"
local ti="$(toolchain_value "$tp" instances)"
+ local ta="$(toolchain_value "$tp" interactive)"
local tv="$(toolchain_value "$tp" toolchain_fver)"
local ts="$(toolchain_value "$tp" toolchain_file_csum)"
@@ -870,6 +880,7 @@ function bbot_start () # <toolchain-name> <toolchain-index>
-e "s/^(Environment=RAM)=.*/\1=$ram_slice/" \
-e "s/^(Environment=BRIDGE)=.*/\1=$tb/" \
-e "s#^(Environment=AUTH_KEY)=.*#\1=/state/etc/host-key.pem#" \
+ -e "s/^(Environment=INTERACTIVE)=.*/\1=$ta/" \
-e "s/^(Environment=TOOLCHAIN_ID)=.*/\1=$ts/" \
-e "s/^(Environment=TOOLCHAIN_NUM)=.*/\1=$tx/" \
-e "s/^(Environment=TOOLCHAIN_VER)=.*/\1=$tv/" \