From 85a7be2414c4718e96d81a2ebaa70d0d42152e62 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Fri, 27 Mar 2015 13:26:48 +0100 Subject: [PATCH] util/mkimage: Use stable timestamp when generating binaries. --- util/mkimage.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/util/mkimage.c b/util/mkimage.c index 7821dc5ea..52265b557 100644 --- a/util/mkimage.c +++ b/util/mkimage.c @@ -55,6 +55,9 @@ #define TARGET_NO_FIELD 0xffffffff +/* use 2015-01-01T00:00:00+0000 as a stock timestamp */ +#define STABLE_EMBEDDING_TIMESTAMP 1420070400 + struct grub_install_image_target_desc { const char *dirname; @@ -1439,7 +1442,7 @@ grub_install_generate_image (const char *dir, const char *prefix, c->machine = grub_host_to_target16 (image_target->pe_target); c->num_sections = grub_host_to_target16 (4); - c->time = grub_host_to_target32 (time (0)); + c->time = grub_host_to_target32 (STABLE_EMBEDDING_TIMESTAMP); c->characteristics = grub_host_to_target16 (GRUB_PE32_EXECUTABLE_IMAGE | GRUB_PE32_LINE_NUMS_STRIPPED | ((image_target->voidp_sizeof == 4) @@ -1782,7 +1785,7 @@ grub_install_generate_image (const char *dir, const char *prefix, memset (hdr, 0, sizeof (*hdr)); hdr->ih_magic = grub_cpu_to_be32_compile_time (GRUB_UBOOT_IH_MAGIC); - hdr->ih_time = grub_cpu_to_be32 (time (0)); + hdr->ih_time = grub_cpu_to_be32 (STABLE_EMBEDDING_TIMESTAMP); hdr->ih_size = grub_cpu_to_be32 (core_size); hdr->ih_load = grub_cpu_to_be32 (image_target->link_addr); hdr->ih_ep = grub_cpu_to_be32 (image_target->link_addr);