aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-10-29 18:51:22 -0400
committerTom Rini <trini@konsulko.com>2022-10-29 18:51:22 -0400
commit6f02819cceb19c334f1dbd6eccefb4ccfae319f9 (patch)
treeada26fe279934fbb18d69324010b3ce1f55ffb63 /tools
parentfb63362c63c7aeacb1dfde330ee8f692da7972f9 (diff)
parentf21954750aa8ed445ab83998bb099e366136c428 (diff)
downloadu-boot-6f02819cceb19c334f1dbd6eccefb4ccfae319f9.zip
u-boot-6f02819cceb19c334f1dbd6eccefb4ccfae319f9.tar.gz
u-boot-6f02819cceb19c334f1dbd6eccefb4ccfae319f9.tar.bz2
Merge tag 'dm-pull-29oct22' of https://source.denx.de/u-boot/custodians/u-boot-dmWIP/29Oct2022
Fix pylibfdt warnings and use setuptools to build Various minor changes to core dm and sandbox
Diffstat (limited to 'tools')
-rw-r--r--tools/binman/binman.rst3
-rw-r--r--tools/binman/ftest.py9
-rw-r--r--tools/binman/image.py6
-rw-r--r--tools/binman/test/259_symlink.dts16
4 files changed, 34 insertions, 0 deletions
diff --git a/tools/binman/binman.rst b/tools/binman/binman.rst
index 4ee6f41..d8a3d77 100644
--- a/tools/binman/binman.rst
+++ b/tools/binman/binman.rst
@@ -780,6 +780,9 @@ align-default:
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.
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index 261107b..232ac2c 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -5995,6 +5995,15 @@ fdt fdtmap Extract the devicetree blob from the fdtmap
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()
diff --git a/tools/binman/image.py b/tools/binman/image.py
index afc4b4d..6d4bff5 100644
--- a/tools/binman/image.py
+++ b/tools/binman/image.py
@@ -38,6 +38,7 @@ class Image(section.Entry_section):
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
@@ -97,6 +98,7 @@ class Image(section.Entry_section):
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):
@@ -180,6 +182,10 @@ class Image(section.Entry_section):
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
diff --git a/tools/binman/test/259_symlink.dts b/tools/binman/test/259_symlink.dts
new file mode 100644
index 0000000..2ee1f7f
--- /dev/null
+++ b/tools/binman/test/259_symlink.dts
@@ -0,0 +1,16 @@
+/dts-v1/;
+
+/ {
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ binman {
+ multiple-images;
+ test_image {
+ filename = "test_image.bin";
+ symlink = "symlink_to_test.bin";
+ u-boot {
+ };
+ };
+ };
+};