mirror of
https://linux.maple.camp/git/ahill/maplelinux-bootstrap.git
synced 2026-02-11 10:13:35 +00:00
Launch zsh automatically if possible
This commit is contained in:
@@ -1,6 +1,14 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
MAPLE=$(pwd)/maple
|
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 --rbind /dev $MAPLE/dev && mount --make-rslave $MAPLE/dev; then
|
||||||
if mount -t proc /proc $MAPLE/proc; then
|
if mount -t proc /proc $MAPLE/proc; then
|
||||||
if mount --rbind /sys $MAPLE/sys && mount --make-rslave $MAPLE/sys; 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 mount --bind /run $MAPLE/run; then
|
||||||
if [ -d $MAPLE/maple/sources ]; then
|
if [ -d $MAPLE/maple/sources ]; then
|
||||||
if mount --bind ./sources $MAPLE/maple/sources; then
|
if mount --bind ./sources $MAPLE/maple/sources; then
|
||||||
chroot $MAPLE /bin/sh
|
run_chroot
|
||||||
umount $MAPLE/maple/sources
|
umount $MAPLE/maple/sources
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
chroot $MAPLE /bin/sh
|
run_chroot
|
||||||
fi
|
fi
|
||||||
umount $MAPLE/run
|
umount $MAPLE/run
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user