Allow packages to specify extra files to install

Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
diff --git a/androdeb b/androdeb
index 12a4e64..c2b0dc3 100755
--- a/androdeb
+++ b/androdeb
@@ -2,7 +2,7 @@
 #
 # (c) Joel Fernandes <joel@joelfernandes.org>
 
-VERSION=v0.98
+VERSION=v0.99
 
 spath="$(dirname "$(readlink -f "$0")")"
 # spath=$( cd "$(dirname "$0")" ; pwd -P )
@@ -19,6 +19,7 @@
 bash
 ca-certificates
 "
+EXTRA_FILES="none"
 
 config_full_build() {
 	for f in $(ls $spath/packages); do source $spath/packages/$f; done;
@@ -198,7 +199,8 @@
 
 SKIP_COMPRESS=0; if [ ! -z "$BUILD_IMAGE" ]; then SKIP_COMPRESS=1; fi
 
-sudo $spath/buildstrap $ARCH $DISTRO $TDIR $OUT_TMP "$(make_csv "$PACKAGES")" $INSTALL_BCC $SKIP_COMPRESS
+sudo $spath/buildstrap $ARCH $DISTRO $TDIR $OUT_TMP "$(make_csv "$PACKAGES")" "$(make_csv "$EXTRA_FILES")"\
+	$INSTALL_BCC $SKIP_COMPRESS
 
 # If we only wanted to prepare a rootfs and don't have
 # a device connected, then just echo that and skip cleanup
diff --git a/buildstrap b/buildstrap
index e6b7679..6f740e3 100755
--- a/buildstrap
+++ b/buildstrap
@@ -9,8 +9,9 @@
 TDIR=$3
 OUT_TMP=$4
 PACKAGES=$5
-INSTALL_BCC=$6
-SKIP_COMPRESS=$7
+EXTRA_FILES=$6
+INSTALL_BCC=$7
+SKIP_COMPRESS=$8
 
 time qemu-debootstrap --arch $ARCH --include=$(make_csv "$PACKAGES") \
 	$DISTRO $OUT_TMP http://deb.debian.org/debian/
@@ -24,6 +25,11 @@
 chroot $OUT_TMP ln -s /bin/bash /bin/sh || true
 cp $spath/addons/bashrc $OUT_TMP/.bashrc
 
+for f in $EXTRA_FILES; do
+	if [ $f == "none" ]; then continue; fi
+	cp $f $OUT_TMP/
+done
+
 # Cleanup
 rm -rf $OUT_TMP/lib/udev/*
 rm -rf $OUT_TMP/var/lib/apt/lists/*