From e98ae6619dc9ec3201c47589476e84dda7406e71 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 26 Mar 2021 15:21:16 +0200 Subject: Add buildos.interactive.=true|false|both cmdline variable --- buildos | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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 . variables for this +# toolchain. # function toolchain_value () # { @@ -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 () # 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 () # -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/" \ -- cgit v1.1