summaryrefslogtreecommitdiff
path: root/start-container-schroot.sh
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@linaro.org>2017-01-31 21:21:11 +0000
committerChristophe Lyon <christophe.lyon@linaro.org>2017-01-31 21:21:11 +0000
commitb3a5ec886f9048ce6f0bb66a450eefcba3e79724 (patch)
treeab37006c14e5da27896883e6f4e34d57414932fc /start-container-schroot.sh
parentabe5c9cd42e8b5eae72f465be4aa00d2bb21697a (diff)
start-container-*.sh: Support optional host parameter.
This is currently used to force the local hostname in case it does not match the public hostname. Change-Id: I3efefe8438f7bdfabbe518885b3806f893c18bc8
Diffstat (limited to 'start-container-schroot.sh')
-rwxr-xr-xstart-container-schroot.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/start-container-schroot.sh b/start-container-schroot.sh
index b569e8fd..5501547a 100755
--- a/start-container-schroot.sh
+++ b/start-container-schroot.sh
@@ -11,17 +11,19 @@ set -e
# to run inside the container.
# - definition of ${session_host} and ${session_port}, can be used for
# a remote connexion to the container
-if [ $# -ne 2 ]; then
- echo Usage: $0 arch flavour
+if [ $# -ne 2 -a $# -ne 3 ]; then
+ echo Usage: $0 arch flavour [host]
echo " arch: architecture (eg: amd64, i386, arm64, armhf)"
echo " flavour: distribution (eg: trusty)"
+ echo " host: hostname where the container will run, defaults to localhost"
exit 1
fi
container_arch=$1
distro=$2
+session_host=$3
+[ x"$session_host" = x ] && session_host=localhost
-session_host="$(hostname).tcwglab"
session_port=22
schroot_image="tcwg-build-${container_arch}-${distro}"
session_id=$(schroot -b -c chroot:$schroot_image --preserve-environment)