summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/ipxe-reproducible-geniso.patch
diff options
context:
space:
mode:
authorVincent Legoll <vincent.legoll@gmail.com>2021-01-12 22:44:18 +0100
committerDanny Milosavljevic <dannym@scratchpost.org>2021-01-14 01:17:04 +0100
commitaeed7218a933054806edd246548346e9edc327c4 (patch)
tree2375fae7a2464c4ea5133bac19fb4d7a69d8d86e /gnu/packages/patches/ipxe-reproducible-geniso.patch
parent872aa117d29896757a7075128059bb2dcb5b2ab3 (diff)
gnu: Add ipxe.
* gnu/packages/bootloaders.scm (ipxe): New variable. * gnu/packages/patches/ipxe-reproducible-geniso.patch: New file … * gnu/local.mk (dist_patch_DATA): … add it. Co-authored-by: Tobias Geerinckx-Rice <me@tobias.gr> Co-authored-by: Brice Waegeneire <brice@waegenei.re> Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
Diffstat (limited to 'gnu/packages/patches/ipxe-reproducible-geniso.patch')
-rw-r--r--gnu/packages/patches/ipxe-reproducible-geniso.patch77
1 files changed, 77 insertions, 0 deletions
diff --git a/gnu/packages/patches/ipxe-reproducible-geniso.patch b/gnu/packages/patches/ipxe-reproducible-geniso.patch
new file mode 100644
index 0000000000..ff6aa1da94
--- /dev/null
+++ b/gnu/packages/patches/ipxe-reproducible-geniso.patch
@@ -0,0 +1,77 @@
+From 052d24d8217c51c572c2f6cbb4a687be2e8ba52d Mon Sep 17 00:00:00 2001
+From: Brice Waegeneire <brice@waegenei.re>
+Date: Fri, 5 Jun 2020 14:38:43 +0200
+Subject: [PATCH] [geniso] Make it reproducible
+
+Some timestamps get embedded in the generated ISO, making it
+unreproducible so we overwrite those timestamps to be at the UNIX epoch.
+---
+ src/util/geniso | 24 +++++++++++++++++++++---
+ 1 file changed, 21 insertions(+), 3 deletions(-)
+
+diff --git a/src/util/geniso b/src/util/geniso
+index ff090d4a..e032ffb0 100755
+--- a/src/util/geniso
++++ b/src/util/geniso
+@@ -11,6 +11,13 @@ function help() {
+ echo " -o FILE save iso image to file"
+ }
+
++function reset_timestamp() {
++ for f in "$1"/*; do
++ touch -t 197001010100 "$f"
++ done
++ touch -t 197001010100 "$1"
++}
++
+ LEGACY=0
+ FIRST=""
+
+@@ -37,8 +44,9 @@ if [ -z "${OUT}" ]; then
+ exit 1
+ fi
+
+-# There should either be mkisofs or the compatible genisoimage program
+-for command in genisoimage mkisofs; do
++# There should either be mkisofs, xorriso or the compatible genisoimage
++# program
++for command in xorriso genisoimage mkisofs; do
+ if ${command} --version >/dev/null 2>/dev/null; then
+ mkisofs=(${command})
+ break
+@@ -46,8 +54,10 @@ for command in genisoimage mkisofs; do
+ done
+
+ if [ -z "${mkisofs}" ]; then
+- echo "${0}: mkisofs or genisoimage not found, please install or set PATH" >&2
++ echo "${0}: mkisofs, xorriso or genisoimage not found, please install or set PATH" >&2
+ exit 1
++elif [ "$mkisofs" = "xorriso" ]; then
++ mkisofs+=(-as mkisofs)
+ fi
+
+ dir=$(mktemp -d bin/iso.dir.XXXXXX)
+@@ -115,6 +125,8 @@ case "${LEGACY}" in
+ exit 1
+ fi
+
++ reset_timestamp "$dir"
++
+ # generate the iso image
+ "${mkisofs[@]}" -b boot.img -output ${OUT} ${dir}
+ ;;
+@@ -127,6 +139,12 @@ case "${LEGACY}" in
+ cp ${LDLINUX_C32} ${dir}
+ fi
+
++ reset_timestamp "$dir"
++
++ if [ "${mkisofs[0]}" = "xorriso" ]; then
++ mkisofs+=(-isohybrid-mbr "$SYSLINUX_MBR_DISK_PATH")
++ fi
++
+ # generate the iso image
+ "${mkisofs[@]}" -b isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -output ${OUT} ${dir}
+
+--
+2.26.2