mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-07-05 10:46:15 +09:00
binman: Write the original input fdtmap to a file
When reading an image in, write its fdtmap to a file in the output directory. This is useful for debugging. Update the 'ls' command to set up the output directory; otherwise it will fail. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
4ab88b6f2f
commit
96b6c506ca
|
@ -342,7 +342,11 @@ def Binman(args):
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
if args.cmd == 'ls':
|
if args.cmd == 'ls':
|
||||||
ListEntries(args.image, args.paths)
|
try:
|
||||||
|
tools.PrepareOutputDir(None)
|
||||||
|
ListEntries(args.image, args.paths)
|
||||||
|
finally:
|
||||||
|
tools.FinaliseOutputDir()
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
if args.cmd == 'extract':
|
if args.cmd == 'extract':
|
||||||
|
|
|
@ -94,7 +94,10 @@ class Image(section.Entry_section):
|
||||||
data[pos + fdtmap.FDTMAP_HDR_LEN:pos + 256])
|
data[pos + fdtmap.FDTMAP_HDR_LEN:pos + 256])
|
||||||
dtb_size = probe_dtb.GetFdtObj().totalsize()
|
dtb_size = probe_dtb.GetFdtObj().totalsize()
|
||||||
fdtmap_data = data[pos:pos + dtb_size + fdtmap.FDTMAP_HDR_LEN]
|
fdtmap_data = data[pos:pos + dtb_size + fdtmap.FDTMAP_HDR_LEN]
|
||||||
dtb = fdt.Fdt.FromData(fdtmap_data[fdtmap.FDTMAP_HDR_LEN:])
|
fdt_data = fdtmap_data[fdtmap.FDTMAP_HDR_LEN:]
|
||||||
|
out_fname = tools.GetOutputFilename('fdtmap.in.dtb')
|
||||||
|
tools.WriteFile(out_fname, fdt_data)
|
||||||
|
dtb = fdt.Fdt.FromData(fdt_data, out_fname)
|
||||||
dtb.Scan()
|
dtb.Scan()
|
||||||
|
|
||||||
# Return an Image with the associated nodes
|
# Return an Image with the associated nodes
|
||||||
|
|
Loading…
Reference in New Issue
Block a user