image.
"""
-import libfdt
-
-from entry import Entry
-from fdt import Fdt
-import state
-import tools
-import tout
+from binman.entry import Entry
+from patman import tools
+from patman import tout
FDTMAP_MAGIC = b'_FDTMAP_'
FDTMAP_HDR_LEN = 16
added as necessary. See the binman README.
"""
def __init__(self, section, etype, node):
+ # Put these here to allow entry-docs and help to work without libfdt
+ global libfdt
+ global state
+ global Fdt
+
+ import libfdt
+ from binman import state
+ from dtoc.fdt import Fdt
+
Entry.__init__(self, section, etype, node)
def _GetFdtmap(self):
with fsw.add_node(subnode.name):
_AddNode(subnode)
- outfdt = self.GetImage().fdtmap_dtb
+ data = state.GetFdtContents('fdtmap')[1]
# If we have an fdtmap it means that we are using this as the
- # read-only fdtmap for this image.
- if not outfdt:
+ # fdtmap for this image.
+ if data is None:
# Get the FDT data into an Fdt object
data = state.GetFdtContents()[1]
infdt = Fdt.FromData(data)
# Pack this new FDT and return its contents
fdt.pack()
outfdt = Fdt.FromData(fdt.as_bytearray())
- data = FDTMAP_MAGIC + tools.GetBytes(0, 8) + outfdt.GetContents()
+ data = outfdt.GetContents()
+ data = FDTMAP_MAGIC + tools.GetBytes(0, 8) + data
return data
def ObtainContents(self):