summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2022-11-14 12:16:29 +0100
committerPeter Jones <pjones@redhat.com>2022-11-14 14:26:03 -0500
commit5169769e0f84dd227592cb73da97dacd61ae40b9 (patch)
tree39eafd95b343874a7ec2dabe23d295a79c5ae3fe
parent17f02339ed1be9e90738603fe3c95ae7dc300061 (diff)
downloadefi-boot-shim-5169769e0f84dd227592cb73da97dacd61ae40b9.tar.gz
efi-boot-shim-5169769e0f84dd227592cb73da97dacd61ae40b9.zip
make-archive: Build reproducible tarball
Remove timestamps, user names, etc. from the tarball so that it can be built reproducibly by multiple people, on different machines. The outer bzip2 layer might still be different, no reproducible bzip2 known. Signed-off-by: Julian Andres Klode <julian.klode@canonical.com>
-rwxr-xr-xmake-archive4
1 files changed, 3 insertions, 1 deletions
diff --git a/make-archive b/make-archive
index d4f095f0..9ae9eef0 100755
--- a/make-archive
+++ b/make-archive
@@ -86,14 +86,16 @@ main() {
cd ..
if [ "x" = "x${SHIM_GIT_TAG}" ] ; then
git archive --format=tar "$(git log -1 --pretty=format:%h)" | ( cd "${ARCHIVE_DIR}/shim-${VERSION}" ; tar x )
+ TIMESTAMP=0
else
# ORIGIN doesn't yet have this tag
git archive --format=tar "${SHIM_GIT_TAG}" | ( cd "${ARCHIVE_DIR}/shim-${VERSION}" ; tar x )
+ TIMESTAMP=$(git log -1 --pretty=%ct "${SHIM_GIT_TAG}")
fi
git log -1 --pretty=format:%H > "${ARCHIVE_DIR}/shim-${VERSION}/commit"
DIR="$PWD"
cd "${ARCHIVE_DIR}"
- tar -c --bzip2 -f "${DIR}/shim-${VERSION}.tar.bz2" "shim-${VERSION}"
+ tar -c --sort=name --mtime="@${TIMESTAMP}" --owner=0 --group=0 --numeric-owner --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime --bzip2 -f "${DIR}/shim-${VERSION}.tar.bz2" "shim-${VERSION}"
rm -rf "${ARCHIVE_DIR}"
echo "The archive is in shim-${VERSION}.tar.bz2"
exit 0