public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] build: create time and date independent binary
Date: Mon, 15 Jun 2015 15:04:32 +0200	[thread overview]
Message-ID: <557ECD60.6060206@denx.de> (raw)
In-Reply-To: <1434140503.2415.10.camel@collins>

Hello Paul,

Am 12.06.2015 22:21, schrieb Paul Kocialkowski:
> Le vendredi 12 juin 2015 ? 17:31 +0200, Heiko Schocher a ?crit :
>> With this option enabled each compilation creates the exact
>> same binary. There are no timestamps, with which a U-Boot
>> binary can be identified.
>>
>> This option is disabled by default.
>
> I think a bit more is needed to get truly reproducible builds in U-Boot,
> but this is a first good step!
>
> I have been thinking about bringing reproducible builds to U-Boot for a
> little while, but never got around actually doing it. Are you interested
> in helping me on that? I have some free time these days, so I could do
> some work on this.

Hmm.. define what is a "reproducible build" ... my patch produces
always the same u-boot binary if you not change the toolchain ...

> It would certainly be relevant to get in touch with the people working
> on reproducing builds for Debian (I know Lunar is involved with this),
> since Debian packages U-Boot for many devices and they're apparently
> willing to help upstream with automated tests, as they're doing with
> coreboot and OpenWRT!

Yep, that would be helpful ...

bye,
Heiko
>
>> Signed-off-by: Heiko Schocher <hs@denx.de>
>> ---
>>
>>   Kconfig  | 9 +++++++++
>>   Makefile | 8 ++++++++
>>   2 files changed, 17 insertions(+)
>>
>> diff --git a/Kconfig b/Kconfig
>> index 15e15af..c0c7eb8 100644
>> --- a/Kconfig
>> +++ b/Kconfig
>> @@ -81,6 +81,15 @@ menuconfig EXPERT
>>   	  Only use this if you really know what you are doing.
>>
>>   if EXPERT
>> +	config SYS_EXACT_BINARY
>> +	bool "Create time and date independent binary"
>> +	default n
>> +	help
>> +	  With this option enabled each compilation creates the exact
>> +	  same binary. There are no timestamps, with which a U-Boot
>> +	  binary can be identified.
>> +	  This option is disabled by default.
>> +
>>   	config SYS_MALLOC_CLEAR_ON_INIT
>>   	bool "Init with zeros the memory reserved for malloc (slow)"
>>   	default y
>> diff --git a/Makefile b/Makefile
>> index 0a674bf..4ae2701 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -1230,11 +1230,19 @@ define filechk_version.h
>>   	echo \#define LD_VERSION_STRING \"$$($(LD) --version | head -n 1)\"; )
>>   endef
>>
>> +ifeq ($(CONFIG_SYS_EXACT_BINARY),y)
>> +define filechk_timestamp.h
>> +	(LC_ALL=C date +'#define U_BOOT_DATE "NODATE"'; \
>> +	LC_ALL=C date +'#define U_BOOT_TIME "NOTIME"'; \
>> +	LC_ALL=C date +'#define U_BOOT_TZ "NOTZ"')
>> +endef
>> +else
>>   define filechk_timestamp.h
>>   	(LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"'; \
>>   	LC_ALL=C date +'#define U_BOOT_TIME "%T"'; \
>>   	LC_ALL=C date +'#define U_BOOT_TZ "%z"')
>>   endef
>> +endif
>>
>>   $(version_h): include/config/uboot.release FORCE
>>   	$(call filechk,version.h)
>

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

  parent reply	other threads:[~2015-06-15 13:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-12 15:31 [U-Boot] [PATCH] build: create time and date independent binary Heiko Schocher
2015-06-12 20:21 ` Paul Kocialkowski
2015-06-13  9:10   ` [U-Boot] [Reproducible-builds] " Holger Levsen
2015-06-13 18:26     ` Paul Kocialkowski
2015-07-19 12:36       ` Holger Levsen
2015-07-19 13:14         ` Vagrant Cascadian
2015-07-19 15:00           ` Paul Kocialkowski
2015-07-19 15:18             ` Holger Levsen
2015-07-20  6:23           ` Heiko Schocher
2015-07-20  8:03             ` Paul Kocialkowski
2015-07-19 14:55         ` Paul Kocialkowski
2015-07-19 15:47           ` Holger Levsen
2015-07-19 16:39             ` Paul Kocialkowski
2015-06-15 13:04   ` Heiko Schocher [this message]
2015-06-13 19:40 ` [U-Boot] " Chris Kuethe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=557ECD60.6060206@denx.de \
    --to=hs@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox