mirror of
https://xff.cz/git/u-boot/
synced 2025-09-03 09:42:22 +02:00
binman: Support adding files
In some cases it is useful to add a group of files to the image and be able to access them at run-time. Of course it is possible to generate the binman config file with a set of blobs each with a filename. But for convenience, add an entry type which can do this. Add required support (for adding nodes and string properties) into the state module. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -189,6 +189,33 @@ def AddZeroProp(node, prop):
|
||||
for n in GetUpdateNodes(node):
|
||||
n.AddZeroProp(prop)
|
||||
|
||||
def AddSubnode(node, name):
|
||||
"""Add a new subnode to a node in affected device trees
|
||||
|
||||
Args:
|
||||
node: Node to add to
|
||||
name: name of node to add
|
||||
|
||||
Returns:
|
||||
New subnode that was created in main tree
|
||||
"""
|
||||
first = None
|
||||
for n in GetUpdateNodes(node):
|
||||
subnode = n.AddSubnode(name)
|
||||
if not first:
|
||||
first = subnode
|
||||
return first
|
||||
|
||||
def AddString(node, prop, value):
|
||||
"""Add a new string property to affected device trees
|
||||
|
||||
Args:
|
||||
prop_name: Name of property
|
||||
value: String value (which will be \0-terminated in the DT)
|
||||
"""
|
||||
for n in GetUpdateNodes(node):
|
||||
n.AddString(prop, value)
|
||||
|
||||
def SetInt(node, prop, value):
|
||||
"""Update an integer property in affected device trees with an integer value
|
||||
|
||||
|
Reference in New Issue
Block a user