From patchwork Thu May 2 00:42:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vagrant Cascadian X-Patchwork-Id: 1093969 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=reproducible-builds.org Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44vc2q5GqYz9s9N for ; Thu, 2 May 2019 10:44:03 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 4ABD9C21DFA; Thu, 2 May 2019 00:43:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id BC591C21DAF; Thu, 2 May 2019 00:43:18 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id DA4BAC21E02; Thu, 2 May 2019 00:43:03 +0000 (UTC) Received: from cascadia.aikidev.net (cascadia.aikidev.net [173.255.214.101]) by lists.denx.de (Postfix) with ESMTP id 4C5D9C21DB6 for ; Thu, 2 May 2019 00:43:00 +0000 (UTC) Received: from localhost (unknown [IPv6:2600:3c01:e000:21:21:21:0:100e]) (Authenticated sender: vagrant@aikidev.net) by cascadia.aikidev.net (Postfix) with ESMTPSA id D83C91AA54; Wed, 1 May 2019 17:42:58 -0700 (PDT) From: Vagrant Cascadian To: u-boot@lists.denx.de Date: Wed, 1 May 2019 17:42:16 -0700 Message-Id: <20190502004217.20863-4-vagrant@reproducible-builds.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190502004217.20863-1-vagrant@reproducible-builds.org> References: <20190502004217.20863-1-vagrant@reproducible-builds.org> MIME-Version: 1.0 Cc: Marek Vasut , Baruch Siach , Vagrant Cascadian , Chris Packham , Marek Vasut Subject: [U-Boot] [PATCH 3/3] Set time and umask on fit-dtb.blob to ensure reproducibile builds. X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" When building compressed (lzop, gzip) fit-dtb.blob images, the compression tool may embed the time or umask in the image. Work around this by manually setting the time of the source file using SOURCE_DATE_EPOCH and a hard-coded 0600 umask. With gzip, this could be accomplished by using -n/--no-name, but lzop has no current workaround: https://bugs.debian.org/896520 Signed-off-by: Vagrant Cascadian --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 68f2327bea..cff5ea4c5f 100644 --- a/Makefile +++ b/Makefile @@ -1047,6 +1047,10 @@ fit-dtb.blob.lzo: fit-dtb.blob fit-dtb.blob: dts/dt.dtb FORCE $(call if_changed,mkimage) +ifneq ($(SOURCE_DATE_EPOCH),) + touch -d @$(SOURCE_DATE_EPOCH) fit-dtb.blob + chmod 0600 fit-dtb.blob +endif MKIMAGEFLAGS_fit-dtb.blob = -f auto -A $(ARCH) -T firmware -C none -O u-boot \ -a 0 -e 0 -E \