Skip to content

Commit ebb27bb

Browse files
committed
Explicit mention the difference between run_chroot and when judging.
We add a mention of the current list for convenience but point the user to the correct file in case the admin decides to mount more (or less).
1 parent 64ab6d4 commit ebb27bb

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

misc-tools/dj_run_chroot.in

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,19 @@ trap cleanup EXIT
2121
# Default directory where the chroot tree lives:
2222
CHROOTDIR="@judgehost_chrootdir@"
2323

24+
# Gather which dirs will be mounted during judgement.
25+
# (optional lib64 only needed for amd64 architecture)
26+
SUBDIRMOUNTS="etc usr lib bin"
27+
if [ "$(uname -m)" = "x86_64" ]; then
28+
SUBDIRMOUNTS="$SUBDIRMOUNTS lib64"
29+
fi
30+
31+
CONCAT_SUBDIRMOUNTS=""
32+
for subdir in $SUBDIRMOUNTS
33+
do
34+
CONCAT_SUBDIRMOUNTS="${SUBDIRMOUNTS:+${CONCAT_SUBDIRMOUNTS}, }${subdir}"
35+
done
36+
2437
usage()
2538
{
2639
cat <<EOF
@@ -44,6 +57,9 @@ into the chroot tree, and then e.g. run:
4457
4558
sudo dj_run_chroot "dpkg -i /path/inside/chroot/package_x.y.z_amd64.deb"
4659
60+
Beware that only [$CONCAT_SUBDIRMOUNTS] are mounted inside the chroot!
61+
For the current list see the chroot-start-stop.sh in case of issues.
62+
4763
EOF
4864
}
4965

@@ -93,9 +109,9 @@ mount --bind /dev/pts "$CHROOTDIR/dev/pts"
93109
# Prevent perl locale warnings in the chroot:
94110
export LC_ALL=C
95111

96-
[ -n "$INTERACTIVE" ] && echo "Entering chroot in '$CHROOTDIR'."
97-
98112
if [ -n "$INTERACTIVE" ]; then
113+
echo "Entering chroot in '$CHROOTDIR'."
114+
echo "Only [$CONCAT_SUBDIRMOUNTS] will be mounted during judgement. See chroot-start-stop.sh for the current list."
99115
chroot "$CHROOTDIR"
100116
else
101117
chroot "$CHROOTDIR" /bin/sh -c "$*"

0 commit comments

Comments
 (0)