User setup and erlang installation

A bit fiddly, but this lets us run a realistic erlang install script
from userspace, and then re-enter userspace later without wiping the
installation.
This commit is contained in:
Jarvis Carroll
2025-05-23 21:21:16 +10:00
parent 4f6ee7cc88
commit 28de550295
7 changed files with 204 additions and 13 deletions
+10 -12
View File
@@ -17,14 +17,6 @@ else
./get_debootstrap --arch i386 sid "$FRESH" http://deb.debian.org/debian/
fi
cleanup_mount() {
if mountpoint "$1" > /dev/null
then
echo "Unmounting $1"
umount "$1"
fi
}
if test -e "$ROOT"
then
echo "Existing installation found at $ROOT, removing."
@@ -35,8 +27,14 @@ echo "Copying $FRESH to $ROOT."
cp -r "$FRESH" "$ROOT"
echo "Initializing $ROOT."
mkdir -p "$ROOT/proc"
mount proc $ROOT/proc -t proc
mkdir -p "$ROOT/sys"
mount sysfs $ROOT/sys -t sysfs
./mountpoints
# Don't bother creating a new tmpfs. We don't want to leak files in, and we
# don't want to waste more RAM on a second tmpfs. The whole thing is
# temporary, after all.
chmod 1777 "$ROOT/tmp"
cp -r install_scripts "$ROOT/root"
chroot "$ROOT" /root/install_scripts/user_setup "$@"