summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSatish Patel <satish.patel@linaro.org>2016-03-28 10:03:21 +0530
committerDmitry Shmidt <dimitrysh@google.com>2016-04-04 12:20:55 -0700
commitdfceed5a894745d395a7ee07ba1beea8bfe267db (patch)
tree621d4fab1a7b076eeb41d31def325d0f479d7dce
parent3ec96c47fbdc9d8867ddada718dd099bd5e3dba1 (diff)
downloadhikey-dfceed5a894745d395a7ee07ba1beea8bfe267db.tar.gz
Add option to flash images from differen out directory
To make build faster sometime, developer uses "OUT_DIR_COMMON_BASE" variable to change build out directory (i.e. putting out directory on separate ssd/X volume) For such case, option is added to specify out directory path as a argument to script e.g. if out directory is at - /mnt/ssd_1/build_out/out/target/product/hikey then run script with additional out parameter: sudo ./flash_all.sh /dev/ttyUSBX --out \ /mnt/ssd_1/build_out/out/target/product/hikey Testing Done: Flash & boot with both the options Change-Id: I9f9b8d57c8f35f03f429e942b05e2b0b8a4ffb60 Signed-off-by: Satish Patel <satish.patel@linaro.org>
-rwxr-xr-xinstaller/flash-all.sh35
1 files changed, 29 insertions, 6 deletions
diff --git a/installer/flash-all.sh b/installer/flash-all.sh
index ae54514b..076b5809 100755
--- a/installer/flash-all.sh
+++ b/installer/flash-all.sh
@@ -10,7 +10,7 @@ if [ ! -e $1 ]
echo "device: $1 does not exist"
exit
fi
-
+DEVICE_PORT=${1}
PTABLE=ptable-aosp-8g.img
if [ $# -gt 1 ]
then
@@ -22,11 +22,34 @@ fi
INSTALLER_DIR="`dirname $0`"
ANDROID_TOP=${INSTALLER_DIR}/../../../../
-python ${INSTALLER_DIR}/hisi-idt.py --img1=${INSTALLER_DIR}/l-loader.bin -d ${1}
+
+#get out directory path
+while [ $# -ne 0 ]; do
+ case "$1" in
+ --out) OUT_IMGDIR=$2;shift;
+ esac
+ shift
+done
+
+if [ -z $OUT_IMGDIR ]; then
+ if [ ! -z $ANDROID_PRODUCT_OUT ]; then
+ OUT_IMGDIR=${ANDROID_PRODUCT_OUT}
+ else
+ OUT_IMGDIR="${ANDROID_TOP}/out/target/product/hikey"
+ fi
+fi
+
+if [ ! -d $OUT_IMGDIR ]; then
+ echo "error in locating out directory, check if it exist"
+ exit
+fi
+echo "android out dir:$OUT_IMGDIR"
+
+python ${INSTALLER_DIR}/hisi-idt.py --img1=${INSTALLER_DIR}/l-loader.bin -d ${DEVICE_PORT}
fastboot flash ptable ${INSTALLER_DIR}/${PTABLE}
fastboot flash fastboot ${INSTALLER_DIR}/fip.bin
fastboot flash nvme ${INSTALLER_DIR}/nvme.img
-fastboot flash boot ${ANDROID_TOP}/out/target/product/hikey/boot_fat.uefi.img
-fastboot flash system ${ANDROID_TOP}/out/target/product/hikey/system.img
-fastboot flash cache ${ANDROID_TOP}/out/target/product/hikey/cache.img
-fastboot flash userdata ${ANDROID_TOP}/out/target/product/hikey/userdata.img
+fastboot flash boot ${OUT_IMGDIR}/boot_fat.uefi.img
+fastboot flash system ${OUT_IMGDIR}/system.img
+fastboot flash cache ${OUT_IMGDIR}/cache.img
+fastboot flash userdata ${OUT_IMGDIR}/userdata.img