Disable logging before chrooting
This commit is contained in:
parent
a5e8476352
commit
b3cf81f95d
|
@ -257,6 +257,11 @@ extract_stage3() {
|
|||
|| die "Could not cd into '$TMP_DIR'"
|
||||
}
|
||||
|
||||
disable_logging() {
|
||||
# Disables logging which is needed before exec-ing
|
||||
exec 1>&3
|
||||
}
|
||||
|
||||
gentoo_umount() {
|
||||
einfo "Unmounting root filesystem"
|
||||
if mountpoint -q -- "$ROOT_MOUNTPOINT"; then
|
||||
|
@ -293,6 +298,7 @@ gentoo_chroot() {
|
|||
|
||||
# Execute command
|
||||
einfo "Chrooting..."
|
||||
disable_logging
|
||||
EXECUTED_IN_CHROOT=true \
|
||||
TMP_DIR=$TMP_DIR \
|
||||
exec chroot "$ROOT_MOUNTPOINT" "$GENTOO_BOOTSTRAP_DIR/scripts/main_chroot.sh" "$@" \
|
||||
|
|
|
@ -108,12 +108,15 @@ main_umount() {
|
|||
################################################
|
||||
# Main dispatch
|
||||
|
||||
# Redirect output to logfiles
|
||||
einfo "Verbose script output will be logged to: '$GENTOO_BOOTSTRAP_DIR/log-$LOGDATE.out'"
|
||||
# Save old stdout
|
||||
exec 3>&1
|
||||
trap 'exec 1>&3' 0 1 2 3
|
||||
# Restore old filedescriptor on certain signals
|
||||
trap 'exec 1>&3' 0 1 2 3 RETURN
|
||||
# Replace stdout with logfole
|
||||
exec 1>"$GENTOO_BOOTSTRAP_DIR/log-$LOGDATE.out"
|
||||
# Link to latest log file
|
||||
ln -sf "$GENTOO_BOOTSTRAP_DIR/log-$LOGDATE.out" "$GENTOO_BOOTSTRAP_DIR/log.out"
|
||||
einfo "Verbose script output is logged to: '$GENTOO_BOOTSTRAP_DIR/log-$LOGDATE.out'"
|
||||
|
||||
SCRIPT_ALIAS="$(basename "$0")"
|
||||
if [[ "$SCRIPT_ALIAS" == "main.sh" ]]; then
|
||||
|
|
Loading…
Reference in New Issue