From 0c88b7edb651db3e3dc4b616d59d84dcc58d6ddc Mon Sep 17 00:00:00 2001 From: UtsavBalar1231 Date: Fri, 27 Oct 2023 18:02:39 +0530 Subject: [PATCH] vicharak-config: cli: u-boot-menu: Add support for alternative DTBO path The mainline dtso files compiled into dtbo with a slightly different manner, where the first fragment is the metadata node. Previously metadata node was used directly instead of being a fragment which was not getting parsed by the overlay manager. Fix this by checking for the metadata property in the first fragment. Change-Id: I354495845394269f6d2bd0f60b80814d9d2948db Signed-off-by: UtsavBalar1231 --- src/usr/lib/vicharak-config/cli/u-boot-menu.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/usr/lib/vicharak-config/cli/u-boot-menu.sh b/src/usr/lib/vicharak-config/cli/u-boot-menu.sh index 0e2c769..c4f761d 100644 --- a/src/usr/lib/vicharak-config/cli/u-boot-menu.sh +++ b/src/usr/lib/vicharak-config/cli/u-boot-menu.sh @@ -164,6 +164,11 @@ parse_dtbo() { local output output="$(dtc -I dtb -O dts "$1" 2>/dev/null | dtc -I dts -O yaml 2>/dev/null | yq -r ".[0].metadata.$2[0]" | tr '\0' '\n')" + if [[ "${output}" == "null" ]]; then + # Try parsing the metadata property with an alternative path + output="$(dtc -I dtb -O dts "$1" 2>/dev/null | dtc -I dts -O yaml 2>/dev/null | yq -r '.[0].fragment@0.__overlay__.metadata' | tr '\0' '\n')" + fi + if (($# >= 3)); then if [[ "${output}" == "null" ]]; then echo "$3"