X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=modules%2Fporterbox%2Ffiles%2Fsetup-dchroot;h=5565ba153ad687104dd611fcb9a90ea7005a296b;hb=874499f113b111c6747c075a4abfcd82e9a509fb;hp=862e99f1397f4d9c6aa59c18e3674b6b5f063470;hpb=772474a7bd3531daaaa44d7f8eb450922303fc99;p=dsa-puppet.git diff --git a/modules/porterbox/files/setup-dchroot b/modules/porterbox/files/setup-dchroot index 862e99f1..5565ba15 100755 --- a/modules/porterbox/files/setup-dchroot +++ b/modules/porterbox/files/setup-dchroot @@ -40,6 +40,7 @@ OPTIONS: -m MIRROR http mirror to use [$mirror] -b basedir place where to build the chroot/tarball [$basedir] -f overwrite stuff. + -c write config only. -h this help. EOF } @@ -69,7 +70,7 @@ genschrootconf() { cat << EOF [${suite}_${arch}-dchroot] -description=Debian $suite chroot for $arch +description=[${suite}_${arch}-dchroot] Debian $suite chroot for $arch type=file file=$target groups=Debian,guest @@ -81,20 +82,19 @@ EOF if [ "$THISARCH" = "$arch" ]; then echo "aliases=$suite" - else - case "$arch" in - i386) - echo "personality=linux32" - ;; - esac fi + case "$arch" in + armel|armhf|i386|powerpc|s390|sparc) + echo "personality=linux32" + ;; + esac echo case "$suite" in sid) genschrootconf "experimental" "$arch" "$target" ;; - experimental) + experimental|jessie) : ;; *) @@ -113,12 +113,13 @@ if [ -e /etc/schroot/dsa/default-mirror ]; then mirror=$(cat /etc/schroot/dsa/default-mirror ) fi mirror="${mirror:-http://cdn.debian.net/debian}" +configonly="" force="" basedir="/srv/chroot" declare -a cleanup trap do_cleanup EXIT -while getopts "a:b:fhm:" OPTION +while getopts "a:b:cfhm:" OPTION do case $OPTION in a) @@ -127,6 +128,9 @@ do b) basedir="$OPTARG" ;; + c) + configonly="1" + ;; f) force="1" ;; @@ -166,6 +170,8 @@ schrootconfig="/etc/schroot/chroot.d/${tuple}-dchroot" # genschrootconf "$suite" "$arch" "$target" | tee "$schrootconfig" +if [ -n "$configonly" ]; then exit 0; fi + rootdir=$(mktemp -d "$basedir/create-$suite-XXXXXX") cleanup+=("rm -r $rootdir") cleanup+=("umount $rootdir/sys") @@ -199,7 +205,7 @@ while true; do done EOF chmod +x "$rootdir/usr/local/sbin/policy-rc.d" -chroot "$rootdir" apt-get install -y --no-install-recommends zsh locales-all build-essential vim fakeroot devscripts gdb +chroot "$rootdir" apt-get install -y --no-install-recommends zsh locales-all build-essential less vim fakeroot devscripts gdb rm -f "$rootdir/etc/apt/sources.list" "$rootdir/etc/apt/sources.list.d/*" umount "$rootdir/sys" || true