]> piware.de Git - bin.git/blobdiff - makechroot
postinst-setup: install complete texlive
[bin.git] / makechroot
index 405a461340f260ed60a8090f676970583a70e2ce..7188ad2a6cf294ffb9bc5d68b6d60580a7b722a5 100755 (executable)
@@ -3,16 +3,25 @@ DIST="$1"
 DIR="$2"
 MIRROR="$3"
 
-debootstrap "$DIST" "$DIR" $MIRROR
+[ "$DIST" ] && [ "$DIR" ] && [ "$MIRROR" ] || {
+    echo "Usage: $0 <dist> <directory> <mirror>" >&2
+    exit 1
+}
+
+mkdir -p "$DIR"
+debootstrap "$DIST" "$DIR" "$MIRROR"
 
 # 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
@@ -45,5 +54,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 devscripts fakeroot