summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2022-04-10 21:15:32 +0800
committerYongqin Liu <yongqin.liu@linaro.org>2022-04-10 21:15:32 +0800
commitf2bb432bc4b575c7bc0b95560d3699fd19991fc1 (patch)
tree9f5c3a81f0cb97fb5a8a18eee0199642b46b8597
parent29685e52150935fccd2605b81b4af3fc55da4ad0 (diff)
android-tools flash scripts: add check for the product
to avoid deploying images to the wrong platform boards Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rwxr-xr-xandroid-tools/db845c/db845c-deploy.sh6
-rwxr-xr-xandroid-tools/hikey/hikey-deploy.sh7
-rwxr-xr-xandroid-tools/hikey/hikey960-deploy.sh6
-rwxr-xr-xandroid-tools/x15/flash.sh5
4 files changed, 24 insertions, 0 deletions
diff --git a/android-tools/db845c/db845c-deploy.sh b/android-tools/db845c/db845c-deploy.sh
index 1be9f09..20631c7 100755
--- a/android-tools/db845c/db845c-deploy.sh
+++ b/android-tools/db845c/db845c-deploy.sh
@@ -1,5 +1,11 @@
#!/bin/bash
+product=$(fastboot getvar product 2>&1 |grep product|awk '{print $2}')
+if [ "X${product}" != "XSuperEDK2k" ]; then
+ echo "This is not a dragonboard845c board: ${product}"
+ exit 1
+fi
+
img_dir=${1}
if [ -z "${img_dir}" ]; then
img_dir="out/target/product/db845c"
diff --git a/android-tools/hikey/hikey-deploy.sh b/android-tools/hikey/hikey-deploy.sh
index 9c417d9..86e97f8 100755
--- a/android-tools/hikey/hikey-deploy.sh
+++ b/android-tools/hikey/hikey-deploy.sh
@@ -1,5 +1,12 @@
#!/bin/bash
+
+product=$(fastboot getvar product 2>&1 |grep product|awk '{print $2}')
+if [ "X${product}" != "Xhikey" ]; then
+ echo "This is not a hikey board: ${product}"
+ exit 1
+fi
+
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 e048eb0..8df8ffa 100755
--- a/android-tools/hikey/hikey960-deploy.sh
+++ b/android-tools/hikey/hikey960-deploy.sh
@@ -1,5 +1,11 @@
#!/bin/bash
+product=$(fastboot getvar product 2>&1 |grep product|awk '{print $2}')
+if [ "X${product}" != "Xhikey960" ]; then
+ echo "This is not a hikey960 board: ${product}"
+ exit 1
+fi
+
dir_parent=$(cd $(dirname ${0}); pwd)
img_dir=${1}
diff --git a/android-tools/x15/flash.sh b/android-tools/x15/flash.sh
index 7f56bdb..0b8a3b4 100755
--- a/android-tools/x15/flash.sh
+++ b/android-tools/x15/flash.sh
@@ -2,6 +2,11 @@
# https://wiki-archive.linaro.org/Boards/BeagleBoard-X15
# https://linaro.atlassian.net/wiki/spaces/CTT/pages/25111140766/BeagleBoard+X15
+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}"
+ exit 1
+fi
# echo 0x10 >/sys/module/drm/parameters/debug
# Bit 0 (0x01) will enable CORE messages (drm core code)
# Bit 1 (0x02) will enable DRIVER messages (drm controller code)