kernel: set SOURCE_DATE_EPOCH for initramfs root dir
authorDaniel Golle <daniel@makrotopia.org>
Wed, 6 Apr 2022 11:19:31 +0000 (12:19 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Wed, 6 Apr 2022 11:20:26 +0000 (12:20 +0100)
Make sure the timestamp of the root directory of the initramfs is set
to SOURCE_DATE_EPOCH as well.

Fixes: 29d7461d11 ("kernel: set options to make external initramfs reproducible")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
include/kernel-defaults.mk

index 1e82f7d73994926a36d9b82912e6724594f022a7..2e2139201689fc7a1befb5a5b7794fb5c3e80c35 100644 (file)
@@ -168,7 +168,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)
+       $(if $(SOURCE_DATE_EPOCH),touch -hcd "@$(SOURCE_DATE_EPOCH)" $(TARGET_DIR) $(TARGET_DIR)/init)
        rm -rf $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)/usr/initramfs_data.cpio*
 ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS_SEPARATE),y)
 ifneq ($(qstrip $(CONFIG_EXTERNAL_CPIO)),)