mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-01 07:47:15 +00:00
Override build user+host+timestamp
to make kata-linux-container package builds reproducible. See https://reproducible-builds.org/ for why this is good. Uses -u to be independent of timezone. Uses LANG=C to not have Day-of-Week and Month names vary. Signed-off-by: Bernhard M. Wiedemann <bwiedemann@suse.de>
This commit is contained in:
parent
9a8553fa4a
commit
693d240971
@ -18,6 +18,11 @@ override_dh_auto_build:
|
||||
rm -f .config
|
||||
find $(KERNEL_CONFIGS) -name "$(KERNEL_ARCH)_kata_kvm_*" -exec cp {} .config \;
|
||||
[ -f .config ] || (@echo "ERROR: cannot find the kernel config file for the $(KERNEL_ARCH) architecture"; exit 1)
|
||||
# https://github.com/kata-containers/packaging/issues/394 enable reproducible builds:
|
||||
export KBUILD_BUILD_USER=katabuilduser
|
||||
export KBUILD_BUILD_HOST=katabuildhost
|
||||
# Default to zero seconds after midnight 1970-01-01 (the epoch)
|
||||
export KBUILD_BUILD_TIMESTAMP="$(LANG=C date -u -d "@${SOURCE_DATE_EPOCH:-0}")"
|
||||
make -s ARCH=$(KERNEL_ARCH) oldconfig > /dev/null
|
||||
make -s CONFIG_DEBUG_SECTION_MISMATCH=y ARCH=$(KERNEL_ARCH)
|
||||
|
||||
|
@ -87,6 +87,11 @@ BuildKernel() {
|
||||
export CFLAGS="-Wno-error=restrict"
|
||||
export EXTRA_CFLAGS="-Wno-format-truncation -Wno-cast-function-type -Wno-error=restrict -Wno-error"
|
||||
%endif
|
||||
# https://github.com/kata-containers/packaging/issues/394 enable reproducible builds:
|
||||
export KBUILD_BUILD_USER=katabuilduser
|
||||
export KBUILD_BUILD_HOST=katabuildhost
|
||||
# Default to zero seconds after midnight 1970-01-01 (the epoch)
|
||||
export KBUILD_BUILD_TIMESTAMP="$(LANG=C date -u -d "@${SOURCE_DATE_EPOCH:-0}")"
|
||||
|
||||
make -s ARCH=$kernelArch oldconfig > /dev/null
|
||||
make -s CONFIG_DEBUG_SECTION_MISMATCH=y %{?_smp_mflags} ARCH=$kernelArch %{?sparse_mflags} || exit 1
|
||||
|
Loading…
Reference in New Issue
Block a user