build-image: Make device skipping more generic
Currently, build-image skips device preparation stages and doesn't even
need a device connected, unlike other options. Make it more generic so
that in the future other options can also use such functionality. Also
results in a cleanup.
Signed-off-by: Joel Fernandes <joel@joelfernandes.org>
diff --git a/buildstrap b/buildstrap
index 50def86..5eca01f 100755
--- a/buildstrap
+++ b/buildstrap
@@ -11,7 +11,7 @@
PACKAGES=$5
EXTRA_FILES="$(cat $6)"
INSTALL_BCC=$7
-SKIP_COMPRESS=$8
+SKIP_DEVICE=$8 # Skip any device-specific stages
time qemu-debootstrap --arch $ARCH --include=$PACKAGES \
$DISTRO $OUT_TMP http://deb.debian.org/debian/
@@ -65,7 +65,7 @@
# Should be really do this?
chmod -R 0777 $TDIR/
-if [ $SKIP_COMPRESS -eq 1 ]; then exit 0; fi
+if [ $SKIP_DEVICE -eq 1 ]; then exit 0; fi
c_info "Compressing new filesystem to prepare to push to Android /data/androdeb/"
tar -zcf $TDIR/deb.tar.gz -C $TDIR debian