scripts/gentoo-chroot.sh
Martin Matous 5a4419bb4e
add scripts
Signed-off-by: Martin Matous <m@matous.dev>
2022-03-28 00:46:25 +02:00

18 lines
612 B
Bash
Executable file

#!/usr/bin/env bash
MOUNTPOINT=/mnt/gentoo
mkdir -p "${MOUNTPOINT}" &&
mount --types proc /proc "${MOUNTPOINT}"/proc &&
mount --rbind /sys "${MOUNTPOINT}"/sys &&
mount --make-rslave "${MOUNTPOINT}"/sys &&
mount --rbind /dev "${MOUNTPOINT}"/dev &&
mount --make-rslave "${MOUNTPOINT}"/dev &&
mount --bind /run "${MOUNTPOINT}"/run &&
mount --make-slave "${MOUNTPOINT}"/run &&
mount LABEL=BOOT "${MOUNTPOINT}"/boot &&
mount --rbind /tmp "${MOUNTPOINT}"/tmp &&
chroot "${MOUNTPOINT}" /bin/bash
# gentoo install media not running systemd
# systemd-nspawn -D /mnt/mychroot --bind=/tmp --resolv-conf=/etc/resolv.conf