From 5c1d81d650f321e585e59b357764d526333b8a20 Mon Sep 17 00:00:00 2001 From: oddlama Date: Sun, 30 May 2021 22:52:28 +0200 Subject: [PATCH] Exec chroot --- scripts/functions.sh | 5 +++-- scripts/main.sh | 3 --- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/functions.sh b/scripts/functions.sh index e114d53..37add51 100644 --- a/scripts/functions.sh +++ b/scripts/functions.sh @@ -819,6 +819,7 @@ function touch_or_die() { # $@: command... function gentoo_chroot() { if [[ $# -eq 1 ]]; then + einfo "To later unmount all virtual filesystems, simply use umount -l ${1@Q}" gentoo_chroot "$1" /bin/bash --init-file <(echo 'init_bash') fi @@ -857,8 +858,8 @@ function gentoo_chroot() { EXECUTED_IN_CHROOT=true \ TMP_DIR="$TMP_DIR" \ CACHED_LSBLK_OUTPUT="$CACHED_LSBLK_OUTPUT" \ - chroot -- "$chroot_dir" "$GENTOO_INSTALL_REPO_DIR/scripts/dispatch_chroot.sh" "$@" \ - || die "Failed to chroot into '$chroot_dir', or the executed command returned an error." + exec chroot -- "$chroot_dir" "$GENTOO_INSTALL_REPO_DIR/scripts/dispatch_chroot.sh" "$@" \ + || die "Failed to chroot into '$chroot_dir'." } function enable_service() { diff --git a/scripts/main.sh b/scripts/main.sh index 7dd3d55..8e57ffd 100644 --- a/scripts/main.sh +++ b/scripts/main.sh @@ -400,7 +400,6 @@ function main_install() { [[ $IS_EFI == "true" ]] \ && mount_efivars gentoo_chroot "$ROOT_MOUNTPOINT" "$GENTOO_INSTALL_REPO_BIND/install" __install_gentoo_in_chroot - gentoo_umount } function main_chroot() { @@ -409,6 +408,4 @@ function main_chroot() { || die "'$1' is not a mountpoint" gentoo_chroot "$@" - einfo "Unmounting chroot environment" - gentoo_umount }