From patchwork Tue Jul 16 17:35:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atharva Lele X-Patchwork-Id: 1132887 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="RAiyU0Lh"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45p6xS073Mz9s7T for ; Wed, 17 Jul 2019 03:35:39 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 24DA78757E; Tue, 16 Jul 2019 17:35:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1xfKNsWh0P3H; Tue, 16 Jul 2019 17:35:35 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 526CA87D7F; Tue, 16 Jul 2019 17:35:35 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 31B5C1BF414 for ; Tue, 16 Jul 2019 17:35:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 258F287D7F for ; Tue, 16 Jul 2019 17:35:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id X4JfwLxLGbnC for ; Tue, 16 Jul 2019 17:35:32 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by hemlock.osuosl.org (Postfix) with ESMTPS id D65398757E for ; Tue, 16 Jul 2019 17:35:32 +0000 (UTC) Received: by mail-pf1-f194.google.com with SMTP id b13so9454625pfo.1 for ; Tue, 16 Jul 2019 10:35:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jtjZgHfBWMXiZ08CeJDty4s/xvaRm4ZN/Cpe5XZSt4c=; b=RAiyU0Lh66cqkw8fHHouj6H1LFFeJX07O+BeGzubzaqcYEHBsKnrRmCYSakejzJv6s tlhmbQYXoQBshq1xU/biu33DYxQZhYEgOsQQsH0c65IBjWcEm8b5LjkWSx6No0CNv8kF f7mgeL3kfalr1ZWpeERQCXg1V48mopZk/4lWDb8E1gC+yxcmOQSuDrJ3jQYg8Yt3we1e Jd2UsJyjfaHim9Fs+2WCdjVS8ek2YfxuteRRZiae8uYbBNpG3FFM4OVJC3vsVsUE3J7M R4PnD2FqNd0dCeKMomK5lahOGeJ/CsydLuDmnuzdHuDIvw+oEXStkkb7h6yrs/eig7ke nL4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jtjZgHfBWMXiZ08CeJDty4s/xvaRm4ZN/Cpe5XZSt4c=; b=Cp4kqshjzBKJX4vO9Kmm/lkYxrg88qNYZZqUfrV9q8/uUw9H6Vut1qhQyYZ/TD9joY VQARhcgsa6gwmZyu7INrvddFFeJ3GUA2X9GG5Q/oYXH+GGyxTAAoaPydxdcePrNaGM+f ejGvLHzaa5FfKMP8N9VMQy/9aG+tT+vSbkY7AxNSsL6bdC/k00KzJsKDheIuEwVku83M vpr5sGI9nd7Ijt4a5/9gfT18LJIou/43i85sxiodICpnElhd8y2e9Ktidn9DboDf/DZV zg9dmKukVRiaKMFKVd92uI5bpjh2p49g2wWSbwZmrJASbu4AgPvhFup/QeVc2tuv4zM/ e2Bg== X-Gm-Message-State: APjAAAUX02redI8qqEhZboMmDdR38ImLfkHYw1GoY2xB9gXL7gZ0oE7Y 02mbGPL7/leZXMX1yMwKILDaEIe6fmw= X-Google-Smtp-Source: APXvYqxEB+9Lv+OgswzKnztE0LqPu8yikiCJoO90+rvmqSZhIjLNiWxPWgQtAmSPq/iJBQDDHIdBHg== X-Received: by 2002:a63:e807:: with SMTP id s7mr34459455pgh.194.1563298531966; Tue, 16 Jul 2019 10:35:31 -0700 (PDT) Received: from localhost.localdomain ([123.201.194.59]) by smtp.gmail.com with ESMTPSA id a3sm22830647pfi.63.2019.07.16.10.35.29 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 16 Jul 2019 10:35:31 -0700 (PDT) From: Atharva Lele To: buildroot@buildroot.org Date: Tue, 16 Jul 2019 23:05:17 +0530 Message-Id: <20190716173518.11081-1-itsatharva@gmail.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 1/2] package/cpio: add host version X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Atharva Lele , yann.morin.1998@free.fr Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: "Yann E. MORIN" The latest cpio has a --reproducible option, which may come handy when we try to, well, be reproducible... Reported-by: Arnout Vandecappelle Signed-off-by: Yann E. MORIN [Atharva: don't force --bindir, as noticed by Arnout] Signed-off-by: Atharva Lele Acked-by: Yann E. MORIN Cc: Arnout Vandecappelle Cc: Atharva Lele --- Changes v1 -> v2: - Add patch from Yann to my series - Fix [Atharva: ] comment --- package/cpio/cpio.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/package/cpio/cpio.mk b/package/cpio/cpio.mk index 9a09279572..cc40838840 100644 --- a/package/cpio/cpio.mk +++ b/package/cpio/cpio.mk @@ -17,3 +17,4 @@ CPIO_DEPENDENCIES += argp-standalone endif $(eval $(autotools-package)) +$(eval $(host-autotools-package)) From patchwork Tue Jul 16 17:35:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atharva Lele X-Patchwork-Id: 1132888 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="N4BFpqSo"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45p6xT4sctz9s7T for ; Wed, 17 Jul 2019 03:35:41 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id B88D4869EA; Tue, 16 Jul 2019 17:35:39 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NhZjj5AqX2Sk; Tue, 16 Jul 2019 17:35:39 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id C312F86A02; Tue, 16 Jul 2019 17:35:38 +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 9E9261BF414 for ; Tue, 16 Jul 2019 17:35:37 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 9C22C204D6 for ; Tue, 16 Jul 2019 17:35:37 +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 OaEwHTOoPJie for ; Tue, 16 Jul 2019 17:35:36 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by silver.osuosl.org (Postfix) with ESMTPS id C75DB1FD43 for ; Tue, 16 Jul 2019 17:35:36 +0000 (UTC) Received: by mail-pl1-f193.google.com with SMTP id y8so10456682plr.12 for ; Tue, 16 Jul 2019 10:35:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SZ92qdRVQjsOLSTkXD1xFGmQH3vpQEdCJXEgRQcS4Hc=; b=N4BFpqSoDnzz0rb0YFqiHoIMZvnis/13/tShDdd/1SfKP8AE3co8EmxiL2YA0FAKk4 w64sSNSwv9EuMn5cq8n2JUkIx1y7ZQ7cjtEdRn1xayuQgvdbj/F8D3CsNxCDwbPUr7GR LIw+ksy+PGx/yZ0VxfAaFwYh/FLTooLmeMztRGOz0wGM3gxrqQ7VVYOPrlsEU3ChU5gV xV3GXs/ibAecVMeeJIr5i4kshrV/9UtIcMqdW1CCP5AYBKVWWdxN9CCZ0szoL7h7Sl96 m5sW1WJTLo3Dhn4Gzhh9KC48VwcOnmW+8BCSwT9N3lnyDKrtntMYwcwCIQnOfBbdiGTC xofg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SZ92qdRVQjsOLSTkXD1xFGmQH3vpQEdCJXEgRQcS4Hc=; b=EpCjqz6mSDu+EKJzfoB8mdI3diFss2X+m8/mOEhYhA6SsMzHhWs38glXeafc/cWQyp eLZw0MmKEYyHt0gvhoGe2TqqlpAyDGY+ggSFsyX2ImUlPwx6YUAvfmQaTPVXy2kZS20p vXF9e1E0OTVbIvg8VIfimR4gCXsxli/J3UpskMZlqJ7oUzcwtRxLH5mGpNe3EQTRyvun 3PWW9ouiVxSmU34pWQ+PnlLCR0g2hqjYDRe+Nd4Fq79QPb9lmxmCd7bm23Utw51zKy4o R98popDMvHjsujV6laMFtjZ807IuoFH+rvq3pbhcnKRK3ed81BoY7Fb9cAFULiSe0w7M eCfA== X-Gm-Message-State: APjAAAVm4dKXjaBwv+LUUgqkMi3c91IVkRRfKBZfCsnFTK0K4XMpHvny qGSCn1yGe7w+mXHSYo9nD+HTCyRv7zs= X-Google-Smtp-Source: APXvYqzNF01ZwlNzD4Yxmalz/CdOUBMeAyvebEEiOCf+9Vo5uFA3xLBjng2E8ssBmthslxPHbnYtww== X-Received: by 2002:a17:902:2aea:: with SMTP id j97mr25956118plb.153.1563298536006; Tue, 16 Jul 2019 10:35:36 -0700 (PDT) Received: from localhost.localdomain ([123.201.194.59]) by smtp.gmail.com with ESMTPSA id a3sm22830647pfi.63.2019.07.16.10.35.34 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 16 Jul 2019 10:35:35 -0700 (PDT) From: Atharva Lele To: buildroot@buildroot.org Date: Tue, 16 Jul 2019 23:05:18 +0530 Message-Id: <20190716173518.11081-2-itsatharva@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190716173518.11081-1-itsatharva@gmail.com> References: <20190716173518.11081-1-itsatharva@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 2/2] fs/cpio: make cpio rootfs reproducible X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Atharva Lele , yann.morin.1998@free.fr Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Pass the recommended argument in the CPIO manual to make cpio archives reproducible. Reference: https://www.gnu.org/software/cpio/manual/cpio.html#Copy_002dpass-mode Pre-patch diffoscope output: https://gitlab.com/snippets/1874745 Post-patch: https://gitlab.com/snippets/1874746 We can see that post-patch, the archive related differences are removed. The differences are arising from utils/bin/getconf. This will have to be investigated further. However, that is unrelated to cpio. Signed-off-by: Atharva Lele Reviewed-by: Yann E. MORIN --- Changes v1 -> v2: - Added comment - Build host-cpio if we are reproducible, reason is --reproducible option does not exist prior to cpio 2.12. (suggested by Yann, Arnout) - Changed pure assignment to append-assignment - CPIO_OPTS -> ROOTFS_CPIO_OPTS to prevent clash with cpio package's options if added in future --- fs/cpio/cpio.mk | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/fs/cpio/cpio.mk b/fs/cpio/cpio.mk index 1f0cafe62f..275064d9cb 100644 --- a/fs/cpio/cpio.mk +++ b/fs/cpio/cpio.mk @@ -29,8 +29,16 @@ endif # BR2_ROOTFS_DEVICE_CREATION_STATIC ROOTFS_CPIO_PRE_GEN_HOOKS += ROOTFS_CPIO_ADD_INIT +# --repoducible option was not introduced until cpio v2.12. Some distros +# like Ubuntu 16.04 or Debian oldstable which package v2.11. Hence build +# host-cpio. +ifeq ($(BR2_REPRODUCIBLE), y) +ROOTFS_CPIO_DEPENDENCIES += host-cpio +ROOTFS_CPIO_OPTS += --reproducible +endif + define ROOTFS_CPIO_CMD - cd $(TARGET_DIR) && find . | cpio --quiet -o -H newc > $@ + cd $(TARGET_DIR) && find . | cpio $(ROOTFS_CPIO_OPTS) --quiet -o -H newc > $@ endef ifeq ($(BR2_TARGET_ROOTFS_CPIO_UIMAGE),y)