From 052d24d8217c51c572c2f6cbb4a687be2e8ba52d Mon Sep 17 00:00:00 2001 From: Brice Waegeneire 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 35ef141d49a714f192f47'>root/tests/transformations.scm
AgeCommit message (Expand)Author
2021-03-05profiles: 'package->manifest-entry' preserves transformations by default....Previously, transformations applied from a manifest (rather than via "guix install") would be lost. This change fixes that and simplifies things. Reported by zimoun at <https://lists.gnu.org/archive/html/guix-devel/2021-02/msg00153.html>. * guix/profiles.scm (default-properties): New procedure. (package->manifest-entry): Use it for #:properties. * guix/scripts/pack.scm (guix-pack)[with-transformations]: Remove. Remove caller. * guix/scripts/package.scm (transaction-upgrade-entry): Remove calls to 'manifest-entry-with-transformations'. * tests/guix-package.sh: Add test. * tests/transformations.scm ("options->transformation + package->manifest-entry"): New test. Ludovic Courtès
2021-01-19transformations: Add '--with-latest'....* guix/upstream.scm (upstream-source-compiler): New procedure. (%updaters): Set! it. * guix/transformations.scm (transform-package-latest): New procedure. (%transformations): Add 'with-latest'. (%transformation-options, show-transformation-options-help/detailed): Add '--with-latest'. * tests/transformations.scm ("options->transformation, with-latest"): New test. * doc/guix.texi (Package Transformation Options): Document it. Ludovic Courtès
2020-12-27transformations: Add '--with-patch'....Suggested by Philippe Swartvagher <philippe.swartvagher@inria.fr>. * guix/transformations.scm (transform-package-patches): New procedure. (%transformations): Add it as 'with-patch'. (%transformation-options, show-transformation-options-help/detailed): Add '--with-patch'. * tests/transformations.scm ("options->transformation, with-patch"): New test. * doc/guix.texi (Package Transformation Options): Document it. Ludovic Courtès
2020-12-21tests: Check the effect of '--without-tests' on implicit inputs....* tests/transformations.scm ("options->transformation, without-tests"): Ensure TAR has #:tests? #f. Ludovic Courtès
2020-10-31guix build: Move transformation options to (guix transformations)....* guix/transformations.scm: New file. * tests/scripts-build.scm: Rename to... * tests/transformations.scm: ... this. * Makefile.am (MODULES): Add 'guix/transformations.scm'. (SCM_TESTS): Adjust to rename. * guix/scripts/build.scm (numeric-extension?) (tarball-base-name, <downloaded-file>, download-to-store*) (compile-downloaded-file, package-with-source) (transform-package-source, evaluate-replacement-specs) (transform-package-inputs, transform-package-inputs/graft) (%not-equal, package-git-url, evaluate-git-replacement-specs) (transform-package-source-branch, transform-package-source-commit) (transform-package-source-git-url, package-dependents/spec) (package-toolchain-rewriting, transform-package-toolchain) (transform-package-with-debug-info, transform-package-tests) (%transformations, transformation-procedure, %transformation-options) (show-transformation-options-help, options->transformation) (package-transformations): Move to (guix transformations). * guix/scripts/environment.scm: Adjust accordingly. * guix/scripts/graph.scm: Likewise. * guix/scripts/install.scm: Likewise. * guix/scripts/pack.scm: Likewise. * guix/scripts/package.scm: Likewise. * guix/scripts/upgrade.scm: Likewise. * po/guix/POTFILES.in: Add 'guix/transformations.scm'. Ludovic Courtès