Close fd 3 when disabling logging

This commit is contained in:
oddlama 2020-01-03 00:42:31 +01:00
parent 4df94e6c3d
commit c4d21647ad
No known key found for this signature in database
GPG Key ID: 88EA325D51D53908
2 changed files with 10 additions and 9 deletions

View File

@ -263,7 +263,10 @@ extract_stage3() {
disable_logging() {
# Disables logging which is needed before exec-ing
# Restore stdion
exec 1>&3
# Close fd 3
exec 3<&-
}
gentoo_umount() {
@ -274,6 +277,9 @@ gentoo_umount() {
fi
}
interactive_bash() {
}
gentoo_chroot() {
if [[ $# -eq 0 ]]; then
cat > "$TMP_DIR/.bashrc" <<EOF

View File

@ -81,24 +81,19 @@ main_install_gentoo_in_chroot() {
#install_ansible
einfo "Gentoo installation complete"
einfo "Dropping into chrooted shell"
su
einfo "To chroot into the new system, simply execute the provided 'chroot' wrapper"
}
main_install() {
[[ $# == 0 ]] || die "Too many arguments"
gentoo_umount
install_stage3 \
|| die "Failed to install stage3"
gentoo_chroot "$GENTOO_BOOTSTRAP_BIND/scripts/main.sh" install_gentoo_in_chroot \
|| die "Failed to install gentoo in chroot"
install_stage3
gentoo_chroot "$GENTOO_BOOTSTRAP_BIND/scripts/main.sh" install_gentoo_in_chroot
}
main_chroot() {
gentoo_chroot "$@" \
|| die "Failed to execute script in chroot"
gentoo_chroot "$@"
}
main_umount() {