Exec chroot

This commit is contained in:
oddlama 2021-05-30 22:52:28 +02:00
parent 4d276dbc6c
commit 5c1d81d650
No known key found for this signature in database
GPG Key ID: 14EFE510775FE39A
2 changed files with 3 additions and 5 deletions

View File

@ -819,6 +819,7 @@ function touch_or_die() {
# $@: command... # $@: command...
function gentoo_chroot() { function gentoo_chroot() {
if [[ $# -eq 1 ]]; then 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') gentoo_chroot "$1" /bin/bash --init-file <(echo 'init_bash')
fi fi
@ -857,8 +858,8 @@ function gentoo_chroot() {
EXECUTED_IN_CHROOT=true \ EXECUTED_IN_CHROOT=true \
TMP_DIR="$TMP_DIR" \ TMP_DIR="$TMP_DIR" \
CACHED_LSBLK_OUTPUT="$CACHED_LSBLK_OUTPUT" \ CACHED_LSBLK_OUTPUT="$CACHED_LSBLK_OUTPUT" \
chroot -- "$chroot_dir" "$GENTOO_INSTALL_REPO_DIR/scripts/dispatch_chroot.sh" "$@" \ exec 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." || die "Failed to chroot into '$chroot_dir'."
} }
function enable_service() { function enable_service() {

View File

@ -400,7 +400,6 @@ function main_install() {
[[ $IS_EFI == "true" ]] \ [[ $IS_EFI == "true" ]] \
&& mount_efivars && mount_efivars
gentoo_chroot "$ROOT_MOUNTPOINT" "$GENTOO_INSTALL_REPO_BIND/install" __install_gentoo_in_chroot gentoo_chroot "$ROOT_MOUNTPOINT" "$GENTOO_INSTALL_REPO_BIND/install" __install_gentoo_in_chroot
gentoo_umount
} }
function main_chroot() { function main_chroot() {
@ -409,6 +408,4 @@ function main_chroot() {
|| die "'$1' is not a mountpoint" || die "'$1' is not a mountpoint"
gentoo_chroot "$@" gentoo_chroot "$@"
einfo "Unmounting chroot environment"
gentoo_umount
} }