From 9ea05a7b50dfca4947b39a64e6a58184fd3e565b Mon Sep 17 00:00:00 2001 From: Salt Date: Fri, 4 Dec 2020 02:37:34 -0600 Subject: [PATCH] Alright fine we'll use chroot --- gentoostrap.sh | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/gentoostrap.sh b/gentoostrap.sh index dd2fb0c..47d3f48 100755 --- a/gentoostrap.sh +++ b/gentoostrap.sh @@ -79,7 +79,6 @@ Usage: $_name [OPTION]... -h Print this help text -c Perform the Gentoo half of installation. Must be invoked from a chroot - or a systemd-nspawn container -d Perform the second Gentoo half of installation from a chroot -v Print more status messages. Stacks @@ -193,21 +192,15 @@ build-gentoo() { "${EDITOR:-vim}" "$_optdest/etc/fstab" # Now we need to pivot into a chroot and finish configuration natively - # Buuuut... since we're using systemd, we get to just spawn a systemd-nspawn container popd log "Pivoting to container for more setup" cp "$0" "$_optdest/gentoostrap.sh" - for dir in proc sys dev; do - umount "$_optdest/$dir" || : - done - sudo systemd-nspawn --directory="$_optdest" /gentoostrap.sh -c - - # The nspawn container sadly cannot manipulate the environment entirely, so we need to now do an ACTUAL chroot to install GRUB mount --types proc /proc "$_optdest/proc" mount --rbind /sys "$_optdest/sys" mount --make-rslave "$_optdest/sys" mount --rbind /dev "$_optdest/dev" mount --make-rslave "$_optdest/dev" + chroot "$_optdest" /gentoostrap.sh -c chroot "$_optdest" /gentoostrap.sh -d log "Configuration complete! You should be good to reboot now." } @@ -354,7 +347,7 @@ main() { # TODO: That # Validate core program dependencies log "Validating dependencies" 2 - if ! has basename chroot curl sha512sum systemd-nspawn tar; then + if ! has basename chroot curl sha512sum tar; then error "Failed to find program: $_return" 1 fi