Skip to content

Commit

Permalink
vicharak-config: cli: u-boot-menu: Add support for alternative DTBO path
Browse files Browse the repository at this point in the history
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 <utsavbalar1231@gmail.com>
  • Loading branch information
UtsavBalar1231 committed Oct 27, 2023
1 parent 7c42e07 commit 0c88b7e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/usr/lib/vicharak-config/cli/u-boot-menu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 0c88b7e

Please sign in to comment.