Fix Qemu image building
The --build-image flag can be used to build images for Qemu. The
download_headers function breaks this because it needs to query the
kernel version from the device, which is not possible with
"--build-image" since there may be no adb-connected device. Just
prevent the download_headers from triggering on Qemu images for now.
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
diff --git a/androdeb b/androdeb
index ee898fb..3600a5b 100755
--- a/androdeb
+++ b/androdeb
@@ -60,7 +60,7 @@
--build) DOWNLOAD=0; shift || true; ;;
--buildtar) BTAR=1; DOWNLOAD=0; TARDIR="$2"; shift || true; shift || true; ;;
--device|-s) ADB="$ADB -s $2"; shift || true; shift || true; ;;
- --build-image) BI=1; BUILD_IMAGEF=$2; SKIP_DEVICE=1; shift || true; shift || true; ;;
+ --build-image) BI=1; BUILD_IMAGEF=$2; SKIP_DEVICE=1; DOWNLOAD=0; shift || true; shift || true; ;;
--debug) set -x; shift || true; ;;
*) c_error "Unknown option ($1)"; usage; ;;
esac
@@ -274,7 +274,7 @@
TARF=$TDIR_ABS/$FNAME_UZ
fi
-if [ ! -z "$FULL" ] && [ -z "$KERNELSRC" ] && [ -z "$KERNELHDRS" ]; then
+if [ ! -z "$FULL" ] && [ -z "$KERNELSRC" ] && [ -z "$KERNELHDRS" ] && [ -z "$BI" ]; then
c_info "Kernel headers are needed but none were provided. Downloading pre-built headers"
download_headers
fi