Commit 0dbbb852 authored by Chris Lamb's avatar Chris Lamb Committed by intrigeri
Browse files

Add binary_reproducible script to clamp mtimes.


Signed-off-by: default avatarChris Lamb <lamby@debian.org>

Backported to live-build 2.x by intrigeri <intrigeri@boum.org>.
parent d733b514
......@@ -74,6 +74,7 @@ lb binary_includes ${*}
lb binary_local-includes ${*}
lb binary_local-hooks ${*}
lb binary_checksums ${*}
lb binary_reproducible ${*}
if [ "${LB_BUILD_WITH_CHROOT}" != "true" ]
then
......
#!/bin/sh
## live-build(7) - System Build Scripts
## Copyright (C) 2016 Chris Lamb <lamby@debian.org>
##
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.
set -e
# Including common functions
. "${LB_BASE:-/usr/share/live/build}"/scripts/build.sh
# Setting static variables
DESCRIPTION="$(Echo 'ensure binary image is reproducible')"
HELP=""
USAGE="${PROGRAM} [--force]"
Arguments "${@}"
# Reading configuration files
Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
Set_defaults
if [ "${SOURCE_DATE_EPOCH:-}" = "" ]
then
exit 0
fi
Echo_message "Begin ensuring binary image is reproducible..."
# Requiring stage file
Require_stagefile .stage/config .stage/bootstrap
# Checking stage file
Check_stagefile .stage/binary_reproducible
# Checking lock file
Check_lockfile .lock
# Creating lock file
Create_lockfile .lock
# "Clamp" the time to SOURCE_DATE_EPOCH when the file is more recent to keep
# the original times for files that have not been created or modified during
# the build process:
find binary -newermt "@${SOURCE_DATE_EPOCH}" -print0 | \
xargs -0r touch --no-dereference --date="@${SOURCE_DATE_EPOCH}"
# Creating stage file
Create_stagefile .stage/binary_reproducible
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment