]> git.donarmstrong.com Git - dsa-puppet.git/blobdiff - modules/schroot/files/setup-dchroot
stretch does not debootstrap right now
[dsa-puppet.git] / modules / schroot / files / setup-dchroot
index 3f6179d9b9ccb54ecd0f420259ca1d4b70689b5b..ab76466a67cf1ce18a27d91d3b27d8c8e4d89511 100755 (executable)
@@ -116,7 +116,6 @@ EOF
         sid)
             genschrootconf "experimental" "$arch" "$target"
             ;;
-        #experimental|jessie)
         experimental)
             :
             ;;
@@ -129,6 +128,7 @@ EOF
                 [ -n "$buildd" ] && genschrootconf "$suite" "$arch" "$target" "security"
             fi
     esac
+    return 0
 }
 
 do_config() {
@@ -149,7 +149,7 @@ arch="$THISARCH"
 if [ -e /etc/schroot/dsa/default-mirror ]; then
     mirror=$(cat /etc/schroot/dsa/default-mirror )
 fi
-mirror="${mirror:-http://cdn.debian.net/debian}"
+mirror="${mirror:-http://ftp.debian.org/debian}"
 configonly=""
 force=""
 basedir="/srv/chroot"
@@ -158,7 +158,7 @@ keyring=/usr/share/keyrings/debian-archive-keyring.gpg
 personality="dsa"
 sbuildnames=""
 ubuntu=""
-groupuser="Debian,guest"
+groupuser="Debian,guest,d-i"
 grouproot=""
 users=""
 usersroot=""
@@ -254,7 +254,17 @@ fi
 suite="$1"; shift
 tuple="${suite}_${arch}"
 
-builddir=${builddir:-$basedir}
+if [ -z "${builddir:-}" ]; then
+  builddir=${builddir:-$basedir}
+  for u in schroot-unpack unpack; do
+    # if one of these directories exists and is on a different filesystem, prefer it.
+    candidate="$builddir/$u"
+    if [ -e "$candidate" ] &&
+       [ "$(stat -f --printf '%i\n' "$builddir" )" != "$(stat -f --printf '%i\n' "$candidate")" ]; then
+      builddir="$candidate"
+    fi
+  done
+fi
 [ -d "$basedir" ] || die "Error: $basedir does not exist (or is not a directory)."
 [ -d "$builddir" ] || die "Error: $builddir does not exist (or is not a directory)."
 
@@ -311,7 +321,7 @@ esac
 
 
 chroot "$rootdir" apt-get update
-chroot "$rootdir" apt-get install -y --force-yes --no-install-recommends policyrcd-script-zg2
+chroot "$rootdir" apt-get install -y --no-install-recommends policyrcd-script-zg2
 cat > "$rootdir/usr/local/sbin/policy-rc.d" << 'EOF'
 #!/bin/sh
 
@@ -330,9 +340,9 @@ while true; do
 done
 EOF
 chmod +x "$rootdir/usr/local/sbin/policy-rc.d"
-[ -z "$bare" ] && [ -z "$ubuntu" ] && chroot "$rootdir" apt-get install -y --force-yes --no-install-recommends locales-all
-chroot "$rootdir" apt-get install -y --force-yes --no-install-recommends build-essential
-[ -z "$bare" ] && chroot "$rootdir" apt-get install -y --force-yes --no-install-recommends zsh less vim fakeroot devscripts gdb
+[ -z "$bare" ] && [ -z "$ubuntu" ] && chroot "$rootdir" apt-get install -y --no-install-recommends locales-all
+chroot "$rootdir" apt-get install -y --no-install-recommends build-essential
+[ -z "$bare" ] && chroot "$rootdir" apt-get install -y --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/dev" 2>/dev/null || true