]> piware.de Git - bin.git/blobdiff - makechroot
postinst-setup: install git-core
[bin.git] / makechroot
index 1028c213ba6e197a3531a86c2ee867036afffb51..2add2b9b71632fe0b66b4d2fd1f4a78dea978623 100755 (executable)
@@ -3,12 +3,21 @@ DIST="$1"
 DIR="$2"
 MIRROR="$3"
 
+[ "$DIST" ] && [ "$DIR" ] && [ "$MIRROR" ] || {
+    echo "Usage: $0 <dist> <directory> <mirror>" >&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
 
@@ -32,6 +41,10 @@ EOF
 fi
 
 # apt sources
+if [ "$MIRROR" != "${MIRROR%file://}" ]; then
+    MIRROR=http://archive.ubuntu.com/ubuntu
+fi
+
 cat <<EOF > $DIR/etc/apt/sources.list
 deb     $MIRROR $DIST main restricted universe multiverse
 deb-src $MIRROR $DIST main restricted universe multiverse