2021-05-03 13:31:15 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Make sure the partition is mounted according to fstab
|
|
|
|
mount /mnt/gentoo 2>/dev/null
|
|
|
|
|
|
|
|
# Mount necessary directories for chroot to be possible
|
|
|
|
mount --types proc /proc /mnt/gentoo/proc
|
|
|
|
mount --rbind /sys /mnt/gentoo/sys
|
|
|
|
mount --make-rslave /mnt/gentoo/sys
|
|
|
|
mount --rbind /dev /mnt/gentoo/dev
|
|
|
|
mount --make-rslave /mnt/gentoo/dev
|
|
|
|
|
2021-07-14 12:30:35 +00:00
|
|
|
# Chroot with zsh shell
|
|
|
|
chroot /mnt/gentoo /bin/zsh --login
|
2021-05-03 13:31:15 +00:00
|
|
|
|
|
|
|
# Unmount recursively mounted directories
|
|
|
|
umount -l /mnt/gentoo/dev{/shm,/pts,}
|
|
|
|
umount -R /mnt/gentoo
|
|
|
|
|
|
|
|
# Remount partition accordingly to fstab
|
|
|
|
# (the above umountings will unmount gentoo completely,
|
|
|
|
# which means that remounting is necessary)
|
|
|
|
mount /mnt/gentoo
|