You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
618 B

set -e
[ -d cache ] || mkdir cache
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/
${SPAWN} /scripts/
chown "$UNPRIVUSER" -R out
${SPAWN} su - builder -c /scripts/
chown "$UNPRIVUSER" -R out
su $UNPRIVUSER -c "cd $(pwd); ./scripts/"