#source-root-groups=adm
EOF
- if dpkg --compare-versions "$(lsb_release --release --short)" '<' 7; then
- echo "script-config=$personality/config"
- else
- echo "profile=$personality"
- fi
+ echo "profile=$personality"
if [ "$THISARCH" = "$arch" ]; then
echo "aliases=$suite"
declare -a cleanup
trap do_cleanup EXIT
-while getopts "a:b:cd:fg:hk:m:p:r:su" OPTION
+while getopts "a:b:Bcd:fg:hk:m:p:r:su" OPTION
do
case $OPTION in
a)
echo "$tuple" > "$rootdir/etc/debian_chroot"
echo "force-unsafe-io" > "$rootdir/etc/dpkg/dpkg.cfg.d/force-unsafe-io"
+cleanup+=("umount $rootdir/dev")
+case "$(uname -s)" in
+ Linux)
+ ;;
+ GNU/kFreeBSD)
+ mount -t devfs none "$rootdir/dev"
+ ;;
+ *)
+ echo >&2 "Warning: Unexpected uname -s output."
+ ;;
+esac
+
+
chroot "$rootdir" apt-get update
chroot "$rootdir" apt-get install -y --force-yes --no-install-recommends policyrcd-script-zg2
cat > "$rootdir/usr/local/sbin/policy-rc.d" << 'EOF'
[ -z "$bare" ] && chroot "$rootdir" apt-get install -y --force-yes --no-install-recommends zsh less vim fakeroot devscripts gdb
rm -f "$rootdir/etc/apt/sources.list" "$rootdir/etc/apt/sources.list.d/*"
chroot "$rootdir" apt-get clean
-umount "$rootdir/sys" || true
+umount "$rootdir/dev" 2>/dev/null || true
+umount "$rootdir/sys" 2>/dev/null || true
tartmp=$(tempfile --directory "$basedir" --suffix=".tar.gz")
cleanup+=("rm -f $tartmp")