Skip to content

Commit fa0c035

Browse files
author
Bruce Ashfield
committed
lopper: allow priority on embedded lops
When embedded lops are found the priority field won't be present since the root node of the embedded lops is merged with the root node of the tree (and we don't want to have our lop information there. To allow a priority on an embedded lop, check the /lops node for a priority and promote it to the root node of the tree we create for them. Signed-off-by: Bruce Ashfield <bruce.ashfield@amd.com>
1 parent 4560397 commit fa0c035

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

lopper/__init__.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,19 @@ def setup(self, sdt_file, input_files, include_paths, force=False, libfdt=True,
404404
embedded_lops_tree = LopperTree()
405405
embedded_lops_tree + lops
406406

407+
# promote any priority designation from the /lops node
408+
# to our root node, since that is where future processing
409+
# will look (we can't do this at "/" in embedded lops as
410+
# the "/" node is added to the main root node of the entire
411+
# tree by dtc
412+
try:
413+
lops_node = embedded_lops_tree["/lops"]
414+
priority = lops_node["priority"]
415+
embedded_lops_tree["/"] + priority
416+
lops_node - priority
417+
except Exception as e:
418+
pass
419+
407420
lop = LopperFile( "" )
408421
lop.dts = ""
409422
lop.dtb = ""
@@ -2314,12 +2327,12 @@ def perform_lops(self):
23142327
lopper.log._debug( f"noexec or skip set for:{f.abs_path}" )
23152328
continue
23162329

2317-
lopper.log._info( f"------> processing lop: {f.abs_path}" )
2330+
lopper.log._info( f"------> processing lop: {f.abs_path} {f.name}" )
23182331

23192332
result = self.exec_lop( f, fdt_tree )
23202333
lop_results[f.name] = result
2321-
if self.verbose:
2322-
print( f"[INFO]: ------> logged result {result} for lop {f.name}")
2334+
2335+
lopper.log._info( f"[INFO]: ------> logged result {result} for lop {f.name}" )
23232336

23242337

23252338
class LopperFile:

0 commit comments

Comments
 (0)