switch to bwrap, add skipsetup, don't hardcode 'user'
This commit is contained in:
parent
bd51da33a2
commit
743ae063dc
8
build
8
build
@ -1,13 +1,17 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
[ -d cache ] || mkdir cache
|
[ -d cache ] || mkdir cache
|
||||||
SPAWN="systemd-nspawn -M gentoolooqsbuilder -D gentoo --bind=$(realpath ./out):/out --bind=$(realpath scripts):/scripts --bind=$(realpath cache):/var/cache/distfiles"
|
|
||||||
export UNPRIVUSER="user"
|
|
||||||
|
|
||||||
|
SPAWN="bwrap --bind gentoo / --dev /dev --proc /proc --perms 1777 --tmpfs /dev/shm --ro-bind /etc/resolv.conf /etc/resolv.conf --bind $(realpath ./out) /out --bind $(realpath scripts) /scripts --bind $(realpath cache) /var/cache/distfiles "
|
||||||
|
export UNPRIVUSER=$(id -n -u 1000)
|
||||||
|
|
||||||
|
if [ "$1" != "skipsetup" ] ; then
|
||||||
su $UNPRIVUSER -c ./scripts/1-create.sh
|
su $UNPRIVUSER -c ./scripts/1-create.sh
|
||||||
./scripts/2-create.sh
|
./scripts/2-create.sh
|
||||||
${SPAWN} /scripts/3-setup-gentoo.sh
|
${SPAWN} /scripts/3-setup-gentoo.sh
|
||||||
chown "$UNPRIVUSER" -R out
|
chown "$UNPRIVUSER" -R out
|
||||||
|
fi
|
||||||
${SPAWN} su - builder -c /scripts/4-build-looqs.sh
|
${SPAWN} su - builder -c /scripts/4-build-looqs.sh
|
||||||
chown "$UNPRIVUSER" -R out
|
chown "$UNPRIVUSER" -R out
|
||||||
su $UNPRIVUSER -c "cd $(pwd); ./scripts/5-bundle.sh"
|
su $UNPRIVUSER -c "cd $(pwd); ./scripts/5-bundle.sh"
|
||||||
|
Loading…
Reference in New Issue
Block a user