Skip to content

Commit 64ab6d4

Browse files
committed
Add indication on interactive chroot shells
1 parent a61710f commit 64ab6d4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

misc-tools/dj_make_chroot.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,11 @@ if [ -n "$WORKDIR" ] && [ -d "$WORKDIR" ]; then
310310
rm -rf "$WORKDIR"
311311
fi
312312

313+
# Add indication to interactive shell that the user is in the chroot
314+
for bashrc in "root/.bashrc" "etc/bash.bashrc"; do
315+
echo 'PS1=(chroot)$PS1' >> "$CHROOTDIR/$bashrc"
316+
done
317+
313318
rm -f "$CHROOTDIR/etc/resolv.conf"
314319
cp /etc/resolv.conf /etc/hosts /etc/hostname "$CHROOTDIR/etc" || true
315320
cp /etc/ssl/certs/ca-certificates.crt "$CHROOTDIR/etc/ssl/certs/" || true

0 commit comments

Comments
 (0)