diff options
| author | Alexander Hill <ahill@breadpudding.dev> | 2025-04-20 05:38:45 -0400 |
|---|---|---|
| committer | Alexander Hill <ahill@breadpudding.dev> | 2025-04-20 05:38:45 -0400 |
| commit | 7dd606194adbd9b723bb5ba0841958e811ba7bef (patch) | |
| tree | fd7e30105e2d2c03cef967625d4f96c26cdc4e5b /chroot-bootstrap.sh | |
| parent | 0e1e0baad638645449877e50af121355c5fdaa71 (diff) | |
Launch zsh automatically if possible
Diffstat (limited to 'chroot-bootstrap.sh')
| -rwxr-xr-x | chroot-bootstrap.sh | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/chroot-bootstrap.sh b/chroot-bootstrap.sh index a09bbaf..5fe43d0 100755 --- a/chroot-bootstrap.sh +++ b/chroot-bootstrap.sh @@ -1,6 +1,14 @@ #!/bin/sh MAPLE=$(pwd)/maple +run_chroot() { + SHELL=/bin/sh + if [ -e $MAPLE/bin/zsh ]; then + SHELL=/bin/zsh + fi + chroot $MAPLE $SHELL +} + if mount --rbind /dev $MAPLE/dev && mount --make-rslave $MAPLE/dev; then if mount -t proc /proc $MAPLE/proc; then if mount --rbind /sys $MAPLE/sys && mount --make-rslave $MAPLE/sys; then @@ -8,11 +16,11 @@ if mount --rbind /dev $MAPLE/dev && mount --make-rslave $MAPLE/dev; then if mount --bind /run $MAPLE/run; then if [ -d $MAPLE/maple/sources ]; then if mount --bind ./sources $MAPLE/maple/sources; then - chroot $MAPLE /bin/sh + run_chroot umount $MAPLE/maple/sources fi else - chroot $MAPLE /bin/sh + run_chroot fi umount $MAPLE/run fi |
