picoimx: refine provision
. Use userdata, not data
. Use VENDOR and OS variable
. Set active for each slot, make sure boot from the first slot
. Flash u-boot.imx
Change-Id: I3909242cfc19c0ad103f118139cbf2e5e0008cdc
Signed-off-by: fang hui <hui.fang@freescale.com>
Reviewed-on: http://androidsource.ap.freescale.net/project/572
Reviewed-by: fang hui <hui.fang@nxp.com>
Reviewed-by: Wang Haoran <elven.wang@nxp.com>
diff --git a/provision-device b/provision-device
index c2d9f74..619277a 100755
--- a/provision-device
+++ b/provision-device
@@ -1,8 +1,15 @@
#!/bin/sh
+OS=${ANDROID_PROVISION_OS_PARTITIONS:-${ANDROID_PRODUCT_OUT}}
+VENDOR=${ANDROID_PROVISION_VENDOR_PARTITIONS:-${ANDROID_BUILD_TOP}/vendor/bsp/freescale/picoimx/}
+
fastboot \
- flash boot_a ${ANDROID_PRODUCT_OUT}/boot.img \
- flash system_a ${ANDROID_PRODUCT_OUT}/system.img \
- flash boot_b ${ANDROID_PRODUCT_OUT}/boot.img \
- flash system_b ${ANDROID_PRODUCT_OUT}/system.img \
- flash misc ${ANDROID_PRODUCT_OUT}/misc.img "$@"
+ flash bootloader ${VENDOR}/uboot/u-boot.imx \
+ flash boot_a ${OS}/boot.img \
+ flash system_a ${OS}/system.img \
+ flash boot_b ${OS}/boot.img \
+ flash system_b ${OS}/system.img \
+ flash misc ${OS}/misc.img \
+ flash userdata ${OS}/userdata.img \
+ set_active _b \
+ set_active _a "$@"