summaryrefslogtreecommitdiff
path: root/mk/bulk
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2008-04-01 16:30:19 +0000
committerjlam <jlam@pkgsrc.org>2008-04-01 16:30:19 +0000
commit5c253acc19cce479e7d3bbfcaefffe629da917d7 (patch)
tree0309b118774ba6f9876cc82a4b33ffebdaa92cb0 /mk/bulk
parent5ab2b90ce3e893b1c1109db8a0cf0fdec85e000b (diff)
downloadpkgsrc-5c253acc19cce479e7d3bbfcaefffe629da917d7.tar.gz
+ Skip mounting X11 directories if --without-x is specified.
+ Add a "chroot" option, stolen from pkg_comp(8) that starts a root shell with a better environment setup.
Diffstat (limited to 'mk/bulk')
-rwxr-xr-xmk/bulk/mksandbox17
1 files changed, 16 insertions, 1 deletions
diff --git a/mk/bulk/mksandbox b/mk/bulk/mksandbox
index 83cf981d585..63baf1d6298 100755
--- a/mk/bulk/mksandbox
+++ b/mk/bulk/mksandbox
@@ -1,6 +1,6 @@
#! /bin/sh
-# $NetBSD: mksandbox,v 1.49 2008/04/01 16:06:35 jlam Exp $
+# $NetBSD: mksandbox,v 1.50 2008/04/01 16:30:19 jlam Exp $
#
#
# Copyright (c) 2002 Alistair G. Crooks. All rights reserved.
@@ -266,6 +266,9 @@ esac
echo "Make empty dirs upon which to mount the null mounts"
for d in $sandboxMountDirs; do
test -d $d || continue;
+ case $d in
+ *X11*) test "$with_x" = "yes" || continue ;;
+ esac
$mkdirprog $sandbox$d;
$mountprog $mountflags -r $d $sandbox$d;
echo "$d $d ro \\" >> $sandbox_script
@@ -352,6 +355,18 @@ case x\$1 in
umount \$sandbox/\$mntpoint
done
;;
+ xchroot)
+ case x\$2 in
+ x) rootshell=/bin/ksh ;;
+ *) rootshell="\$2" ;;
+ esac
+ script="$sandbox/tmp/script.\$\$"
+ echo "#!/bin/sh" > \$script
+ echo "ENV=/etc/shrc \$rootshell" >> \$script
+ chmod +x \$script
+ ENV=/etc/shrc chroot \$sandbox /tmp/\`basename \$script\`
+ rm -f \$script
+ ;;
*)
if [ \$# -eq 0 ]; then
set dummy /bin/sh