Add support to build an ext4 image from a filesystem
This is suitable for passing to Qemu with -hda which makes it appear
as a disk to a Qemu instance. Once it appears, one can chroot into it.
Note:
- Device need not be connected, this option is only used to prepare
a standalone image.
- BCC isn't built but is just cloned into the image.
- Other options such as --buildtar are ignored.
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
diff --git a/buildstrap b/buildstrap
index 881dcbc..e6b7679 100755
--- a/buildstrap
+++ b/buildstrap
@@ -10,6 +10,7 @@
OUT_TMP=$4
PACKAGES=$5
INSTALL_BCC=$6
+SKIP_COMPRESS=$7
time qemu-debootstrap --arch $ARCH --include=$(make_csv "$PACKAGES") \
$DISTRO $OUT_TMP http://deb.debian.org/debian/
@@ -41,9 +42,12 @@
git clone https://github.com/iovisor/bcc.git $TDIR/debian/bcc-master
cp $spath/bcc/build-bcc.sh $TDIR/debian/bcc-master/; fi
+# Should be really do this?
+chmod -R 0777 $TDIR/
+
+if [ $SKIP_COMPRESS -eq 1 ]; then exit 0; fi
+
echo "Compressing new filesystem to prepare to push to Android /data/androdeb/"
tar -zcf $TDIR/deb.tar.gz -C $TDIR debian
-chmod -R 0777 $TDIR/
-
chmod 0777 $TDIR/deb.tar.gz