X-Git-Url: https://piware.de/gitweb/?a=blobdiff_plain;f=makechroot;h=55dfa4120f03558b2a51c008bf5e0a47ef4166b6;hb=6c8261c08d6e3f0666f91da3339a98176cb945b2;hp=405a461340f260ed60a8090f676970583a70e2ce;hpb=0249caba72436a5aaffa2c0053f6e23e071ef4a6;p=bin.git diff --git a/makechroot b/makechroot index 405a461..55dfa41 100755 --- a/makechroot +++ b/makechroot @@ -3,16 +3,26 @@ DIST="$1" DIR="$2" MIRROR="$3" -debootstrap "$DIST" "$DIR" $MIRROR +[ "$DIST" ] && [ "$DIR" ] && [ "$MIRROR" ] || { + echo "Usage: $0 " >&2 + exit 1 +} + +mkdir -p "$DIR" +debootstrap "$DIST" "$DIR" "$MIRROR" +chroot $DIR apt-get install locales # debian_chroot echo $DIST > $DIR/etc/debian_chroot +# hosts +echo "127.0.0.1 localhost.localdomain localhost" > $DIR/etc/hosts + # users perl -naF: -e 'print if $F[2] >= 1000 and $F[2] < 2000' /etc/passwd >> $DIR/etc/passwd # locale -chroot $DIR locale-gen $LANG +chroot $DIR locale-gen $LANG # bind mounts if ! grep -q $DIR /etc/fstab; then @@ -31,6 +41,10 @@ EOF fi # apt sources +if [ "$MIRROR" != "${MIRROR%file://}" ]; then + MIRROR=http://archive.ubuntu.com/ubuntu +fi + cat < $DIR/etc/apt/sources.list deb $MIRROR $DIST main restricted universe multiverse deb-src $MIRROR $DIST main restricted universe multiverse @@ -45,5 +59,5 @@ EOF chroot $DIR apt-get update # common packages for development -chroot $DIR apt-get install -y build-essential devscripts fakeroot +chroot $DIR apt-get install -y build-essential fakeroot