hikey: Program serialno only once in flash-all.sh am: e9b656f63b am: a60251f498
am: 03449132ac
Change-Id: Iff18f6d1d536c88a6b3de841d1f82d7ad08b1ebb
diff --git a/installer/flash-all.sh b/installer/flash-all.sh
index 7476db3..0fd401f 100755
--- a/installer/flash-all.sh
+++ b/installer/flash-all.sh
@@ -61,8 +61,16 @@
echo "android out dir:${OUT_IMGDIR}"
sudo python "${INSTALLER_DIR}"/hisi-idt.py --img1="${FIRMWARE_DIR}"/l-loader.bin -d "${DEVICE_PORT}"
+sleep 3
# set a unique serial number
-fastboot oem serialno
+serialno=`fastboot getvar serialno 2>&1 > /dev/null`
+if [ "${serialno:10:6}" == "(null)" ]; then
+ fastboot oem serialno
+else
+ if [ "${serialno:10:15}" == "0123456789abcde" ]; then
+ fastboot oem serialno
+ fi
+fi
fastboot flash ptable "${INSTALLER_DIR}"/"${PTABLE}"
fastboot flash fastboot "${FIRMWARE_DIR}"/fip.bin
fastboot flash nvme "${INSTALLER_DIR}"/nvme.img