- multiple-data-files: boolean to tell binman to pass all files as
datafiles to mkimage instead of creating a temporary file the result
of datafiles concatenation
+ - filename: filename of output binary generated by mkimage
The data passed to mkimage via the -d flag is collected from subnodes of the
mkimage node, e.g.::
mkimage {
+ filename = "imximage.bin";
args = "-n test -T imximage";
u-boot-spl {
mkimage -d <data_file> -n test -T imximage <output_file>
The output from mkimage then becomes part of the image produced by
- binman. If you need to put multiple things in the data file, you can use
- a section, or just multiple subnodes like this::
+ binman but also is written into `imximage.bin` file. If you need to put
+ multiple things in the data file, you can use a section, or just multiple
+ subnodes like this::
mkimage {
args = "-n test -T imximage";
self._multiple_data_files = fdt_util.GetBool(self._node, 'multiple-data-files')
self._mkimage_entries = OrderedDict()
self._imagename = None
+ self._filename = fdt_util.GetString(self._node, 'filename')
self.align_default = None
def ReadNode(self):
[self._imagename], 'mkimage-n', 1024)
if image_data is None:
return False
- output_fname = tools.get_output_filename('mkimage-out.%s' % uniq)
+ outfile = self._filename if self._filename else 'mkimage-out.%s' % uniq
+ output_fname = tools.get_output_filename(outfile)
args = ['-d', input_fname]
if self._data_to_imagename:
self.assertIn('Could not complete processing of contents',
str(exc.exception))
+ def testMkimageFilename(self):
+ """Test using mkimage to build a binary with a filename"""
+ retcode = self._DoTestFile('254_mkimage_filename.dts')
+ self.assertEqual(0, retcode)
+ fname = tools.get_output_filename('mkimage-test.bin')
+ self.assertTrue(os.path.exists(fname))
+
if __name__ == "__main__":
unittest.main()