diff options
author | Julius Werner | 2019-08-02 15:52:28 -0700 |
---|---|---|
committer | Tom Rini | 2019-08-07 15:31:05 -0400 |
commit | bddd985734653c366c8da073650930fb2e9b5003 (patch) | |
tree | bf679ea3c896aa1fa1fac55720408726aa963318 /test/py | |
parent | 13551b911416044dede2311935f34b29095c8dba (diff) |
fit: Do not automatically decompress ramdisk images
The Linux ramdisk should always be decompressed by the kernel itself,
not by U-Boot. Therefore, the 'compression' node in the FIT image should
always be set to "none" for ramdisk images, since the only point of
using that node is if you want U-Boot to do the decompression itself.
Yet some systems populate the node to the compression algorithm used by
the kernel instead. This used to be ignored, but now that we support
decompression of all image types it becomes a problem. Since ramdisks
should never be decompressed by U-Boot anyway, this patch adds a special
exception for them to avoid these issues. Still, setting the
'compression' node like that is wrong in the first place, so we still
want to print out a warning so that third-party distributions doing this
can notice and fix it.
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
Tested-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Diffstat (limited to 'test/py')
-rwxr-xr-x | test/py/tests/test_fit.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/test/py/tests/test_fit.py b/test/py/tests/test_fit.py index 8009d2907b1..e3210ed43fa 100755 --- a/test/py/tests/test_fit.py +++ b/test/py/tests/test_fit.py @@ -269,6 +269,11 @@ def test_fit(u_boot_console): def check_equal(expected_fname, actual_fname, failure_msg): """Check that a file matches its expected contents + This is always used on out-buffers whose size is decided by the test + script anyway, which in some cases may be larger than what we're + actually looking for. So it's safe to truncate it to the size of the + expected data. + Args: expected_fname: Filename containing expected contents actual_fname: Filename containing actual contents @@ -276,6 +281,8 @@ def test_fit(u_boot_console): """ expected_data = read_file(expected_fname) actual_data = read_file(actual_fname) + if len(expected_data) < len(actual_data): + actual_data = actual_data[:len(expected_data)] assert expected_data == actual_data, failure_msg def check_not_equal(expected_fname, actual_fname, failure_msg): @@ -435,7 +442,8 @@ def test_fit(u_boot_console): output = cons.run_command_list(cmd.splitlines()) check_equal(kernel, kernel_out, 'Kernel not loaded') check_equal(control_dtb, fdt_out, 'FDT not loaded') - check_equal(ramdisk, ramdisk_out, 'Ramdisk not loaded') + check_not_equal(ramdisk, ramdisk_out, 'Ramdisk got decompressed?') + check_equal(ramdisk + '.gz', ramdisk_out, 'Ramdist not loaded') cons = u_boot_console |