Fix a command to get android.boot.dtbo_index am: 8b45162bf6

Original change: https://android-review.googlesource.com/c/platform/test/vts/+/2385772

Change-Id: Id9689e802b1c485bc66b8d32c210b28cd2aa1216
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/testcases/host/firmware_dtbo_test/src/com/android/tests/firmwaredtbo/FirmwareDtboVerification.java b/testcases/host/firmware_dtbo_test/src/com/android/tests/firmwaredtbo/FirmwareDtboVerification.java
index c24dd7f..33acc78 100644
--- a/testcases/host/firmware_dtbo_test/src/com/android/tests/firmwaredtbo/FirmwareDtboVerification.java
+++ b/testcases/host/firmware_dtbo_test/src/com/android/tests/firmwaredtbo/FirmwareDtboVerification.java
@@ -208,8 +208,10 @@
         // look for dtbo_idx in bootconfig first, then fall back to cmdline
         // /proc/bootconfig does not exist on older devices, so command may fail
         String bootconfig_cmd = "cat /proc/bootconfig |"
-                + "grep -o \"'androidboot.dtbo_idx = [^ ]*'\" |"
-                + "cut -d \"\\\"\" -f 2 ";
+                + "grep \"'androidboot.dtbo_idx = .*$'\" |"
+                + "cut -d \"=\" -f 2 |"
+                + "sed \"'s/[ \\\"]//g'\"";
+        CLog.d("bootconfig_cmd = %s", bootconfig_cmd);
         CommandResult cmdResult = mDevice.executeShellV2Command(bootconfig_cmd);
         String bootconfig_overlay_idx_string = cmdResult.getStdout().replace("\n", "");
         String overlay_idx_string;