arch-packages/prepare-chroot.sh

16 lines
421 B
Bash
Raw Permalink Normal View History

2022-08-01 11:21:23 +02:00
#!/bin/sh
[ -z "$CHROOT" ] && echo "CHROOT env var is unset." && exit 1
sudo -v || exit 1
[ ! -d "$CHROOT/root" ] && sudo mkarchroot -M "$(dirname "$0")"/makepkg.conf "$CHROOT/root" base-devel
2022-08-01 11:21:23 +02:00
arch-nspawn "$CHROOT/root" pacman -Syu
mkdir -p -m 0755 "$CHROOT/$USER"
2023-07-06 08:22:20 +02:00
mountpoint -q "$CHROOT/$USER"
test $? -ne 0 && sudo mount -t tmpfs -o defaults,nodev,mode=0755,uid=$(id -u),gid=$(id -g) tmpfs "$CHROOT/$USER"
2022-08-01 11:21:23 +02:00
exit 0