diff options
author | jlam <jlam@pkgsrc.org> | 2008-04-01 16:30:19 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2008-04-01 16:30:19 +0000 |
commit | 5c253acc19cce479e7d3bbfcaefffe629da917d7 (patch) | |
tree | 0309b118774ba6f9876cc82a4b33ffebdaa92cb0 /mk/bulk | |
parent | 5ab2b90ce3e893b1c1109db8a0cf0fdec85e000b (diff) | |
download | pkgsrc-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-x | mk/bulk/mksandbox | 17 |
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 |