kernel-defaults: ensure SOURCE_DATE_EPOCH on /init
authorPaul Spooren <mail@aparcar.org>
Mon, 30 Sep 2019 05:31:52 +0000 (19:31 -1000)
committerDaniel Golle <daniel@makrotopia.org>
Wed, 2 Oct 2019 15:11:44 +0000 (17:11 +0200)
This is a follow up of 8cb13f4e6d which sets the right timestamp for the
/init file in initramfs. The previous patch doesn't cover it as the
files appear to come from a later step during compilation.

CC: Alexander Couzens <lynxis@fe80.eu>
Signed-off-by: Paul Spooren <mail@aparcar.org>
include/kernel-defaults.mk

index cc1e2361be50437fb725b42cb9248d42d7095649..db93a53d71e42ebe2d3312ebcefceaa611fb1f72 100644 (file)
@@ -146,6 +146,7 @@ ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
 define Kernel/CompileImage/Initramfs
        $(call Kernel/Configure/Initramfs)
        $(CP) $(GENERIC_PLATFORM_DIR)/other-files/init $(TARGET_DIR)/init
+       $(if $(SOURCE_DATE_EPOCH),touch -hcd "@$(SOURCE_DATE_EPOCH)" $(TARGET_DIR)/init)
        rm -rf $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)/usr/initramfs_data.cpio*
        +$(KERNEL_MAKE) $(if $(KERNELNAME),$(KERNELNAME),all) modules
        $(call Kernel/CopyImage,-initramfs)