summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2023-01-15 10:48:17 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2023-01-15 10:48:17 +0000
commitf8d3af72aab9ab4f1278ba6ffc0688dea746ae65 (patch)
treeb832eb7a05116d4c23eeaaf82c0b160e61d96713
parent86fd655613c99012ee599e7766505fcfb9ebd032 (diff)
parentdf393309dbbfe3993363ebc62d56ecd0ba4dbe3d (diff)
downloadlibufdt-f8d3af72aab9ab4f1278ba6ffc0688dea746ae65.tar.gz
Merge "verifyDTBO: update to use bootconfig"main-16k-with-phones
-rwxr-xr-xtests/verifyDTBO.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/verifyDTBO.sh b/tests/verifyDTBO.sh
index 4c4a732..7c3dbfd 100755
--- a/tests/verifyDTBO.sh
+++ b/tests/verifyDTBO.sh
@@ -27,8 +27,12 @@ adb pull /sys/firmware/fdt final_dt > /dev/null
mkdtimg_path="${ANDROID_HOST_BIN_LOCATION}/mkdtboimg"
$mkdtimg_path dump dtbo.img -b dumped_dtbo > /dev/null
-#Get the index of the overlay applied from the kernel command line
-overlay_idx=$(adb shell cat /proc/cmdline | grep -o "androidboot.dtbo_idx=[^ ]*" | cut -d "=" -f 2)
+#Get the index of the overlay applied. Try bootconfig first, then cmdline.
+overlay_idx=$(adb shell cat /proc/bootconfig \
+ | grep 'androidboot.dtbo_idx = .*$' | cut -d "=" -f 2 | sed 's/[ \\\"]//g')
+if [[ ! $overlay_idx =~ [0-9]+ ]]; then
+ overlay_idx=$(adb shell cat /proc/cmdline | grep -o "androidboot.dtbo_idx=[^ ]*" | cut -d "=" -f 2)
+fi
arg=""
for idx in ${overlay_idx//,/ }
do