sh: Generalize chroot path handling

This commit is contained in:
Markus Koch 2022-01-21 17:12:43 +01:00
parent 87ea4186d1
commit 32c7ec2912

View File

@ -4,7 +4,9 @@
# ArchLinux root via pacstrap, configured with build tools
# User: builduser 1000
BUILD_BASE='/opt/micobu/rootfs/home/builduser/base'
ROOTFS_BASE='/opt/micobu/rootfs'
ROOTFS_DIR='/home/builduser/base' # in rootfs
BUILD_BASE=$ROOTFS_BASE$ROOTFS_DIR
ARTEFACT_BASE='/opt/micobu/rootfs/home/builduser/artefacts'
BUILD_TIMEOUT='600'
API_KEY='mykey'
@ -62,7 +64,7 @@ EOF
META_DATE_START="`date '+%s'`"
set +e
set -o pipefail
firejail --noprofile --chroot=/opt/micobu-rootfs --net=none --read-write="$BUILD_DIR" env -i HOME=/home/builduser PATH=/bin:/usr/bin "bash" "-c" "timeout $BUILD_TIMEOUT ~/micobu_run.sh" | tee $BUILD_BASE/$MICOBU_TEMP_NAME/log.txt
firejail --noprofile --chroot=$ROOTFS_BASE --net=none --read-write="$BUILD_BASE" env -i HOME=$ROOTFS_DIR PATH=/bin:/usr/bin "bash" "-c" "timeout $BUILD_TIMEOUT ~/micobu_run.sh" | tee $BUILD_BASE/$MICOBU_TEMP_NAME/log.txt
RET=$?
set +o pipefail
set -e