# Settings !!!*** PLEASE MODIFY THESE ***!!! export TMPDIR=`pwd`"/tmp" export IMAGE="./Ubuntu-PrecisePangolin-AMD64-root_fs" export MIRROR="http://www.mirrorservice.org/sites/archive.ubuntu.com/ubuntu/" export RELEASE=precise export ARCH=amd64 # Making the filesystem dd if=/dev/zero of=$IMAGE bs=1024 count=1 seek=1048576 mkfs.ext4 -L ROOT $IMAGE mkdir $TMPDIR mount -o loop $IMAGE $TMPDIR # debootstrap debootstrap --arch $ARCH $RELEASE $TMPDIR $MIRROR # setup resolver cp /etc/resolv.conf $TMPDIR/etc/ # fstab cp fstab $TMPDIR/etc #use tty0 add it to securetty echo "# Consoles:" >> $TMPDIR/etc/securetty echo "tty0" >> $TMPDIR/etc/securetty echo "ttyS0" >> $TMPDIR/etc/securetty echo "vc/0" >> $TMPDIR/etc/securetty echo "deb http://www.mirrorservice.org/sites/archive.ubuntu.com/ubuntu ${RELEASE}-security main" >> $TMPDIR/etc/apt/sources.list echo "deb http://www.mirrorservice.org/sites/archive.ubuntu.com/ubuntu ${RELEASE}-updates main" >> $TMPDIR/etc/apt/sources.list sed 's/tty1/tty0/g' < $TMPDIR/etc/init/tty1.conf > $TMPDIR/etc/init/tty0.conf sed 's/tty1/ttyS0/g' < $TMPDIR/etc/init/tty1.conf > $TMPDIR/etc/init/ttyS0.conf echo "auto lo" > $TMPDIR/etc/network/interfaces echo "iface lo inet loopback" >> $TMPDIR/etc/network/interfaces echo "" >> $TMPDIR/etc/network/interfaces echo "auto eth0" >> $TMPDIR/etc/network/interfaces echo "iface eth0 inet dhcp" >> $TMPDIR/etc/network/interfaces umount $TMPDIR rmdir $TMPDIR