
Hi Manoj,
On Fri, 30 Jun 2023 at 13:12, Manoj Sai abbaraju.manojsai@amarulasolutions.com wrote:
Add an entry type for u-boot-nodtb.bin.gz, which is a GZIP compressed raw u-boot binary and a simple test.
A better way to do this is to have binman do the compression.
Signed-off-by: Manoj Sai abbaraju.manojsai@amarulasolutions.com Signed-off-by: Suniel Mahesh sunil@amarulasolutions.com
tools/binman/etype/u_boot_nodtb_gzip.py | 28 +++++++++++++++++++++ tools/binman/ftest.py | 5 ++++ tools/binman/test/282_u_boot_nodtb_gzip.dts | 11 ++++++++ 3 files changed, 44 insertions(+) create mode 100644 tools/binman/etype/u_boot_nodtb_gzip.py create mode 100644 tools/binman/test/282_u_boot_nodtb_gzip.dts
Binman supports a 'compressed' property for blobs, so you should be able to add:
compress = 'gzip';
to your node
diff --git a/tools/binman/etype/u_boot_nodtb_gzip.py b/tools/binman/etype/u_boot_nodtb_gzip.py new file mode 100644 index 0000000000..e8afd3de57 --- /dev/null +++ b/tools/binman/etype/u_boot_nodtb_gzip.py @@ -0,0 +1,28 @@ +# SPDX-License-Identifier: GPL-2.0+ +# Copyright (c) 2023 Amarula Solutions India +# Written by Suniel Mahesh sunil@amarulasolutions.com +# Reference from Simon Glass sjg@chromium.org +# +# Entry-type module for 'u-boot-nodtb.bin.gz' +#
+from binman.entry import Entry +from binman.etype.blob import Entry_blob
+class Entry_u_boot_nodtb_gzip(Entry_blob):
- """U-Boot compressed flat binary without device tree appended
- Properties / Entry arguments:
- filename: Filename to include ('u-boot-nodtb.bin.gz')
- This is the U-Boot compressed raw binary, before allowing it to relocate
- itself at runtime it should be decompressed. It does not include a device
- tree blob at the end of it so normally cannot work without it. You can add a
- u-boot-dtb entry after this one, or use a u-boot entry instead, normally
- expands to a section containing u-boot and u-boot-dtb
- """
- def __init__(self, section, etype, node):
super().__init__(section, etype, node)
- def GetDefaultFilename(self):
return 'u-boot-nodtb.bin.gz'
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index 43b4f850a6..933ebcbd35 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -42,6 +42,7 @@ from u_boot_pylib import tout # Contents of test files, corresponding to different entry types U_BOOT_DATA = b'1234' U_BOOT_IMG_DATA = b'img' +U_BOOT_NODTB_GZ_DATA = b'uboot nodtb gz' U_BOOT_SPL_DATA = b'56780123456789abcdefghijklm' U_BOOT_TPL_DATA = b'tpl9876543210fedcbazywvuts' U_BOOT_VPL_DATA = b'vpl76543210fedcbazywxyz_' @@ -6676,6 +6677,10 @@ fdt fdtmap Extract the devicetree blob from the fdtmap ['fit']) self.assertIn("Node '/fit': Missing tool: 'mkimage'", str(e.exception))
- def testUBootnodtbBinGz(self):
"""Test that u-boot-nodtb.bin.gz can be put in a file"""
data = self._DoReadFile('279_u_boot_nodtb_gzip.dts')
self.assertEqual(U_BOOT_NODTB_GZ_DATA, data)
if __name__ == "__main__": unittest.main() diff --git a/tools/binman/test/282_u_boot_nodtb_gzip.dts b/tools/binman/test/282_u_boot_nodtb_gzip.dts new file mode 100644 index 0000000000..79eecea202 --- /dev/null +++ b/tools/binman/test/282_u_boot_nodtb_gzip.dts @@ -0,0 +1,11 @@ +/dts-v1/;
+/ {
#address-cells = <1>;
#size-cells = <1>;
binman {
u-boot-nodtb-bin-gz {
};
};
+};
2.25.1
If you still really want to add an entry type for a compressed U-Boot, please let me know.
Regards, Simon