[PATCH RFC v2 1/8] tools: binman: control.py: Delete template nodes after parsing
Manorit Chawdhry
m-chawdhry at ti.com
Mon Jan 6 10:34:57 CET 2025
From: Neha Malcom Francis <n-francis at ti.com>
Dynamically going through the subnode array and deleting leads to
templates being skipped from deletion when templates are consecutive in
the subnode list. Prevent this from happening by first parsing the DT
and then deleting the nodes.
Signed-off-by: Neha Malcom Francis <n-francis at ti.com>
Reviewed-by: Simon Glass <sjg at chromium.org>
---
tools/binman/control.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tools/binman/control.py b/tools/binman/control.py
index e73c598298cef76cfdf4f0f8a021feac1e7b825a..81f61e3e152a9eab558cfc9667131a38082b61a1 100644
--- a/tools/binman/control.py
+++ b/tools/binman/control.py
@@ -522,9 +522,13 @@ def _ProcessTemplates(parent):
def _RemoveTemplates(parent):
"""Remove any templates in the binman description
"""
+ del_nodes = []
for node in parent.subnodes:
if node.name.startswith('template'):
- node.Delete()
+ del_nodes.append(node)
+
+ for node in del_nodes:
+ node.Delete()
def PrepareImagesAndDtbs(dtb_fname, select_images, update_fdt, use_expanded, indir):
"""Prepare the images to be processed and select the device tree
--
2.34.1
More information about the U-Boot
mailing list