diff options
| author | Tobias Geerinckx-Rice <me@tobias.gr> | 2022-10-23 02:00:41 +0200 |
|---|---|---|
| committer | Tobias Geerinckx-Rice <me@tobias.gr> | 2022-10-23 02:00:15 +0200 |
| commit | 4674eb57181177f1ed51243f0197ec299dccbcdd (patch) | |
| tree | 7da08eab068cac32c8a6fd97d43cf06bb626b94f | |
| parent | 1ea1fa96fe86028968695e5da3e643356d1f570a (diff) | |
gnu: memtest86+: Build reproducibly.
* gnu/packages/hardware.scm (memtest86+)[source]: Add patch.
* gnu/packages/patches/memtest86+-build-reproducibly.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
| -rw-r--r-- | gnu/local.mk | 1 | ||||
| -rw-r--r-- | gnu/packages/hardware.scm | 4 | ||||
| -rw-r--r-- | gnu/packages/patches/memtest86+-build-reproducibly.patch | 115 |
3 files changed, 119 insertions, 1 deletions
diff --git a/gnu/local.mk b/gnu/local.mk index 1d78603210f..57f20b7314e 100644 --- a/gnu/local.mk +++ b/gnu/local.mk | |||
| @@ -1520,6 +1520,7 @@ dist_patch_DATA = \ | |||
| 1520 | %D%/packages/patches/libmemcached-build-with-gcc7.patch \ | 1520 | %D%/packages/patches/libmemcached-build-with-gcc7.patch \ |
| 1521 | %D%/packages/patches/libmhash-hmac-fix-uaf.patch \ | 1521 | %D%/packages/patches/libmhash-hmac-fix-uaf.patch \ |
| 1522 | %D%/packages/patches/libsigrokdecode-python3.9-fix.patch \ | 1522 | %D%/packages/patches/libsigrokdecode-python3.9-fix.patch \ |
| 1523 | %D%/packages/patches/memtest86+-build-reproducibly.patch \ | ||
| 1523 | %D%/packages/patches/mercurial-hg-extension-path.patch \ | 1524 | %D%/packages/patches/mercurial-hg-extension-path.patch \ |
| 1524 | %D%/packages/patches/mercurial-openssl-compat.patch \ | 1525 | %D%/packages/patches/mercurial-openssl-compat.patch \ |
| 1525 | %D%/packages/patches/mesa-opencl-all-targets.patch \ | 1526 | %D%/packages/patches/mesa-opencl-all-targets.patch \ |
diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm index e72163616b6..f392bb8c162 100644 --- a/gnu/packages/hardware.scm +++ b/gnu/packages/hardware.scm | |||
| @@ -811,7 +811,9 @@ specific SMBIOS tables.") | |||
| 811 | (commit (string-append "v" version)))) | 811 | (commit (string-append "v" version)))) |
| 812 | (file-name (git-file-name name version)) | 812 | (file-name (git-file-name name version)) |
| 813 | (sha256 | 813 | (sha256 |
| 814 | (base32 "0fv605blaf4z0jyl1wp37x5x014dkp0z0a0fh114ws62fhnhdnlv")))) | 814 | (base32 "0fv605blaf4z0jyl1wp37x5x014dkp0z0a0fh114ws62fhnhdnlv")) |
| 815 | (patches | ||
| 816 | (search-patches "memtest86+-build-reproducibly.patch")))) | ||
| 815 | (build-system gnu-build-system) | 817 | (build-system gnu-build-system) |
| 816 | (arguments | 818 | (arguments |
| 817 | (list | 819 | (list |
diff --git a/gnu/packages/patches/memtest86+-build-reproducibly.patch b/gnu/packages/patches/memtest86+-build-reproducibly.patch new file mode 100644 index 00000000000..aaaad8c6434 --- /dev/null +++ b/gnu/packages/patches/memtest86+-build-reproducibly.patch | |||
| @@ -0,0 +1,115 @@ | |||
| 1 | From ec426a6387ca49376a3af6093978bfc1388528d7 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Tobias Geerinckx-Rice <me@tobias.gr> | ||
| 3 | Date: Sun, 23 Oct 2022 00:00:00 +0200 | ||
| 4 | Subject: [PATCH] gnu: memtest86+: Build reproducibly. | ||
| 5 | |||
| 6 | Based on Debian's incomplete patch: | ||
| 7 | <https://salsa.debian.org/debian/memtest86plus/-/blob/81d81a39103b383eb269dc5094b4538615e54d39/debian/patches/reproducible-builds.patch>. | ||
| 8 | --- | ||
| 9 | build32/Makefile | 12 ++++++++---- | ||
| 10 | build64/Makefile | 12 ++++++++---- | ||
| 11 | 2 files changed, 16 insertions(+), 8 deletions(-) | ||
| 12 | |||
| 13 | diff --git a/build32/Makefile b/build32/Makefile | ||
| 14 | index 8f3d427..d4e69ff 100644 | ||
| 15 | --- a/build32/Makefile | ||
| 16 | +++ b/build32/Makefile | ||
| 17 | @@ -69,6 +69,8 @@ OBJS = boot/startup.o boot/efisetup.o $(SYS_OBJS) $(LIB_OBJS) $(TST_OBJS) $(APP_ | ||
| 18 | |||
| 19 | all: memtest.bin memtest.efi | ||
| 20 | |||
| 21 | +export TZ=UTC | ||
| 22 | + | ||
| 23 | -include boot/efisetup.d | ||
| 24 | -include $(subst .o,.d,$(SYS_OBJS)) | ||
| 25 | -include $(subst .o,.d,$(LIB_OBJS)) | ||
| 26 | @@ -153,13 +155,14 @@ esp.img: memtest.efi | ||
| 27 | @mkdir -p iso/EFI/BOOT | ||
| 28 | cp memtest.efi iso/EFI/BOOT/bootia32.efi | ||
| 29 | @rm -f esp.img | ||
| 30 | - /sbin/mkdosfs -n MEMTEST-ESP -F12 -C esp.img 4096 | ||
| 31 | + /sbin/mkdosfs -i 12345678 --invariant -n MEMTEST-ESP -F12 -C esp.img 4096 | ||
| 32 | mcopy -s -i esp.img iso/EFI :: | ||
| 33 | |||
| 34 | memtest.iso: memtest.mbr floppy.img esp.img | ||
| 35 | @mkdir -p iso/boot | ||
| 36 | cp floppy.img iso/boot/floppy.img | ||
| 37 | - xorrisofs -pad -R -J -volid MT86PLUS_32 -graft-points -hide-rr-moved --grub2-mbr memtest.mbr \ | ||
| 38 | + xorrisofs --set_all_file_dates "=$$SOURCE_DATE_EPOCH" -uid 1000 -gid 1000 \ | ||
| 39 | + -pad -R -J -volid MT86PLUS_32 -graft-points -hide-rr-moved --grub2-mbr memtest.mbr \ | ||
| 40 | -b /boot/floppy.img --efi-boot --interval:appended_partition_2:all:: \ | ||
| 41 | -part_like_isohybrid -iso_mbr_part_type 0x00 -append_partition 2 0xef ./esp.img \ | ||
| 42 | -o ./memtest.iso /boot=./iso/boot /EFI=./iso/EFI | ||
| 43 | @@ -210,7 +213,7 @@ grub-esp.img: memtest.efi grub-bootia32.efi ../grub/${GRUB_CFG}-efi.cfg | ||
| 44 | cp $(GRUB_FONT_DIR)/unicode.pf2 grub-iso/EFI/BOOT/grub/fonts/ | ||
| 45 | cp $(GRUB_LIB_DIR)/i386-efi/*.mod grub-iso/EFI/BOOT/grub/i386-efi/ | ||
| 46 | @rm -f grub-esp.img | ||
| 47 | - /sbin/mkdosfs -n MT86P_ESP -F12 -C grub-esp.img 8192 | ||
| 48 | + /sbin/mkdosfs -i 12345678 --invariant -n MT86P_ESP -F12 -C grub-esp.img 8192 | ||
| 49 | mcopy -s -i grub-esp.img grub-iso/EFI :: | ||
| 50 | |||
| 51 | grub-memtest.iso: memtest.bin grub-eltorito.img ../grub/${GRUB_CFG}-legacy.cfg grub-esp.img | ||
| 52 | @@ -220,7 +223,8 @@ grub-memtest.iso: memtest.bin grub-eltorito.img ../grub/${GRUB_CFG}-legacy.cfg g | ||
| 53 | cp ../grub/${GRUB_CFG}-legacy.cfg grub-iso/boot/grub/grub.cfg | ||
| 54 | cp $(GRUB_FONT_DIR)/unicode.pf2 grub-iso/boot/grub/fonts/ | ||
| 55 | cp $(GRUB_LIB_DIR)/i386-pc/*.mod grub-iso/boot/grub/i386-pc/ | ||
| 56 | - xorrisofs -pad -R -J -volid MT86PLUS_32 -graft-points -hide-rr-moved \ | ||
| 57 | + xorrisofs --set_all_file_dates "=$$SOURCE_DATE_EPOCH" -uid 1000 -gid 1000 \ | ||
| 58 | + -pad -R -J -volid MT86PLUS_32 -graft-points -hide-rr-moved \ | ||
| 59 | --grub2-mbr $(GRUB_LIB_DIR)/i386-pc/boot_hybrid.img \ | ||
| 60 | -b /boot/eltorito.img -no-emul-boot -boot-load-size 4 -boot-info-table --grub2-boot-info \ | ||
| 61 | --efi-boot --interval:appended_partition_2:all:: \ | ||
| 62 | diff --git a/build64/Makefile b/build64/Makefile | ||
| 63 | index 17f46a2..1cbe161 100644 | ||
| 64 | --- a/build64/Makefile | ||
| 65 | +++ b/build64/Makefile | ||
| 66 | @@ -68,6 +68,8 @@ OBJS = boot/startup.o boot/efisetup.o $(SYS_OBJS) $(LIB_OBJS) $(TST_OBJS) $(APP_ | ||
| 67 | |||
| 68 | all: memtest.bin memtest.efi | ||
| 69 | |||
| 70 | +export TZ=UTC | ||
| 71 | + | ||
| 72 | -include boot/efisetup.d | ||
| 73 | -include $(subst .o,.d,$(SYS_OBJS)) | ||
| 74 | -include $(subst .o,.d,$(LIB_OBJS)) | ||
| 75 | @@ -152,13 +154,14 @@ esp.img: memtest.efi | ||
| 76 | @mkdir -p iso/EFI/BOOT | ||
| 77 | cp memtest.efi iso/EFI/BOOT/bootx64.efi | ||
| 78 | @rm -f esp.img | ||
| 79 | - /sbin/mkdosfs -n MEMTEST-ESP -F12 -C esp.img 4096 | ||
| 80 | + /sbin/mkdosfs -i 12345678 --invariant -n MEMTEST-ESP -F12 -C esp.img 4096 | ||
| 81 | mcopy -s -i esp.img iso/EFI :: | ||
| 82 | |||
| 83 | memtest.iso: memtest.mbr floppy.img esp.img | ||
| 84 | @mkdir -p iso/boot | ||
| 85 | cp floppy.img iso/boot/floppy.img | ||
| 86 | - xorrisofs -pad -R -J -volid MT86PLUS_64 -graft-points -hide-rr-moved --grub2-mbr memtest.mbr \ | ||
| 87 | + xorrisofs --set_all_file_dates "=$$SOURCE_DATE_EPOCH" -uid 1000 -gid 1000 \ | ||
| 88 | + -pad -R -J -volid MT86PLUS_64 -graft-points -hide-rr-moved --grub2-mbr memtest.mbr \ | ||
| 89 | -b /boot/floppy.img --efi-boot --interval:appended_partition_2:all:: \ | ||
| 90 | -part_like_isohybrid -iso_mbr_part_type 0x00 -append_partition 2 0xef ./esp.img \ | ||
| 91 | -o ./memtest.iso /boot=./iso/boot /EFI=./iso/EFI | ||
| 92 | @@ -209,7 +212,7 @@ grub-esp.img: memtest.efi grub-bootx64.efi ../grub/${GRUB_CFG}-efi.cfg | ||
| 93 | cp $(GRUB_FONT_DIR)/unicode.pf2 grub-iso/EFI/BOOT/grub/fonts/ | ||
| 94 | cp $(GRUB_LIB_DIR)/x86_64-efi/*.mod grub-iso/EFI/BOOT/grub/x86_64-efi/ | ||
| 95 | @rm -f grub-esp.img | ||
| 96 | - /sbin/mkdosfs -n MT86P_ESP -F12 -C grub-esp.img 8192 | ||
| 97 | + /sbin/mkdosfs -i 12345678 --invariant -n MT86P_ESP -F12 -C grub-esp.img 8192 | ||
| 98 | mcopy -s -i grub-esp.img grub-iso/EFI :: | ||
| 99 | |||
| 100 | grub-memtest.iso: memtest.bin grub-eltorito.img ../grub/${GRUB_CFG}-legacy.cfg grub-esp.img | ||
| 101 | @@ -219,7 +222,8 @@ grub-memtest.iso: memtest.bin grub-eltorito.img ../grub/${GRUB_CFG}-legacy.cfg g | ||
| 102 | cp ../grub/${GRUB_CFG}-legacy.cfg grub-iso/boot/grub/grub.cfg | ||
| 103 | cp $(GRUB_FONT_DIR)/unicode.pf2 grub-iso/boot/grub/fonts/ | ||
| 104 | cp $(GRUB_LIB_DIR)/i386-pc/*.mod grub-iso/boot/grub/i386-pc/ | ||
| 105 | - xorrisofs -pad -R -J -volid MT86PLUS_64 -graft-points -hide-rr-moved \ | ||
| 106 | + xorrisofs --set_all_file_dates "=$$SOURCE_DATE_EPOCH" -uid 1000 -gid 1000 \ | ||
| 107 | + -pad -R -J -volid MT86PLUS_64 -graft-points -hide-rr-moved \ | ||
| 108 | --grub2-mbr $(GRUB_LIB_DIR)/i386-pc/boot_hybrid.img \ | ||
| 109 | -b /boot/eltorito.img -no-emul-boot -boot-load-size 4 -boot-info-table --grub2-boot-info \ | ||
| 110 | --efi-boot --interval:appended_partition_2:all:: \ | ||
| 111 | |||
| 112 | base-commit: d3bc8fa7c2a2400d9c4d58cee00168d39fa9d716 | ||
| 113 | -- | ||
| 114 | 2.38.0 | ||
| 115 | |||
