From patchwork Wed Nov 23 11:08:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 698153 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tP04n4DQLz9t37 for ; Wed, 23 Nov 2016 22:10:49 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id B19372EA5B; Wed, 23 Nov 2016 11:10:47 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TZZ7P12lB2qu; Wed, 23 Nov 2016 11:10:40 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id B301430142; Wed, 23 Nov 2016 11:09:26 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 490BE1BFC46 for ; Wed, 23 Nov 2016 11:08:33 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 432F92EA11 for ; Wed, 23 Nov 2016 11:08:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dUlzqH-G1H12 for ; Wed, 23 Nov 2016 11:08:30 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from lupi.sysmic.org (sysmic.org [62.210.89.17]) by silver.osuosl.org (Postfix) with ESMTPS id B4F1B2E631 for ; Wed, 23 Nov 2016 11:08:30 +0000 (UTC) Received: from lupi.online.net (sysmic.org [62.210.89.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jezz) by lupi.sysmic.org (Postfix) with ESMTPSA id 4AA8442744; Wed, 23 Nov 2016 12:08:27 +0100 (CET) From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Pouiller?= To: buildroot@busybox.net Date: Wed, 23 Nov 2016 12:08:06 +0100 Message-Id: <1479899298-14655-7-git-send-email-jezz@sysmic.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1479899298-14655-1-git-send-email-jezz@sysmic.org> References: <1479899298-14655-1-git-send-email-jezz@sysmic.org> MIME-Version: 1.0 Cc: Thomas Petazzoni , =?UTF-8?q?J=C3=A9r=C3=B4me=20Pouiller?= Subject: [Buildroot] [PATCH v3 06/18] reproducibility/linux: inhibit build-id X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Linux kernel include build path in debug sections. These sections are stripped and do not impact build reproducibility directly. However, 'build-id' depends on content of all sections, including debug sections. So, it add random bytes in section .notes of kernel image[1]: $ readelf -Wn .../vmlinux Displaying notes found at file offset 0x00008000 with length 0x00000024: Owner Data size Description GNU 0x00000014 NT_GNU_BUILD_ID (unique build ID bitstring) Build ID: ca689e2ed3944f49474715908e2ac1bb04907fb2 In order to not depend on build path, patch kernel Makefile to disable 'build-id'. [1] https://kernelnewbies.org/BuildId This work was sponsored by `BA Robotic Systems'. Signed-off-by: Jérôme Pouiller --- linux/linux.mk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/linux/linux.mk b/linux/linux.mk index 7e826cc..a63d1f3 100644 --- a/linux/linux.mk +++ b/linux/linux.mk @@ -209,6 +209,13 @@ define LINUX_TRY_PATCH_TIMECONST endef LINUX_POST_PATCH_HOOKS += LINUX_TRY_PATCH_TIMECONST +ifeq ($(BR2_REPRODUCIBLE),y) +define LINUX_REMOVE_BUILD_ID + sed -i -e s/--build-id/--build-id=none/ $(@D)/Makefile +endef +LINUX_POST_PATCH_HOOKS += LINUX_REMOVE_BUILD_ID +endif + ifeq ($(BR2_LINUX_KERNEL_USE_DEFCONFIG),y) LINUX_KCONFIG_DEFCONFIG = $(call qstrip,$(BR2_LINUX_KERNEL_DEFCONFIG))_defconfig else ifeq ($(BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG),y)