From fcc87efdf3772e6e8d060dc10d521442d7772ce9 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Fri, 28 Jan 2022 20:37:53 +0100 Subject: binman: Skip node generation for images read from files We can and should run the node generator only when creating a new image. When we read it back, there is no need to generate nodes - they already exits, and binman does not dive that deep into the image - and there is no way to provide the required fdt-list. So store the mode in the image object so that Entry_fit can simply skip generator nodes when reading them from an fdtmap. This unbreaks all read-backs of images that contain generator nodes in their fdtmap. To confirm this, add a corresponding test case. Signed-off-by: Jan Kiszka Reviewed-by: Simon Glass Tested-by: Simon Glass Add SPDX to dts file: Signed-off-by: Simon Glass --- tools/binman/ftest.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tools/binman/ftest.py') diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index ca200ae9f8f..5400f76c676 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -5100,6 +5100,24 @@ fdt fdtmap Extract the devicetree blob from the fdtmap self.assertIn('Documentation is missing for modules: mkimage', str(e.exception)) + def testListWithGenNode(self): + """Check handling of an FDT map when the section cannot be found""" + entry_args = { + 'of-list': 'test-fdt1 test-fdt2', + } + data = self._DoReadFileDtb( + '219_fit_gennode.dts', + entry_args=entry_args, + use_real_dtb=True, + extra_indirs=[os.path.join(self._indir, TEST_FDT_SUBDIR)]) + + try: + tmpdir, updated_fname = self._SetupImageInTmpdir() + with test_util.capture_sys_output() as (stdout, stderr): + self._RunBinman('ls', '-i', updated_fname) + finally: + shutil.rmtree(tmpdir) + if __name__ == "__main__": unittest.main() -- cgit v1.2.3