summaryrefslogtreecommitdiff
path: root/mk/bulk
diff options
context:
space:
mode:
authorjlam <jlam>2008-04-01 16:30:19 +0000
committerjlam <jlam>2008-04-01 16:30:19 +0000
commitc690f7ba50d1df607416681c2d6cc825b60ddec1 (patch)
tree0309b118774ba6f9876cc82a4b33ffebdaa92cb0 /mk/bulk
parent796ec1c5211f8a1b8c8b36a399a308d16a9f932a (diff)
downloadpkgsrc-c690f7ba50d1df607416681c2d6cc825b60ddec1.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