diff options
author | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2021-09-30 20:10:56 +0200 |
---|---|---|
committer | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2021-09-30 20:16:16 +0200 |
commit | 2b119c758b0366ec69d8597080736d06b7fea162 (patch) | |
tree | 054ea05723396266050b8bf6aeb46e9c4d45f33d | |
parent | 58acdd03ea1d877831d27bb1fc5c0ebf87b19e13 (diff) | |
download | vendor_replicant-scripts-2b119c758b0366ec69d8597080736d06b7fea162.tar.gz vendor_replicant-scripts-2b119c758b0366ec69d8597080736d06b7fea162.tar.bz2 vendor_replicant-scripts-2b119c758b0366ec69d8597080736d06b7fea162.zip |
add_adb_root: Fix tests with bootimages
Without that fix, running 'make test-recovery-i9300' twice
produces two different images.
With diffoscope we can see that the only differences between
the two images are the gzip timestamps of the initramfs and
the bootimage ID:
--- tests/recovery-i9300-with-root.img.1
+++ tests/recovery-i9300-with-root.img
├── abootimg -i {}
│ @@ -13,9 +13,9 @@
│ * load addresses:
│ kernel: 0x40008000
│ ramdisk: 0x41000000
│ tags: 0x40000100
│
│ * cmdline = console=ttySAC2,115200
│
│ -* id = 0xbdaf2901 0x9c9b846c 0x229caf97 0x9a73b1e6 0x1403c772 0x00000000 0x00000000 0x00000000
│ +* id = 0x7551c944 0x85dcc898 0xbce08232 0x6de196b1 0x39ac56b5 0x00000000 0x00000000 0x00000000
├── initrd.img
│ ├── filetype from file(1)
│ │ @@ -1 +1 @@
│ │ -gzip compressed data, was "ramdisk.cpio", last modified: Thu Sep 30 18:02:46 2021, from Unix
│ │ +gzip compressed data, was "ramdisk.cpio", last modified: Thu Sep 30 18:02:53 2021, from Unix
As in the current mkbootimg python implementation, the ID is
generated from the checksum of various components of the
image, just fixing the gzip command fixes the tests.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
-rw-r--r-- | images/add_adb_root/Makefile | 6 | ||||
-rwxr-xr-x | images/add_adb_root/add_adb_root.py | 2 | ||||
-rw-r--r-- | images/add_adb_root/tests/recovery-i9300-with-root.img.sha512 | 1 |
3 files changed, 5 insertions, 4 deletions
diff --git a/images/add_adb_root/Makefile b/images/add_adb_root/Makefile index 7724ab8..2b290a9 100644 --- a/images/add_adb_root/Makefile +++ b/images/add_adb_root/Makefile @@ -25,9 +25,9 @@ tests/recovery-i9300.img: mkdir -p tests $(CURL) $(MIRROR)/i9300/recovery-i9300.img -o $@ -# TODO: test-recovery-i9300 always fails as the resulting image is different -# at each test -check: test-recovery-i9100 +check: \ + test-recovery-i9100 \ + test-recovery-i9300 \ test-recovery-i9100: tests/recovery-i9100.img @./$(PROGNAME) tests/recovery-i9100.img tests/recovery-i9100-with-root.img diff --git a/images/add_adb_root/add_adb_root.py b/images/add_adb_root/add_adb_root.py index bc9e553..c47a90b 100755 --- a/images/add_adb_root/add_adb_root.py +++ b/images/add_adb_root/add_adb_root.py @@ -231,7 +231,7 @@ def add_adb_to_bootimage(input_file, output_file): add_adb_to_ramdisk(ramdisk) - sh.gzip(ramdisk) + sh.gzip("--no-name", ramdisk) sh.mkbootimg("--base", base_address, "--kernel", kernel, diff --git a/images/add_adb_root/tests/recovery-i9300-with-root.img.sha512 b/images/add_adb_root/tests/recovery-i9300-with-root.img.sha512 new file mode 100644 index 0000000..1a5b99a --- /dev/null +++ b/images/add_adb_root/tests/recovery-i9300-with-root.img.sha512 @@ -0,0 +1 @@ +bf98e6539f95a2388218f5379bd7cd330821110db866a5e5956864c13684a7b48757f1840dbd5cf29076b4051066790cf0c0d85cc3784d92d4ff6f0891cdff71 tests/recovery-i9300-with-root.img |