Added chroot indicator
This commit is contained in:
parent
b3cf81f95d
commit
161afbc285
|
@ -271,7 +271,13 @@ gentoo_umount() {
|
|||
}
|
||||
|
||||
gentoo_chroot() {
|
||||
[[ $# -gt 0 ]] || die "Missing command argument"
|
||||
if [[ $# -eq 0 ]]; then
|
||||
cat > "$TMP_DIR/.bashrc" <<EOF
|
||||
# Set the PS1 to a recognizable value
|
||||
export PS1="(chroot) \$PS1"
|
||||
EOF
|
||||
gentoo_chroot /bin/bash --init-file "$TMP_DIR/.bashrc"
|
||||
fi
|
||||
|
||||
[[ $EXECUTED_IN_CHROOT != true ]] \
|
||||
|| die "Already in chroot"
|
||||
|
@ -301,6 +307,6 @@ gentoo_chroot() {
|
|||
disable_logging
|
||||
EXECUTED_IN_CHROOT=true \
|
||||
TMP_DIR=$TMP_DIR \
|
||||
exec chroot "$ROOT_MOUNTPOINT" "$GENTOO_BOOTSTRAP_DIR/scripts/main_chroot.sh" "$@" \
|
||||
exec chroot -- "$ROOT_MOUNTPOINT" "$GENTOO_BOOTSTRAP_DIR/scripts/main_chroot.sh" "$@" \
|
||||
|| die "Failed to chroot into '$ROOT_MOUNTPOINT'"
|
||||
}
|
||||
|
|
|
@ -14,8 +14,5 @@ export NPROC_ONE="$(($NPROC + 1))"
|
|||
export MAKEFLAGS="-j$NPROC"
|
||||
export EMERGE_DEFAULT_OPTS="--jobs=$NPROC_ONE --load-average=$NPROC"
|
||||
|
||||
# Set the PS1 to a recognizable value
|
||||
export PS1="(chroot) $PS1"
|
||||
|
||||
# Execute the requested command
|
||||
exec "$@"
|
||||
|
|
Loading…
Reference in New Issue