From 64ab6d46cb58e52a77ed4681b50bc15ddad2bec6 Mon Sep 17 00:00:00 2001 From: Michael Vasseur <14887731+vmcj@users.noreply.github.com> Date: Sun, 29 Oct 2023 16:53:49 +0100 Subject: [PATCH] Add indication on interactive chroot shells --- misc-tools/dj_make_chroot.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/misc-tools/dj_make_chroot.in b/misc-tools/dj_make_chroot.in index 6b35a65afe..aa9f80e772 100755 --- a/misc-tools/dj_make_chroot.in +++ b/misc-tools/dj_make_chroot.in @@ -310,6 +310,11 @@ if [ -n "$WORKDIR" ] && [ -d "$WORKDIR" ]; then rm -rf "$WORKDIR" fi +# Add indication to interactive shell that the user is in the chroot +for bashrc in "root/.bashrc" "etc/bash.bashrc"; do + echo 'PS1=(chroot)$PS1' >> "$CHROOTDIR/$bashrc" +done + rm -f "$CHROOTDIR/etc/resolv.conf" cp /etc/resolv.conf /etc/hosts /etc/hostname "$CHROOTDIR/etc" || true cp /etc/ssl/certs/ca-certificates.crt "$CHROOTDIR/etc/ssl/certs/" || true