Skip to content

Commit

Permalink
Add indication on interactive chroot shells
Browse files Browse the repository at this point in the history
  • Loading branch information
vmcj committed Feb 12, 2024
1 parent a61710f commit 64ab6d4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions misc-tools/dj_make_chroot.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 64ab6d4

Please sign in to comment.