summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2023-01-15 12:24:17 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-01-15 12:24:17 +0000
commitf986c148e415a2f6f5b76e01f297d26fdae88594 (patch)
tree4d146b70e81e196e072bcb73f882b8a942f30c75
parentf8033dc5e066ef518d71a4b5f06764be22b85d03 (diff)
parent60e32fb1cf8dd3629211b7d8806a954a800e6fa9 (diff)
downloadlibufdt-f986c148e415a2f6f5b76e01f297d26fdae88594.tar.gz
Merge "verifyDTBO: update to use bootconfig" am: f8d3af72aa am: 12dc18e4c4 am: 60e32fb1cf
Original change: https://android-review.googlesource.com/c/platform/system/libufdt/+/2388574 Change-Id: I4cd449ec6e65f082c33b68bbd3608205c5a4106d Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-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