diff options
author | agc <agc@pkgsrc.org> | 2002-11-20 16:23:09 +0000 |
---|---|---|
committer | agc <agc@pkgsrc.org> | 2002-11-20 16:23:09 +0000 |
commit | 7f9686ba08c4f473ba26228bde60af72b943c4d6 (patch) | |
tree | e02abe789d48635bd9f00db7d211fa5c095b552b /mk/bulk | |
parent | bc68a8d1757df0ee72eb572329df811548a67ed3 (diff) | |
download | pkgsrc-7f9686ba08c4f473ba26228bde60af72b943c4d6.tar.gz |
Fixes from Robert Elz to:
+ umount filesystems in the reverse order from that which they were mounted
+ null-mount /lib and /libexec in a way more consistent with the original
Diffstat (limited to 'mk/bulk')
-rwxr-xr-x | mk/bulk/mksandbox | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/mk/bulk/mksandbox b/mk/bulk/mksandbox index 05880f9b6c5..3473fbb3f9f 100755 --- a/mk/bulk/mksandbox +++ b/mk/bulk/mksandbox @@ -1,6 +1,6 @@ #! /bin/sh -# $NetBSD: mksandbox,v 1.10 2002/11/08 10:26:51 seb Exp $ +# $NetBSD: mksandbox,v 1.11 2002/11/20 16:23:09 agc Exp $ # # # Copyright (c) 2002 Alistair G. Crooks. All rights reserved. @@ -134,6 +134,17 @@ $mkdirprog $sandbox cat > $sandbox_script <<EOS #! /bin/sh - sandbox=$sandbox + +r3() { + local _R= + while [ \$# -ge 3 ] + do + _R="\$1 \$2 \$3 \$_R" + shift; shift; shift + done + echo "\$_R" +} + fses="\\ EOS @@ -157,15 +168,11 @@ esac rm -f $sandbox/etc/localtime $cpprog /usr/share/zoneinfo/GMT $sandbox/etc/localtime -if [ -d /lib -a -d /libexec ]; then - extra_null_mounts="/lib /libexec" -else - extra_null_mounts= -fi - echo "Make empty dirs upon which to mount the null mounts" for d in /bin \ /sbin \ + /lib \ + /libexec \ /usr/X11R6 \ /usr/bin \ /usr/games \ @@ -176,7 +183,8 @@ for d in /bin \ /usr/lkm \ /usr/share \ /usr/sbin \ - /var/mail $extra_null_mounts; do \ + /var/mail; do \ + test -d $d || continue; \ $mkdirprog $sandbox$d; \ $mountprog -r -t null $d $sandbox$d; \ echo "$d $d ro \\" >> $sandbox_script @@ -226,7 +234,7 @@ case x\$1 in done ;; xumount) - set dummy \$fses + set dummy \`r3 \$fses\` shift while [ \$# -ge 3 ]; do fs=\$1; shift |