aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2023-04-07 11:15:11 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2023-04-07 11:37:31 +0200
commit1a795ad9f5b8fe368a1e597c1bfb12fa112d2101 (patch)
tree447fe6ebb8a375cc06e67cff1f85c89b25bdf90c
parent9ad939e65513fb9d367ba039484febcd63423304 (diff)
Add --install option to bbot bootstrap scripts
-rwxr-xr-xetc/bootstrap/bbot-bootstrap-linux.sh2
-rw-r--r--etc/bootstrap/bbot-bootstrap.service6
-rwxr-xr-xetc/bootstrap/bbot-bootstrap.sh22
3 files changed, 26 insertions, 4 deletions
diff --git a/etc/bootstrap/bbot-bootstrap-linux.sh b/etc/bootstrap/bbot-bootstrap-linux.sh
index 4a79227..8037c27 100755
--- a/etc/bootstrap/bbot-bootstrap-linux.sh
+++ b/etc/bootstrap/bbot-bootstrap-linux.sh
@@ -12,7 +12,7 @@ fi
cd /tmp
ulimit -c unlimited
-# Note: bootstrap script options must come before build.sh options/arguments
+# Note: bootstrap script options must come before build.sh options/arguments.
#
"$(dirname "$0")/bbot-bootstrap.sh" --make make --jobs "$jobs" "$@"
diff --git a/etc/bootstrap/bbot-bootstrap.service b/etc/bootstrap/bbot-bootstrap.service
index 5f968bd..5d6c023 100644
--- a/etc/bootstrap/bbot-bootstrap.service
+++ b/etc/bootstrap/bbot-bootstrap.service
@@ -18,12 +18,18 @@ WorkingDirectory=/home/build
#Environment=DISPLAY=:99
Environment=CXX=g++
+Environment=INSTALL=/usr/local
Environment=BUILD=/tmp
Environment=ENVIRONMENTS=/home/build/environments
+# Note: bootstrap script options must come before build.sh options/arguments.
+#
ExecStart=/usr/local/bin/bbot-bootstrap-linux.sh \
+--install ${INSTALL} \
--build ${BUILD} \
--environments ${ENVIRONMENTS} \
+--private \
+--sudo sudo \
${CXX}
StandardInput=tty-force
diff --git a/etc/bootstrap/bbot-bootstrap.sh b/etc/bootstrap/bbot-bootstrap.sh
index 495bbf1..e3231bf 100755
--- a/etc/bootstrap/bbot-bootstrap.sh
+++ b/etc/bootstrap/bbot-bootstrap.sh
@@ -32,6 +32,7 @@ run ()
# Defaults that can be changed via command line.
#
+install=
build=/tmp
environments="$HOME/environments"
make=
@@ -39,8 +40,19 @@ jobs=
# Parse options.
#
+# Note that if --install is specified, any necessary --private/--sudo options
+# will need to be specified as <build-options>.
+#
while test $# -ne 0; do
case $1 in
+ --install)
+ shift
+ if test $# -eq 0; then
+ error "missing install directory after --install"
+ fi
+ install="$1"
+ shift
+ ;;
--build)
shift
if test $# -eq 0; then
@@ -84,14 +96,18 @@ done
# Note: build_options is array-like (expanded unquoted).
#
tftp="196.254.111.222"
-install="/usr/local"
-build_options=
verbose=3
timeout=600
+build_options=
#install="/tmp/bbot-install"
#tftp="127.0.0.1:55123"
-#build_options="--install-dir $install"
+
+if test -n "$install"; then
+ build_options="$build_options --install-dir $install"
+else
+ install="/usr/local"
+fi
# If make was specified, add it to build_options.
#