Adding support to symlink an image packaged using binman.
Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
This means that each section must specify its own default alignment, if
required.
+symlink:
+ Adds a symlink to the image with string given in the symlink property.
+
Examples of the above options can be found in the tests. See the
tools/binman/test directory.
self.assertIn('Expected __bss_size symbol in vpl/u-boot-vpl',
str(e.exception))
+ def testSymlink(self):
+ """Test that image files can be named"""
+ retcode = self._DoTestFile('259_symlink.dts', debug=True, map=True)
+ self.assertEqual(0, retcode)
+ image = control.images['test_image']
+ fname = tools.get_output_filename('test_image.bin')
+ sname = tools.get_output_filename('symlink_to_test.bin')
+ self.assertTrue(os.path.islink(sname))
+ self.assertEqual(os.readlink(sname), fname)
if __name__ == "__main__":
unittest.main()
repacked later
test_section_timeout: Use a zero timeout for section multi-threading
(for testing)
+ symlink: Name of symlink to image
Args:
copy_to_orig: Copy offset/size to orig_offset/orig_size after reading
if filename:
self._filename = filename
self.allow_repack = fdt_util.GetBool(self._node, 'allow-repack')
+ self._symlink = fdt_util.GetString(self._node, 'symlink')
@classmethod
def FromFile(cls, fname):
data = self.GetPaddedData()
fd.write(data)
tout.info("Wrote %#x bytes" % len(data))
+ # Create symlink to file if symlink given
+ if self._symlink is not None:
+ sname = tools.get_output_filename(self._symlink)
+ os.symlink(fname, sname)
def WriteMap(self):
"""Write a map of the image to a .map file
--- /dev/null
+/dts-v1/;
+
+/ {
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ binman {
+ multiple-images;
+ test_image {
+ filename = "test_image.bin";
+ symlink = "symlink_to_test.bin";
+ u-boot {
+ };
+ };
+ };
+};