diff options
author | Yongqin Liu <yongqin.liu@linaro.org> | 2022-04-19 17:44:51 +0800 |
---|---|---|
committer | Yongqin Liu <yongqin.liu@linaro.org> | 2022-04-19 17:44:51 +0800 |
commit | 23851e304743cf73989be5fe517fce1f86b23549 (patch) | |
tree | 7548151440273e0edca9c734eb54f03b860578af | |
parent | bb9819d55f88d56780e611a767ec805818e1a61e (diff) |
android-tools deploy.sh: set the default android serial for the devices
so that they could be used to support multiple devices
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rwxr-xr-x | android-tools/db845c/db845c-deploy.sh | 30 | ||||
-rwxr-xr-x | android-tools/hikey/hikey-deploy.sh | 26 | ||||
-rwxr-xr-x | android-tools/hikey/hikey960-deploy.sh | 15 | ||||
-rwxr-xr-x | android-tools/x15/flash.sh | 18 |
4 files changed, 77 insertions, 12 deletions
diff --git a/android-tools/db845c/db845c-deploy.sh b/android-tools/db845c/db845c-deploy.sh index 20631c7..bede38e 100755 --- a/android-tools/db845c/db845c-deploy.sh +++ b/android-tools/db845c/db845c-deploy.sh @@ -1,11 +1,34 @@ #!/bin/bash +local_android_serial="cbe37e" +local_android_product="SuperEDK2k" + +if adb devices|grep ${local_android_serial}; then + adb -s ${local_android_serial} reboot bootloader + sleep 5 + fastboot devices + sleep 3 +fi +num_fastboot_devices=$(fastboot devices|wc -l) +if [ ${num_fastboot_devices} -eq 0 ]; then + echo "No fastboot devices available, please check and try again" + exit 1 +elif [ ${num_fastboot_devices} -ne 1 ] && [ -z "${ANDROID_SERIAL}" ]; then + # for local multiple devices support + export ANDROID_SERIAL="${local_android_serial}" +elif [ ${num_fastboot_devices} -ne 1 ] && [ -z "${ANDROID_SERIAL}" ]; then + device_serial=$(fastboot devices|awk '{print $1}') + export ANDROID_SERIAL="${device_serial}" +fi + product=$(fastboot getvar product 2>&1 |grep product|awk '{print $2}') -if [ "X${product}" != "XSuperEDK2k" ]; then - echo "This is not a dragonboard845c board: ${product}" +if [ "X${product}" != "X${local_android_product}" ]; then + echo "This is not a ${local_android_product} board: ${product}" exit 1 fi +dir_parent=$(cd $(dirname ${0}); pwd) + img_dir=${1} if [ -z "${img_dir}" ]; then img_dir="out/target/product/db845c" @@ -25,7 +48,8 @@ function flash_image(){ if [ -z "${partition}" ] || [ -z "${file_img}" ]; then return fi - if [ ! -e "${file_img}" ]; then + + if [ ! -f "${file_img}" ]; then echo "${file_img} does not exist" return fi diff --git a/android-tools/hikey/hikey-deploy.sh b/android-tools/hikey/hikey-deploy.sh index 86e97f8..bebecbc 100755 --- a/android-tools/hikey/hikey-deploy.sh +++ b/android-tools/hikey/hikey-deploy.sh @@ -1,12 +1,34 @@ #!/bin/bash +local_android_serial="B77CA9C0032DDAE" +local_android_product="hikey" + +if adb devices|grep ${local_android_serial}; then + adb -s ${local_android_serial} reboot bootloader + sleep 5 + fastboot devices + sleep 3 +fi +num_fastboot_devices=$(fastboot devices|wc -l) +if [ ${num_fastboot_devices} -eq 0 ]; then + echo "No fastboot devices available, please check and try again" + exit 1 +elif [ ${num_fastboot_devices} -ne 1 ] && [ -z "${ANDROID_SERIAL}" ]; then + # for local multiple devices support + export ANDROID_SERIAL="${local_android_serial}" +elif [ ${num_fastboot_devices} -ne 1 ] && [ -z "${ANDROID_SERIAL}" ]; then + device_serial=$(fastboot devices|awk '{print $1}') + export ANDROID_SERIAL="${device_serial}" +fi product=$(fastboot getvar product 2>&1 |grep product|awk '{print $2}') -if [ "X${product}" != "Xhikey" ]; then - echo "This is not a hikey board: ${product}" +if [ "X${product}" != "X${local_android_product}" ]; then + echo "This is not a ${local_android_product} board: ${product}" exit 1 fi +dir_parent=$(cd $(dirname ${0}); pwd) + img_dir=${1} if [ -z "${img_dir}" ]; then img_dir="out/target/product/hikey" diff --git a/android-tools/hikey/hikey960-deploy.sh b/android-tools/hikey/hikey960-deploy.sh index b373f91..1f0d444 100755 --- a/android-tools/hikey/hikey960-deploy.sh +++ b/android-tools/hikey/hikey960-deploy.sh @@ -1,20 +1,29 @@ #!/bin/bash +local_android_serial="616A34F301931D53" +local_android_product="hikey960" + +if adb devices|grep ${local_android_serial}; then + adb -s ${local_android_serial} reboot bootloader + sleep 5 + fastboot devices + sleep 3 +fi num_fastboot_devices=$(fastboot devices|wc -l) if [ ${num_fastboot_devices} -eq 0 ]; then echo "No fastboot devices available, please check and try again" exit 1 elif [ ${num_fastboot_devices} -ne 1 ] && [ -z "${ANDROID_SERIAL}" ]; then # for local multiple devices support - export ANDROID_SERIAL="616A34F301931D53" + export ANDROID_SERIAL="${local_android_serial}" elif [ ${num_fastboot_devices} -ne 1 ] && [ -z "${ANDROID_SERIAL}" ]; then device_serial=$(fastboot devices|awk '{print $1}') export ANDROID_SERIAL="${device_serial}" fi product=$(fastboot getvar product 2>&1 |grep product|awk '{print $2}') -if [ "X${product}" != "Xhikey960" ]; then - echo "This is not a hikey960 board: ${product}" +if [ "X${product}" != "X${local_android_product}" ]; then + echo "This is not a ${local_android_product} board: ${product}" exit 1 fi diff --git a/android-tools/x15/flash.sh b/android-tools/x15/flash.sh index 6d8b1de..df44c73 100755 --- a/android-tools/x15/flash.sh +++ b/android-tools/x15/flash.sh @@ -2,22 +2,30 @@ # https://wiki-archive.linaro.org/Boards/BeagleBoard-X15 # https://linaro.atlassian.net/wiki/spaces/CTT/pages/25111140766/BeagleBoard+X15 +local_android_serial="0e005017394200e2" +local_android_product="am57xx_evm_reva3" +if adb devices|grep ${local_android_serial}; then + adb -s ${local_android_serial} reboot bootloader + sleep 5 + fastboot devices + sleep 3 +fi num_fastboot_devices=$(fastboot devices|wc -l) if [ ${num_fastboot_devices} -eq 0 ]; then echo "No fastboot devices available, please check and try again" exit 1 elif [ ${num_fastboot_devices} -ne 1 ] && [ -z "${ANDROID_SERIAL}" ]; then # for local multiple devices support - export ANDROID_SERIAL="0e005017394200e2" + export ANDROID_SERIAL="${local_android_serial}" elif [ ${num_fastboot_devices} -ne 1 ] && [ -z "${ANDROID_SERIAL}" ]; then device_serial=$(fastboot devices|awk '{print $1}') export ANDROID_SERIAL="${device_serial}" fi product=$(fastboot getvar product 2>&1 |grep product|awk '{print $2}') -if [ "X${product}" != "Xam57xx_evm_reva3" ]; then - echo "This is not a Beagleboard-X15 board: ${product}" +if [ "X${product}" != "X${local_android_product}" ]; then + echo "This is not a ${local_android_product} board: ${product}" exit 1 fi # echo 0x10 >/sys/module/drm/parameters/debug @@ -59,8 +67,10 @@ function flash_image(){ fi if [ ! -f "${file_img}" ]; then + echo "${file_img} does not exist" return fi + echo "======= Flash ${partition} partition with file $file_img ==============" #/SATA3/nougat/out/host/linux-x86/bin/fastboot flash -w ${partition} ${file_img} fastboot flash ${partition} ${file_img} @@ -69,7 +79,7 @@ function flash_image(){ exit 1 fi # sleep 2 after flash - sleep 5 + sleep 2 } #fastboot erase environment |