From patchwork Sun Jan 14 14:16:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 860438 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="KaeOhwtZ"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zKJTz3XLrz9sR8 for ; Mon, 15 Jan 2018 01:17:43 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 19C7487A20; Sun, 14 Jan 2018 14:17:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wHWMOXhEk_DX; Sun, 14 Jan 2018 14:17:38 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id BA0C287988; Sun, 14 Jan 2018 14:17:38 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id A7DD61C14DD for ; Sun, 14 Jan 2018 14:17:37 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id A480A885B7 for ; Sun, 14 Jan 2018 14:17:37 +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 cY9tilrMIAEI for ; Sun, 14 Jan 2018 14:17:37 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by whitealder.osuosl.org (Postfix) with ESMTPS id BF1318859C for ; Sun, 14 Jan 2018 14:17:36 +0000 (UTC) Received: by mail-wm0-f66.google.com with SMTP id 141so19776916wme.3 for ; Sun, 14 Jan 2018 06:17:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=hsAvlXST7p441xQIXvjQunX3/m1gK2Cex64N4Jvahqk=; b=KaeOhwtZVlZtAaQpdCZH4fZdCohIpAF+BHMTCcEanFhxPFLhvogV2dfwZTVAvZwYZE hX+75uascWtGpgi4fAfXLXvvx0NzQzDBnX1YvXwxZT4zQc3fTW4tE0Y6gGB5FnyGGB2Y IzWR+FyOgoQecwJgwyyb9bRowsVuUU4Iv1mJM2r+2K5iqJlX1X33KndjvInzjInMDAar oS6XacFj+qKd/9/e0tS8znfDszeabWFW0kS25A6YXwrFiCZYcAqH5XgRVpuvd8y2d5tC Zk+r327b8HagblpqGKJPgTuZsUJTUrpDU+skmFCkew2eVKle4lhsqwU46loRCqSL9VQ/ tZ+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=hsAvlXST7p441xQIXvjQunX3/m1gK2Cex64N4Jvahqk=; b=GVIKnXegxZOTLQt04sDhe8KXrnNB1EO6e3gxDu6wGiX0xXamDybjSLbwnPd2MGTSrR zzKNtmwZvunW7lztrw+uzv0K7/8t1qhw34ZdwOgYPzwL9ElLCLDy9hNnuQEf0Gy8RePf n/TlpBsxcg5BAeBHKbTADnuFjfHZymYpPKuEutgMY07+aOwvHnMlic5HyU4qv1H3RBLj Mcam/LEkhhgX2rYoGlZAvZzymXi86xxbx+sX+SRu0sGF/I8QQcoFYwceaTLPTsAs5JiZ S/HsPSYJbc9qWNM8ee9j3lX9H7Xu0V4aqlqwJFcFzcTDIzRlzFSNJQ0rQOsVKNH6qMIx FWZQ== X-Gm-Message-State: AKwxytfApvGoMoZMI8ihpoGuzJAqQ06rojkZxIq1yT7+WkgZkXAeH39i mhDKw1PuvamvfKlUwkIOgjS1ew== X-Google-Smtp-Source: ACJfBotiXy+F0Nhe7ojJC+Wje0NOEuuk4ndqZ7uCWz0bZZIJOIN9Y/i11YF9zSlpGESHenrsrKvAdg== X-Received: by 10.28.109.79 with SMTP id i76mr7821608wmc.142.1515939454974; Sun, 14 Jan 2018 06:17:34 -0800 (PST) Received: from localhost.localdomain (2a01cb088610730095116638271b1e6e.ipv6.abo.wanadoo.fr. [2a01:cb08:8610:7300:9511:6638:271b:1e6e]) by smtp.gmail.com with ESMTPSA id d63sm3260179wmd.9.2018.01.14.06.17.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Jan 2018 06:17:34 -0800 (PST) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Sun, 14 Jan 2018 15:16:57 +0100 Message-Id: <014946f321e52b20e14518002e89ec9662bfad53.1515939400.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 2.14.1 In-Reply-To: References: Subject: [Buildroot] [PATCH 01/17] fs: pass EXTRA_ENV to post-fakeroot script X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , "Yann E. MORIN" MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Like we do for post-build and post-image scripts, pass EXTRA_ENV to post-fakeroot script. Signed-off-by: "Yann E. MORIN" Cc: Thomas Petazzoni --- fs/common.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/common.mk b/fs/common.mk index 9715eb13d9..6d579db810 100644 --- a/fs/common.mk +++ b/fs/common.mk @@ -95,7 +95,7 @@ endif echo "$$(HOST_DIR)/bin/makedevs -d $$(FULL_DEVICE_TABLE) $$(TARGET_DIR)" >> $$(FAKEROOT_SCRIPT) $$(foreach s,$$(call qstrip,$$(BR2_ROOTFS_POST_FAKEROOT_SCRIPT)),\ echo "echo '$$(TERM_BOLD)>>> Executing fakeroot script $$(s)$$(TERM_RESET)'" >> $$(FAKEROOT_SCRIPT); \ - echo $$(s) $$(TARGET_DIR) $$(BR2_ROOTFS_POST_SCRIPT_ARGS) >> $$(FAKEROOT_SCRIPT)$$(sep)) + echo $$(EXTRA_ENV) $$(s) $$(TARGET_DIR) $$(BR2_ROOTFS_POST_SCRIPT_ARGS) >> $$(FAKEROOT_SCRIPT)$$(sep)) $$(foreach hook,$$(ROOTFS_PRE_CMD_HOOKS),\ $$(call PRINTF,$$($$(hook))) >> $$(FAKEROOT_SCRIPT)$$(sep)) ifeq ($$(BR2_REPRODUCIBLE),y) From patchwork Sun Jan 14 14:16:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 860439 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="hOou41Ko"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zKJV358p5z9sR8 for ; Mon, 15 Jan 2018 01:17:47 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 930D387A1C; Sun, 14 Jan 2018 14:17:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hOb6z6M1x47B; Sun, 14 Jan 2018 14:17:40 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 98FFB87A35; Sun, 14 Jan 2018 14:17:40 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id A897E1C14DD for ; Sun, 14 Jan 2018 14:17:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id A35FF87982 for ; Sun, 14 Jan 2018 14:17:39 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DLfS6lJmOfsG for ; Sun, 14 Jan 2018 14:17:38 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by fraxinus.osuosl.org (Postfix) with ESMTPS id A435587966 for ; Sun, 14 Jan 2018 14:17:38 +0000 (UTC) Received: by mail-wr0-f195.google.com with SMTP id d9so9245591wre.3 for ; Sun, 14 Jan 2018 06:17:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=CPLbaJtRHkTyAhKpk6USZMnUisJ8PkLryDyVyMaeikM=; b=hOou41KoQ2lHAFJ/lmLjCIlXahiPz7AcYlg7oT6D68Jos6xu0RFXbfOGT1paKfvxiO h7FRJG/Y1DFJjLRDQotMt18DAU4mBi5K5/4FYeJ8MmByH2LipzC2GK+pZwOjZlAsX/wM sJjKOj81V7XJKmNv79EoSuZZc/TuPrdukKcm88sOFexfBlhh2Wq0U4406UWr1Wb4MS2s Di3BLPBcGktSHx1JdcYVZbRys94Sfvr/uhcr0FuDXXCA337QfdDyoBw/3yp29Qzd43qu Pkm/1A0ki0XzVsV/yoDHTtZt0PRgHIwG1P5rtODpanOvy5YfTwIhrb92cs9c1Ww2++zl i/NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=CPLbaJtRHkTyAhKpk6USZMnUisJ8PkLryDyVyMaeikM=; b=Y9s1aSHfeMh7UgBWzjclCOMQiScXNEsWmH5rp41rLoyoxFOWVojErLCAtdauzF3LZN uoX/rTHm84czaJURsofTXVxjZQvbVLVaCeEGE+WBileHsMpY1nuHJGajbT8dVaFZUkpn +TWkymUN8ifHmOpWHj1TRxmtHSvcmRqOY2zeqodrqoIGbO29ZXUxgrqeAY2YfnjlLQYe RZ2plQdEvQtpQO1ybn66v5o2WdAZXP1oyw9ck0ILYQjrcPX2zZbCLkejpmHLBQIiw7XX j9h4ZMM13aiLzVK1wCYoUjAqLbWKfW9lQUBJoKxZw7szN0BT1d2KDxLqT51Z95FC+BJN 0KmA== X-Gm-Message-State: AKwxytcaGJo/AbkieUGMGLPTxWH+B2pbT84lX2aCewvVkX9g65UG+R1S 9Jh9JN/2PwEjy/AAx5pXcJrOQQ== X-Google-Smtp-Source: ACJfBot59QRrEEKuLuTC2VSQaz5qnsnH+D7pbX8fsmuzFVB+4tYCdapNY+B3Iy2SKHNwie+LHi+hWA== X-Received: by 10.223.133.183 with SMTP id 52mr3175078wrt.78.1515939456884; Sun, 14 Jan 2018 06:17:36 -0800 (PST) Received: from localhost.localdomain (2a01cb088610730095116638271b1e6e.ipv6.abo.wanadoo.fr. [2a01:cb08:8610:7300:9511:6638:271b:1e6e]) by smtp.gmail.com with ESMTPSA id d63sm3260179wmd.9.2018.01.14.06.17.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Jan 2018 06:17:35 -0800 (PST) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Sun, 14 Jan 2018 15:16:58 +0100 Message-Id: <878bd9ac6569877450e28861cb047a93c1550eb9.1515939400.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 2.14.1 In-Reply-To: References: Subject: [Buildroot] [PATCH 02/17] tests: add test for post-fakeroot script X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , "Yann E. MORIN" , Ricardo Martincoski MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Currently, only post-build and post-image scripts were tested, each with their own test-script. The two test-scripts only differ in the name of the log file they create, and it is based on the name of the script, so it is easy to share the script. This allows us to easily re-use it for testing post-fakeroot scripts. Signed-off-by: "Yann E. MORIN" Cc: Thomas Petazzoni Cc: Ricardo Martincoski Reviewed-by: Ricardo Martincoski Tested-by: Ricardo Martincoski --- support/testing/tests/core/post-build.sh | 2 +- support/testing/tests/core/post-fakeroot.sh | 1 + support/testing/tests/core/post-image.sh | 13 +------------ support/testing/tests/core/test_post_scripts.py | 4 ++++ 4 files changed, 7 insertions(+), 13 deletions(-) create mode 120000 support/testing/tests/core/post-fakeroot.sh mode change 100755 => 120000 support/testing/tests/core/post-image.sh diff --git a/support/testing/tests/core/post-build.sh b/support/testing/tests/core/post-build.sh index b1fb834bc5..f3d0dbe511 100755 --- a/support/testing/tests/core/post-build.sh +++ b/support/testing/tests/core/post-build.sh @@ -9,4 +9,4 @@ printf "HOST_DIR,%s\n" "${HOST_DIR}" printf "STAGING_DIR,%s\n" "${STAGING_DIR}" printf "BINARIES_DIR,%s\n" "${BINARIES_DIR}" printf "BR2_CONFIG,%s\n" "${BR2_CONFIG}" -) > ${BUILD_DIR}/post-build.log +) > ${BUILD_DIR}/$(basename "${0}" .sh).log diff --git a/support/testing/tests/core/post-fakeroot.sh b/support/testing/tests/core/post-fakeroot.sh new file mode 120000 index 0000000000..d680fccafc --- /dev/null +++ b/support/testing/tests/core/post-fakeroot.sh @@ -0,0 +1 @@ +post-build.sh \ No newline at end of file diff --git a/support/testing/tests/core/post-image.sh b/support/testing/tests/core/post-image.sh deleted file mode 100755 index 1c2a0f2c89..0000000000 --- a/support/testing/tests/core/post-image.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -( -printf "arg1,%s\n" "${1}" -printf "arg2,%s\n" "${2}" -printf "arg3,%s\n" "${3}" -printf "TARGET_DIR,%s\n" "${TARGET_DIR}" -printf "BUILD_DIR,%s\n" "${BUILD_DIR}" -printf "HOST_DIR,%s\n" "${HOST_DIR}" -printf "STAGING_DIR,%s\n" "${STAGING_DIR}" -printf "BINARIES_DIR,%s\n" "${BINARIES_DIR}" -printf "BR2_CONFIG,%s\n" "${BR2_CONFIG}" -) > ${BUILD_DIR}/post-image.log diff --git a/support/testing/tests/core/post-image.sh b/support/testing/tests/core/post-image.sh new file mode 120000 index 0000000000..d680fccafc --- /dev/null +++ b/support/testing/tests/core/post-image.sh @@ -0,0 +1 @@ +post-build.sh \ No newline at end of file diff --git a/support/testing/tests/core/test_post_scripts.py b/support/testing/tests/core/test_post_scripts.py index 1db568b0d6..edb339d8c4 100644 --- a/support/testing/tests/core/test_post_scripts.py +++ b/support/testing/tests/core/test_post_scripts.py @@ -11,9 +11,11 @@ class TestPostScripts(infra.basetest.BRTest): BR2_SYSTEM_BIN_SH_NONE=y # BR2_PACKAGE_BUSYBOX is not set BR2_ROOTFS_POST_BUILD_SCRIPT="{}" + BR2_ROOTFS_POST_FAKEROOT_SCRIPT="{}" BR2_ROOTFS_POST_IMAGE_SCRIPT="{}" BR2_ROOTFS_POST_SCRIPT_ARGS="foobar baz" """.format(infra.filepath("tests/core/post-build.sh"), + infra.filepath("tests/core/post-fakeroot.sh"), infra.filepath("tests/core/post-image.sh")) def check_post_log_file(self, path, what): @@ -37,5 +39,7 @@ class TestPostScripts(infra.basetest.BRTest): def test_run(self): f = os.path.join(self.builddir, "build", "post-build.log") self.check_post_log_file(f, "target") + f = os.path.join(self.builddir, "build", "post-fakeroot.log") + self.check_post_log_file(f, "target") f = os.path.join(self.builddir, "build", "post-image.log") self.check_post_log_file(f, "images") From patchwork Sun Jan 14 14:16:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 860440 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="RtwUlLur"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zKJV65d9gz9sR8 for ; Mon, 15 Jan 2018 01:17:50 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 865EF87A44; Sun, 14 Jan 2018 14:17:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oL4BANfIOTbk; Sun, 14 Jan 2018 14:17:43 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id E1BD287A4D; Sun, 14 Jan 2018 14:17:42 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id B486C1C14DD for ; Sun, 14 Jan 2018 14:17:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id A72708799F for ; Sun, 14 Jan 2018 14:17:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0Zf4R7tRmL01 for ; Sun, 14 Jan 2018 14:17:40 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by fraxinus.osuosl.org (Postfix) with ESMTPS id C33C587966 for ; Sun, 14 Jan 2018 14:17:39 +0000 (UTC) Received: by mail-wr0-f193.google.com with SMTP id p6so9258000wrd.0 for ; Sun, 14 Jan 2018 06:17:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=EiyZNt2c3ZlFX0mcBA/3K/n3SCBhlYJAfP6Uwm27bmU=; b=RtwUlLur7OVFVb/1yAaJIv2KSzNGb3giD0FAi7s7eWYP8oEdd3MWsU/MMO2XDjgxPp 9Jqk2kHnO8N8DB9YV67yFT9JV6a2BXe8vrDdff1rT8ZDthrPiKwAEKWzMNTnLc+hlBWz iPwXHxDzt6NfHOgdUxfcjJgupelp6rR6CqbMggBpTJPHohtEalxFBI3TWicq7mbkj4fa to1LkxEJB4U7OMTNw+B3WD9g3WTHE/PxQkv6F6eh0doS1b+tC4SiwRHZ2uoONPRWz5fO Mtiod6iD9dIFKwKyTHFG0dx6IH+aFzEuKGiVTEPWa0lNSv/MFPhs17XIvpSUMHisFrFR yJJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=EiyZNt2c3ZlFX0mcBA/3K/n3SCBhlYJAfP6Uwm27bmU=; b=KSjufwGowjM+3BJvZu0NIQoAPcvYDaDA3khw/Pe4SAa9E1zQzn+ae+tI08SPgHTe7n KsaGuZx9AddqDCxfNz5UitgHPyZ+1/mjQjAIuFFzsLL1HV2uBZ5XqCrQ4KA3Z3bGx/dk a4tXIkoJf6wnr90dJeaNtrEhM+Fk/cVK/+8uTZJMReGgr1ME6VSerezQvHVIewbA6L4H 9lvIbrWLIJVm0Yg6HXUk4H99Lv6gqMs8jwP1nMd9yD9H5jc83yZnrjSV9ku9lL+6/5TJ IzIGPHohI5L8t6A7Jgtuv63rY8lFOjvOwhIjdO5MqXaI2fnj+Co032Sf76ObJJOb53Pt h52A== X-Gm-Message-State: AKwxytc1VFYldV+UUNhh2S1U5paVZKy2lhDuDzq0mMRFo+Rl7CIo1vpr pyLW0rikwwLUvuAw4bJly5ILEA== X-Google-Smtp-Source: ACJfBou9P3kULKp5c/k58MmociH/YzcdcU/Gi/6RUISrmjbdZBjf+Aq1mwJ8YDDoa4f75SxC6RwqtQ== X-Received: by 10.223.176.174 with SMTP id i43mr7358612wra.258.1515939458189; Sun, 14 Jan 2018 06:17:38 -0800 (PST) Received: from localhost.localdomain (2a01cb088610730095116638271b1e6e.ipv6.abo.wanadoo.fr. [2a01:cb08:8610:7300:9511:6638:271b:1e6e]) by smtp.gmail.com with ESMTPSA id d63sm3260179wmd.9.2018.01.14.06.17.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Jan 2018 06:17:37 -0800 (PST) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Sun, 14 Jan 2018 15:16:59 +0100 Message-Id: <32c8e4163ab1f955741edfb8ae6bfff784ac55b8.1515939400.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 2.14.1 In-Reply-To: References: Subject: [Buildroot] [PATCH 03/17] fs: run filesystem hooks under fakeroot X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , "Yann E. MORIN" MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: "Yann E. MORIN" Cc: Thomas Petazzoni Cc: Arnout Vandecappelle --- fs/common.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/common.mk b/fs/common.mk index 6d579db810..274a3e9c7b 100644 --- a/fs/common.mk +++ b/fs/common.mk @@ -76,9 +76,10 @@ $$(BINARIES_DIR)/rootfs.$(1): target-finalize $$(ROOTFS_$(2)_DEPENDENCIES) @$$(call MESSAGE,"Generating root filesystem image rootfs.$(1)") rm -rf $(FS_DIR) mkdir -p $(FS_DIR) - $$(foreach hook,$$(ROOTFS_$(2)_PRE_GEN_HOOKS),$$(call $$(hook))$$(sep)) echo '#!/bin/sh' > $$(FAKEROOT_SCRIPT) echo "set -e" >> $$(FAKEROOT_SCRIPT) + $$(foreach hook,$$(ROOTFS_$(2)_PRE_GEN_HOOKS),\ + $$(call PRINTF,$$($$(hook))) >> $$(FAKEROOT_SCRIPT)$$(sep)) echo "chown -h -R 0:0 $$(TARGET_DIR)" >> $$(FAKEROOT_SCRIPT) ifneq ($$(ROOTFS_USERS_TABLES),) cat $$(ROOTFS_USERS_TABLES) >> $$(USERS_TABLE) From patchwork Sun Jan 14 14:17:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 860442 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Kviv3UEG"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zKJV94VKJz9sR8 for ; Mon, 15 Jan 2018 01:17:53 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 4AF9F87A4D; Sun, 14 Jan 2018 14:17:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WSfxiRiyvWbK; Sun, 14 Jan 2018 14:17:44 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 4721787A5E; Sun, 14 Jan 2018 14:17:44 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 916101C14DD for ; Sun, 14 Jan 2018 14:17:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 8566987A44 for ; Sun, 14 Jan 2018 14:17:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aJ5jlbf_IDEt for ; Sun, 14 Jan 2018 14:17:41 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr0-f194.google.com (mail-wr0-f194.google.com [209.85.128.194]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 603D787A37 for ; Sun, 14 Jan 2018 14:17:41 +0000 (UTC) Received: by mail-wr0-f194.google.com with SMTP id e41so8900473wre.9 for ; Sun, 14 Jan 2018 06:17:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=gnGFMsQBOwbeREugljNKTVrcXls3GcTjkFfxcZA7D1o=; b=Kviv3UEGN0Oj7GZvp1GHM9ybhKDHVW7M/HZu75wG5ckOvXJw2wvyalwkTdQsT7qGk/ mhskWJOdyGLpgRSjo3z6Ub0NJvClsSPu8txIkaUYNjmUDnAEhNRsn/8DowG9Uikh08WJ nvqFqbB1uke3/3hba72hmFPXD5xqNkgvvWF3cBOqk+jfwEjQIoLin0d8Uc4NOGw8LVqj p0ytuJKGzRCYK+sc7PB7gWmU++uu/EK9OnS+/sY2dsvjdNa1mvvJvd1k+NjpF24M4bGc DDwvmsRs3SutSKCU8U3i4lCk6uAl+146fMdhSy4gTB3KXwokoEJo0KhFRed71zP9zJjh KD/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=gnGFMsQBOwbeREugljNKTVrcXls3GcTjkFfxcZA7D1o=; b=HOmRrRv27FzsGKuNMX4TNoKnDNFOQ9Ylb4M12q/N+Pu2UUa7JN00qw45khZqDBkXNp ZMT0l/Rme1SAiGoQ2J0alJ0osbiBwvxisXLrNMFxSFoZuKX0oelXBKBIGhLQa+lMqpY1 2+YGzn8vQNQjNduisi33OHAUe0Hq0VPe52jO3OTgajfcNgLj99ho1fzCe1ZfpoBHiHI4 hRjntjTx8HysE+YPzVMzHGiB/6MJ1yOZZGu9SJn7rsC6Bpfl5DTVm7k7CVXwSK8GIhog xyqZjBhfR1tA7WVk1YJ0myRXI1DS3GSsEqtUUtSKKpuOWPed+477r5fc9FKx4q3wNW0n ExXw== X-Gm-Message-State: AKwxytcVd8LoxGfGgcwyz1sm7aS0TL3M8HPSNnPtJQGHSI330zrxE3Io cOkfzvdol1lONpqqmQz8p0Khxw== X-Google-Smtp-Source: ACJfBotnsky2MCgFAvfyBRYwOfxcYvrBJV5z5GDNBggRYuyEJK8vs14GFfhm+M7KA9tU9syKwXcJjA== X-Received: by 10.223.164.22 with SMTP id d22mr10778888wra.186.1515939459678; Sun, 14 Jan 2018 06:17:39 -0800 (PST) Received: from localhost.localdomain (2a01cb088610730095116638271b1e6e.ipv6.abo.wanadoo.fr. [2a01:cb08:8610:7300:9511:6638:271b:1e6e]) by smtp.gmail.com with ESMTPSA id d63sm3260179wmd.9.2018.01.14.06.17.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Jan 2018 06:17:38 -0800 (PST) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Sun, 14 Jan 2018 15:17:00 +0100 Message-Id: <32219a9dca495a3547a60e749cd90b159e0f792f.1515939400.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 2.14.1 In-Reply-To: References: Subject: [Buildroot] [PATCH 04/17] fs/cpio: don't extend packages' permissions table X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , "Yann E. MORIN" MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Currently, when we build a cpio filesystem without static devices, we shoehorn the /dev/console node as if it were specified by a package. This means that this device is added for all filesystems as well, not just the cpio. But if we disable cpio, that device is not created for other filesystems. This is not very clean, and may break expectations. Instead, use an explicit mknod as part of the _CMD, as we know it's going to run under fakeroot. This is still visible to all filesystems built after cpio, and not to those built before it, though. Signed-off-by: "Yann E. MORIN" Cc: Thomas Petazzoni Cc: Arnout Vandecappelle --- fs/cpio/cpio.mk | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/cpio/cpio.mk b/fs/cpio/cpio.mk index aa4d947fa5..505976512b 100644 --- a/fs/cpio/cpio.mk +++ b/fs/cpio/cpio.mk @@ -15,14 +15,15 @@ endef else # devtmpfs does not get automounted when initramfs is used. # Add a pre-init script to mount it before running init +# We must have /dev/console very early, even before /init runs, so +# that it can at least open its stdin/stdout/stderr filedescriptors. define ROOTFS_CPIO_ADD_INIT if [ ! -e $(TARGET_DIR)/init ]; then \ $(INSTALL) -m 0755 fs/cpio/init $(TARGET_DIR)/init; \ fi + mknod -m 0622 $(TARGET_DIR)/dev/console c 5 1 endef -PACKAGES_PERMISSIONS_TABLE += /dev/console c 622 0 0 5 1 - - -$(sep) - endif # BR2_ROOTFS_DEVICE_CREATION_STATIC ROOTFS_CPIO_PRE_GEN_HOOKS += ROOTFS_CPIO_ADD_INIT From patchwork Sun Jan 14 14:17:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 860441 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@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; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="s2q1A7fN"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zKJV72LR6z9sRW for ; Mon, 15 Jan 2018 01:17:51 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id C3686881B2; Sun, 14 Jan 2018 14:17:48 +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 6ygdU82r5DYI; Sun, 14 Jan 2018 14:17:47 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 6137B88130; Sun, 14 Jan 2018 14:17:47 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 904741C14DD for ; Sun, 14 Jan 2018 14:17:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 8A7F7885B7 for ; Sun, 14 Jan 2018 14:17:43 +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 SdoEdFSffjCa for ; Sun, 14 Jan 2018 14:17:43 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by whitealder.osuosl.org (Postfix) with ESMTPS id B42B48859C for ; Sun, 14 Jan 2018 14:17:42 +0000 (UTC) Received: by mail-wm0-f66.google.com with SMTP id g1so20248558wmg.2 for ; Sun, 14 Jan 2018 06:17:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=YsaHfXni/PKmMCIDjzeQR7NFzcBbmPOx34taqDonFx4=; b=s2q1A7fN6pgGE/vA+TEWUdJ+9mOs/ca0TuEqorRVs0DEIaN9Nuj6xTOMcDRlJ0sTKr EfhLbqr7QhT1ZLPxZckyF4l0gis3kl1rkh3LKQ13EZh40H2PMC/Xd3xnRYW1HpSGx1fE 8tc//TPGPXWvfzKJd1+gtmElV9/mIkCFmKgl40zU1cuVdu04nRu+TWV4OSRr6UhB72AF CigqydfoC9CAw5JO9hy57Eul4IN1Oe5v/6b6OBuTjPJYMQvralGFfO02DYR/HrTqaSJx xpnWWnWTSziUsVZdOzYCrrgPraouOh8swVnxiZFQjtrKNBMQsOt85D4wH2uPt0GzFrWk cBwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=YsaHfXni/PKmMCIDjzeQR7NFzcBbmPOx34taqDonFx4=; b=mcz4Y9NvWHPGndVWWuIrZGgGlIMhSLdV9s5Kj2ZpjPNNqhnKAuzN7YVDoDvMeU855S PR3UxVuaofULFu9hFDUaOLLW3ywIyRUTKKQ2Iwqc65PSuz5qdhWXi5peliwxIxVwmhC6 1FtQ1m+dPWqxS9yr1AbZ/xmBfazqRe+Fd0JWRcxFYtN0uqfBO1NKWdbdeqtG0/VSs1dX 3oKV17FmR71jJbklkusGj206+am9orjwvalb/nVBjsEjzGDqOROU0mjpolrFIY5zPG8e fOPkvwkVB7hHVe+wIMGISKhtqsWM1UcM+/gqyqy9RyfT0kimCXJtp4FoSB9BdoKo4jT1 KbHQ== X-Gm-Message-State: AKwxyteoa57M9Jsg80w/pEJhEEzeW0k9f+/iBXTr7g2xqVkR37FbO7Wv LB/4AEb6V+JlTB8a3nvj+BV5yA== X-Google-Smtp-Source: ACJfBosfullRC37NO5Dv2+iUIH04lb8IxefCZSKNhVhJP5vPfINFLR5nYVoSDneDdZ6WnbdlqUijsg== X-Received: by 10.28.54.221 with SMTP id y90mr7868812wmh.156.1515939461013; Sun, 14 Jan 2018 06:17:41 -0800 (PST) Received: from localhost.localdomain (2a01cb088610730095116638271b1e6e.ipv6.abo.wanadoo.fr. [2a01:cb08:8610:7300:9511:6638:271b:1e6e]) by smtp.gmail.com with ESMTPSA id d63sm3260179wmd.9.2018.01.14.06.17.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Jan 2018 06:17:39 -0800 (PST) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Sun, 14 Jan 2018 15:17:01 +0100 Message-Id: X-Mailer: git-send-email 2.14.1 In-Reply-To: References: Subject: [Buildroot] [PATCH 05/17] fs/iso9660: rename internal variable X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , "Yann E. MORIN" MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" We're soon to introduce a generic variable with that name, i.e. $(FS_NAME)_TARGET_DIR, so our internal, temporary variable would clash with it. Just rename it. Signed-off-by: "Yann E. MORIN" Cc: Thomas Petazzoni Cc: Arnout Vandecappelle --- fs/iso9660/iso9660.mk | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk index 207c6aa39f..b33cf4cd8a 100644 --- a/fs/iso9660/iso9660.mk +++ b/fs/iso9660/iso9660.mk @@ -35,47 +35,47 @@ ROOTFS_ISO9660_USE_INITRD = YES endif ifeq ($(ROOTFS_ISO9660_USE_INITRD),YES) -ROOTFS_ISO9660_TARGET_DIR = $(FS_DIR)/rootfs.iso9660.tmp +ROOTFS_ISO9660_TMP_TARGET_DIR = $(FS_DIR)/rootfs.iso9660.tmp define ROOTFS_ISO9660_CREATE_TEMPDIR - $(RM) -rf $(ROOTFS_ISO9660_TARGET_DIR) - mkdir -p $(ROOTFS_ISO9660_TARGET_DIR) + $(RM) -rf $(ROOTFS_ISO9660_TMP_TARGET_DIR) + mkdir -p $(ROOTFS_ISO9660_TMP_TARGET_DIR) endef ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_CREATE_TEMPDIR else ifeq ($(BR2_TARGET_ROOTFS_ISO9660_TRANSPARENT_COMPRESSION),y) ROOTFS_ISO9660_DEPENDENCIES += host-zisofs-tools -ROOTFS_ISO9660_TARGET_DIR = $(FS_DIR)/rootfs.iso9660.tmp +ROOTFS_ISO9660_TMP_TARGET_DIR = $(FS_DIR)/rootfs.iso9660.tmp # This must be early, before we copy the bootloader files. define ROOTFS_ISO9660_MKZFTREE - $(RM) -rf $(ROOTFS_ISO9660_TARGET_DIR) + $(RM) -rf $(ROOTFS_ISO9660_TMP_TARGET_DIR) $(HOST_DIR)/bin/mkzftree -X -z 9 -p $(PARALLEL_JOBS) \ $(TARGET_DIR) \ - $(ROOTFS_ISO9660_TARGET_DIR) + $(ROOTFS_ISO9660_TMP_TARGET_DIR) endef ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_MKZFTREE ROOTFS_ISO9660_GENISOIMAGE_OPTS += -z else -ROOTFS_ISO9660_TARGET_DIR = $(TARGET_DIR) +ROOTFS_ISO9660_TMP_TARGET_DIR = $(TARGET_DIR) endif ifeq ($(BR2_TARGET_ROOTFS_ISO9660_GRUB2),y) ROOTFS_ISO9660_DEPENDENCIES += grub2 ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH = \ - $(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/grub.cfg + $(ROOTFS_ISO9660_TMP_TARGET_DIR)/boot/grub/grub.cfg ROOTFS_ISO9660_BOOT_IMAGE = boot/grub/grub-eltorito.img define ROOTFS_ISO9660_INSTALL_BOOTLOADER $(INSTALL) -D -m 0644 $(BINARIES_DIR)/grub-eltorito.img \ - $(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/grub-eltorito.img + $(ROOTFS_ISO9660_TMP_TARGET_DIR)/boot/grub/grub-eltorito.img endef else ifeq ($(BR2_TARGET_ROOTFS_ISO9660_ISOLINUX),y) ROOTFS_ISO9660_DEPENDENCIES += syslinux ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH = \ - $(ROOTFS_ISO9660_TARGET_DIR)/isolinux/isolinux.cfg + $(ROOTFS_ISO9660_TMP_TARGET_DIR)/isolinux/isolinux.cfg ROOTFS_ISO9660_BOOT_IMAGE = isolinux/isolinux.bin define ROOTFS_ISO9660_INSTALL_BOOTLOADER $(INSTALL) -D -m 0644 $(BINARIES_DIR)/syslinux/* \ - $(ROOTFS_ISO9660_TARGET_DIR)/isolinux/ + $(ROOTFS_ISO9660_TMP_TARGET_DIR)/isolinux/ $(INSTALL) -D -m 0644 $(HOST_DIR)/share/syslinux/ldlinux.c32 \ - $(ROOTFS_ISO9660_TARGET_DIR)/isolinux/ldlinux.c32 + $(ROOTFS_ISO9660_TMP_TARGET_DIR)/isolinux/ldlinux.c32 endef endif @@ -96,7 +96,7 @@ endef # Copy the kernel to temporary filesystem define ROOTFS_ISO9660_COPY_KERNEL $(INSTALL) -D -m 0644 $(LINUX_IMAGE_PATH) \ - $(ROOTFS_ISO9660_TARGET_DIR)/boot/$(LINUX_IMAGE_NAME) + $(ROOTFS_ISO9660_TMP_TARGET_DIR)/boot/$(LINUX_IMAGE_NAME) endef ifeq ($(ROOTFS_ISO9660_USE_INITRD),YES) @@ -111,7 +111,7 @@ else ROOTFS_ISO9660_DEPENDENCIES += rootfs-cpio define ROOTFS_ISO9660_COPY_INITRD $(INSTALL) -D -m 0644 $(BINARIES_DIR)/rootfs.cpio$(ROOTFS_CPIO_COMPRESS_EXT) \ - $(ROOTFS_ISO9660_TARGET_DIR)/boot/initrd + $(ROOTFS_ISO9660_TMP_TARGET_DIR)/boot/initrd $(SED) "s%__INITRD_PATH__%/boot/initrd%" \ $(ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH) endef @@ -133,7 +133,7 @@ define ROOTFS_ISO9660_CMD $(HOST_DIR)/bin/genisoimage -J -R -b $(ROOTFS_ISO9660_BOOT_IMAGE) \ -no-emul-boot -boot-load-size 4 -boot-info-table \ $(ROOTFS_ISO9660_GENISOIMAGE_OPTS) \ - -o $@ $(ROOTFS_ISO9660_TARGET_DIR) + -o $@ $(ROOTFS_ISO9660_TMP_TARGET_DIR) endef ifeq ($(BR2_TARGET_ROOTFS_ISO9660_HYBRID),y) From patchwork Sun Jan 14 14:17:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 860443 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@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; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="uaLZmLvL"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zKJV94YFNz9sRW for ; Mon, 15 Jan 2018 01:17:53 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id B16818819A; Sun, 14 Jan 2018 14:17:50 +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 IagFXWtAknWB; Sun, 14 Jan 2018 14:17:49 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 3DCD6881C7; Sun, 14 Jan 2018 14:17:49 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 93AD91C14DD for ; Sun, 14 Jan 2018 14:17:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 8856F87A86 for ; Sun, 14 Jan 2018 14:17:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WPo8ec0_Mtr3 for ; Sun, 14 Jan 2018 14:17:44 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 4D03287A62 for ; Sun, 14 Jan 2018 14:17:44 +0000 (UTC) Received: by mail-wm0-f66.google.com with SMTP id t74so1506476wme.3 for ; Sun, 14 Jan 2018 06:17:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=rHb4OgBjbaGqihWrl8sYG0LM7b2KX4J8/Xyj1MaJLwc=; b=uaLZmLvLaWQX9WbvXAyE67csoMgNoUtxbUluv3SCA/XdMIVTiMs+zFGZ7IOkEAwjfw frHEF1jmmqGxIeQFyAFcwPlgnJlxaPbDpSdT/eb4qGo9S14FuMoFwuJ8qagSrvO16pyW P5TBtr3X3+EguPptjQZ+N93sxJeoRgFPl1Gcii1dZwfLWCXjKz5Rrhvx/IoftD0tKKTt XnOX7vZ5+yF2gTV+zwwX/WdNnNHN/AY5OPEjCGrFBQE61ycxK86bG2Opddp5rCMDUY/2 jSfeyQE2HGTpgHKxSVdfwoin6TZmKcrZJmza3Uu/kbCFu2A7KzynvcgwGnGyhdrCHmnc j0qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=rHb4OgBjbaGqihWrl8sYG0LM7b2KX4J8/Xyj1MaJLwc=; b=FTOWaNIf+b++mgA+YEZRAq/+TidMy4WvQ3MF6JImWgncU9iehnGr/vlNI7+K3w5lTZ 5JwVA3GaJIXC1BloqliHl6GaWwO1w3m38/x0mhHUfsDJL0eRDHiRp6qirwFZbrXdxKvt t/DKe6yveIps2IMnulzkPaPR6apr63GQYV4eEkbSsleDLtYZq0M5safj7APuaAdFPgrL LvhmZRxq886yUgJKBfkTBvA99QhHwP57GIu/f7YS2dH//3eLI369CdxXw45EvrvzetxS id74a75KITuD4EvGmo+0TLcjEx9ptURwPtbGDKMEGAEXlQGkR9Ta5AiG3yfqCOR4xyho lVTQ== X-Gm-Message-State: AKwxyte8apH/mxxugw+xDGMToYZLzJyeAYiPVKAdLTB/FRKcie7At78Y 7r+ZBDRZ/MnJLZnaIvx+u57Llw== X-Google-Smtp-Source: ACJfBosb6HpiBzmf/1FTIqsUpsEw3uhxHKsZL1Ufhwkw9dcXzdBeCs9K6fsleBQEmnwFxQbv2jm27A== X-Received: by 10.28.125.19 with SMTP id y19mr7815099wmc.101.1515939462532; Sun, 14 Jan 2018 06:17:42 -0800 (PST) Received: from localhost.localdomain (2a01cb088610730095116638271b1e6e.ipv6.abo.wanadoo.fr. [2a01:cb08:8610:7300:9511:6638:271b:1e6e]) by smtp.gmail.com with ESMTPSA id d63sm3260179wmd.9.2018.01.14.06.17.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Jan 2018 06:17:41 -0800 (PST) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Sun, 14 Jan 2018 15:17:02 +0100 Message-Id: <995c1387d0b9a5083d8caaacc8d7e03e93e11c9c.1515939400.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 2.14.1 In-Reply-To: References: Subject: [Buildroot] [PATCH 06/17] core: introduce intermediate BASE_TARGET_DIR variable X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , "Yann E. MORIN" MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This new BASE_TARGET_DIR variable is set in stone to point to the real location where packages will be installed. Its name is modelled after its definition: it is located in $(BASE_DIR), and it is named 'target/', hence BASE_TARGET_DIR. The already-existing TARGET_DIR variable now simply points to the same location, except that it is recursively expanded, so that we can later change it depending on the context. All locations that really need to reference the existing target/ directory, are changed to use BASE_TARGET_DIR; surprinsigly enough, they all seem to be located in the main Makefile. :-) The rest is left with using good-old TARGET_DIR. Signed-off-by: "Yann E. MORIN" Cc: Thomas Petazzoni Cc: Arnout Vandecappelle --- Makefile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 7d8ab51a8c..756a5be7ed 100644 --- a/Makefile +++ b/Makefile @@ -215,7 +215,8 @@ BR_GRAPH_OUT := $(or $(BR2_GRAPH_OUT),pdf) BUILD_DIR := $(BASE_DIR)/build BINARIES_DIR := $(BASE_DIR)/images -TARGET_DIR := $(BASE_DIR)/target +BASE_TARGET_DIR := $(BASE_DIR)/target +TARGET_DIR = $(BASE_TARGET_DIR) # initial definition so that 'make clean' works for most users, even without # .config. HOST_DIR will be overwritten later when .config is included. HOST_DIR := $(BASE_DIR)/host @@ -237,7 +238,7 @@ LEGAL_REPORT = $(LEGAL_INFO_DIR)/README # dependencies anywhere else # ################################################################################ -$(BUILD_DIR) $(TARGET_DIR) $(HOST_DIR) $(BINARIES_DIR) $(LEGAL_INFO_DIR) $(REDIST_SOURCES_DIR_TARGET) $(REDIST_SOURCES_DIR_HOST): +$(BUILD_DIR) $(BASE_TARGET_DIR) $(HOST_DIR) $(BINARIES_DIR) $(LEGAL_INFO_DIR) $(REDIST_SOURCES_DIR_TARGET) $(REDIST_SOURCES_DIR_HOST): @mkdir -p $@ BR2_CONFIG = $(CONFIG_DIR)/.config @@ -444,7 +445,7 @@ BR_PATH = "$(HOST_DIR)/bin:$(HOST_DIR)/sbin:$(PATH)" # Location of a file giving a big fat warning that output/target # should not be used as the root filesystem. -TARGET_DIR_WARNING_FILE = $(TARGET_DIR)/THIS_IS_NOT_YOUR_ROOT_FILESYSTEM +TARGET_DIR_WARNING_FILE = $(BASE_TARGET_DIR)/THIS_IS_NOT_YOUR_ROOT_FILESYSTEM ifeq ($(BR2_CCACHE),y) CCACHE := $(HOST_DIR)/bin/ccache @@ -543,7 +544,7 @@ $(foreach pkg,$(call UPPERCASE,$(PACKAGES)),\ endif .PHONY: dirs -dirs: $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \ +dirs: $(BUILD_DIR) $(STAGING_DIR) $(BASE_TARGET_DIR) \ $(HOST_DIR) $(HOST_DIR)/usr $(HOST_DIR)/lib $(BINARIES_DIR) $(BUILD_DIR)/buildroot-config/auto.conf: $(BR2_CONFIG) @@ -968,7 +969,7 @@ printvars: .PHONY: clean clean: - rm -rf $(TARGET_DIR) $(BINARIES_DIR) $(HOST_DIR) \ + rm -rf $(BASE_TARGET_DIR) $(BINARIES_DIR) $(HOST_DIR) \ $(BUILD_DIR) $(BASE_DIR)/staging \ $(LEGAL_INFO_DIR) $(GRAPHS_DIR) From patchwork Sun Jan 14 14:17:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 860445 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@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; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="mU7Fmmso"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zKJVG62tTz9sRW for ; Mon, 15 Jan 2018 01:17:58 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 74672885D0; Sun, 14 Jan 2018 14:17:54 +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 T0SWU8l7Qih4; Sun, 14 Jan 2018 14:17:52 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 3A9E6885B7; Sun, 14 Jan 2018 14:17:52 +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 7C2401C14DD for ; Sun, 14 Jan 2018 14:17:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 769BE88116 for ; Sun, 14 Jan 2018 14:17:46 +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 1ZtGAHpxwQwF for ; Sun, 14 Jan 2018 14:17:45 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by hemlock.osuosl.org (Postfix) with ESMTPS id A15F188130 for ; Sun, 14 Jan 2018 14:17:45 +0000 (UTC) Received: by mail-wm0-f68.google.com with SMTP id x4so8902417wmc.0 for ; Sun, 14 Jan 2018 06:17:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=3NCzVyRkgsibxFmV7uDnRqjp7ez49wg6Lzfodu7eScY=; b=mU7FmmsomfZQp4wmAvY2go5/t/Plqf76QLnOsb8GmiScEmRaV2ckingweyuNS3mQlr zyQSHgOj89Imm8QGDz2p84XTc2WfVQZlkXvXUB1eV+YStnFP8s7C/8cHteovaJ1mk0s5 5M1QVKTmcOL+5tqa+C5wUhUM4BiM6Ybx4iIGmD2qlnHNVK8PERz+9GnXS3j9UjvsA7rf KIQVVZYFoW1X71BGBbIfTkqogr6tIDWXbGJhuCc1FyHHiz517+42F+s3IXS/G+p/KYsx 9H+irzos3b24o2wjldDX3+3yqfn4+HxzfPUFAj9+R0E7ewg/EeZOjnh2QTfHUK7A96tV 6AtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=3NCzVyRkgsibxFmV7uDnRqjp7ez49wg6Lzfodu7eScY=; b=eWZwZv5CSz6YqFa1TW2s9ukkHxnI0HG3LwHfxTNP236akLIQ9cWQ+/iwgLy0SWeITv X5uh6KCi34VkiVGExx2InJJ3v/gVigHwZPC/9ies6T5xIP5FCsbETT3R5lImqvtOyCLb qRO1grz+HzGg4DNfvGDwtG/LnDfos+YMpxPs7MPkg+ZEcUt9RA/nXwsIcC0BTOENqZkK C89jU7Q7ZHfytF2pBUyR2fImWZ9eelXf/djQDjHPxjDJTKEO+RkIB3AqrcwO7mfYIswD 1EuVJwnucrndpYDwTADOQK72oz6QcXPVg488WZPNgA1zkQ0/svhbR5CDcuN7EUkHGgpl 2IYA== X-Gm-Message-State: AKwxyteOxIi3CpC8VzHJDJLyP/+TNhPHPhmB7BYFHiKd0rTKMAo6+cQQ 25h0dHgsfD1vV5a4fjtAC/BFlQ== X-Google-Smtp-Source: ACJfBouYolUKEXjWRkSTGItNKy/magbCPi3sTTBx2iTyPT2WrZetJpJZ2luLZ58regglhSYSFc9V7w== X-Received: by 10.28.0.81 with SMTP id 78mr7903729wma.12.1515939463894; Sun, 14 Jan 2018 06:17:43 -0800 (PST) Received: from localhost.localdomain (2a01cb088610730095116638271b1e6e.ipv6.abo.wanadoo.fr. [2a01:cb08:8610:7300:9511:6638:271b:1e6e]) by smtp.gmail.com with ESMTPSA id d63sm3260179wmd.9.2018.01.14.06.17.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Jan 2018 06:17:42 -0800 (PST) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Sun, 14 Jan 2018 15:17:03 +0100 Message-Id: X-Mailer: git-send-email 2.14.1 In-Reply-To: References: Subject: [Buildroot] [PATCH 07/17] fs: set per-rootfs variable name X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , "Yann E. MORIN" MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Like we do for packages with the PKG variable, set ROOTFS to contain the upper-case name of the rootfs currently being generated. This will be usefull in later patches, when we need more per-rootfs variables, like a per-rootfs TARGET_DIR for example. In Makefiles, per-rule variables trickle down the dependency chain, to all dependencies of that rule, so we have to stop ROOTFS as soone as we're not in a rootfs. This means we have to stop it at target-finalize (which is a dependency of all filesystems), and for each package individually, since some packages (host or target) can be direct dependencies of filesystems as well. Signed-off-by: "Yann E. MORIN" Cc: Thomas Petazzoni Cc: Arnout Vandecappelle --- Makefile | 3 +++ fs/common.mk | 3 +++ package/pkg-generic.mk | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/Makefile b/Makefile index 756a5be7ed..88e66766bf 100644 --- a/Makefile +++ b/Makefile @@ -677,6 +677,9 @@ endif $(TARGETS_ROOTFS): target-finalize +# Avoid the rootfs name leaking down the dependency chain +target-finalize: ROOTFS= + .PHONY: target-finalize target-finalize: $(PACKAGES) @$(call MESSAGE,"Finalizing target directory") diff --git a/fs/common.mk b/fs/common.mk index 274a3e9c7b..af6799bb83 100644 --- a/fs/common.mk +++ b/fs/common.mk @@ -39,6 +39,8 @@ ROOTFS_USERS_TABLES = $(call qstrip,$(BR2_ROOTFS_USERS_TABLES)) # all variable references except the arguments must be $$-quoted. define inner-rootfs +ROOTFS_$(2)_NAME = $(1) + # extra deps ROOTFS_$(2)_DEPENDENCIES += host-fakeroot host-makedevs \ $$(if $$(PACKAGES_USERS)$$(ROOTFS_USERS_TABLES),host-mkpasswd) @@ -72,6 +74,7 @@ ROOTFS_$(2)_COMPRESS_EXT = .xz ROOTFS_$(2)_COMPRESS_CMD = xz -9 -C crc32 -c endif +$$(BINARIES_DIR)/rootfs.$(1): ROOTFS=$(2) $$(BINARIES_DIR)/rootfs.$(1): target-finalize $$(ROOTFS_$(2)_DEPENDENCIES) @$$(call MESSAGE,"Generating root filesystem image rootfs.$(1)") rm -rf $(FS_DIR) diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index a2a12e7b56..cb30d29f89 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -410,6 +410,10 @@ endef define inner-generic-package +# When doing a package, we're definitely not doing a rootfs, but we +# may inherit it via the dependency chain, so we reset it. +$(1): ROOTFS= + # Ensure the package is only declared once, i.e. do not accept that a # package be re-defined by a br2-external tree ifneq ($(call strip,$(filter $(1),$(PACKAGES_ALL))),) From patchwork Sun Jan 14 14:17:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 860444 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="lpcTx4yg"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zKJVG2QTwz9sR8 for ; Mon, 15 Jan 2018 01:17:58 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 8D57187A99; Sun, 14 Jan 2018 14:17:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kBx5cJ2t7RIR; Sun, 14 Jan 2018 14:17:53 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 3B43987A1F; Sun, 14 Jan 2018 14:17:53 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id DCA371C14DD for ; Sun, 14 Jan 2018 14:17:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id D7A0C87A5A for ; Sun, 14 Jan 2018 14:17:47 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tUN4W6N5DRi2 for ; Sun, 14 Jan 2018 14:17:47 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 434A187A4B for ; Sun, 14 Jan 2018 14:17:47 +0000 (UTC) Received: by mail-wm0-f68.google.com with SMTP id r78so19991209wme.0 for ; Sun, 14 Jan 2018 06:17:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=fyMxv9fLqmZm4IVYf3w7pHVyJUJXZ5wtqMsi9+MtPKs=; b=lpcTx4ygdlqCWqqagOJNDDTzfjygboJgNOf1tlbkaPZSHapjISRLambf2lKUVYB+Hs gd+WyCBoEl6eyvGAMLRS1xMVKjqcrKGhFrQtXBk2juqOt/VjLwyKONHDNMsxAbg4QdZO N7xDaZNpN3tf5pNPCgKY8jLISZ4aud42R0U5+fkeIDHqx7MQn4LUvXH/GZFJhgrxmcgp NK7k4QNxfi6436mDTF9KEfrth95hhqciOy9yH2+2VqK0Yvp12p5pDCsiU8tToXUVyaSq HQHC/NXOtREEMABlA/pU20Hl649N51uaT4KisQ2GJap3LnZJUpJMps1VPggyUgwfieJJ VXaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=fyMxv9fLqmZm4IVYf3w7pHVyJUJXZ5wtqMsi9+MtPKs=; b=qVnALJF6x30nwQpOHeY6RuXEGugOVgy6ssq4VaE/7HfhVUL+yjf3D902nsA8GwVOgZ v9T6P8prct/D6MXw2fp+cBLn+QjjhD/hlIiRfbHDt5DeAmtdpA22ZYtHxyGCSzwk5M4V MoIEgeHkkuTdR69gyM4XFzsLMvNTKj3PKCghzPKdMjjft68WzngWRHhtu5ijNkjlakiw nxgzstCeQCWBdWMxKKdeEyelSgDvVlfjHuTOMVHW9vmZV/WGBpgeD9jF1Au+MQGpNLGV ojLWXHlXsfHJEvRQp9fpBplcpPlpUf5PTMV9u3Hogi3dj1DK+7zWzj1a0DnS3nEAdMTl KmxA== X-Gm-Message-State: AKwxyteE7KmqqkvEyISc9+Aq41tASuqn729zBuwqwBQMmdtYYkXVN59N omKIDb9d5SjOGg/MiHHbWVn8qA== X-Google-Smtp-Source: ACJfBosGG7fBjgdSShyMHpivJZbTU40Hy/S6r25W44nACNf8KzWWsk7gEYsbxOvlJvyzrq5WLr6+BQ== X-Received: by 10.28.125.68 with SMTP id y65mr7923676wmc.106.1515939465612; Sun, 14 Jan 2018 06:17:45 -0800 (PST) Received: from localhost.localdomain (2a01cb088610730095116638271b1e6e.ipv6.abo.wanadoo.fr. [2a01:cb08:8610:7300:9511:6638:271b:1e6e]) by smtp.gmail.com with ESMTPSA id d63sm3260179wmd.9.2018.01.14.06.17.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Jan 2018 06:17:44 -0800 (PST) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Sun, 14 Jan 2018 15:17:04 +0100 Message-Id: X-Mailer: git-send-email 2.14.1 In-Reply-To: References: Subject: [Buildroot] [PATCH 08/17] fs: define per-rootfs directory X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , "Yann E. MORIN" MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This will serve in future commits to store pre-rootfs files, like fakeroot script... Signed-off-by: "Yann E. MORIN" Cc: Thomas Petazzoni Cc: Arnout Vandecappelle --- fs/common.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/common.mk b/fs/common.mk index af6799bb83..eebe83d6e5 100644 --- a/fs/common.mk +++ b/fs/common.mk @@ -40,6 +40,7 @@ ROOTFS_USERS_TABLES = $(call qstrip,$(BR2_ROOTFS_USERS_TABLES)) define inner-rootfs ROOTFS_$(2)_NAME = $(1) +ROOTFS_$(2)_DIR = $$(FS_DIR)/$(1) # extra deps ROOTFS_$(2)_DEPENDENCIES += host-fakeroot host-makedevs \ From patchwork Sun Jan 14 14:17:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 860447 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="qaTWxBgN"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zKJVK1vkPz9sR8 for ; Mon, 15 Jan 2018 01:18:01 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 5CB6887AB1; Sun, 14 Jan 2018 14:17:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rgovr1kw5lKg; Sun, 14 Jan 2018 14:17:54 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 518EF87A81; Sun, 14 Jan 2018 14:17:54 +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 8300A1C40B6 for ; Sun, 14 Jan 2018 14:17:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 58B6188130 for ; Sun, 14 Jan 2018 14:17:49 +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 mTFxyagGRm6H for ; Sun, 14 Jan 2018 14:17:48 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by hemlock.osuosl.org (Postfix) with ESMTPS id 6E10088197 for ; Sun, 14 Jan 2018 14:17:48 +0000 (UTC) Received: by mail-wm0-f68.google.com with SMTP id g1so20248791wmg.2 for ; Sun, 14 Jan 2018 06:17:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=e5/GWSIoKzy3+3STuKedSofKWYO4GRjyGwX2eevX8ts=; b=qaTWxBgNsgmiU9geOHmQVEfKKqDEoAwvWUvRrLq9nfm3/lOKMo6bqCRJAMQ5iDq2EQ sITdto8YmTlanNhcXBeC/s0jf8N6s92oIOxGNIOlWjVqLU63sXx8sSGZk8Gn9fhU4fv0 rjQCmHk9CmvPMw3fQ29Asjjnu2QBJtQggGujgB0d43h3qoMQDOmgHVodYZuJ65PBXjgV qU75qOSeM5lm1I06ZkI3x3bqBa59mIW0SVWSdl6l7oRRG4u5NoESwkX8D/XR5nfVGSAD lbpFIAbRR2JJDHSJmHyDQBYyokKLYPC6CExd1GG+P3f+DASbrr+2tAX38kw0bDqH08/a 9yhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=e5/GWSIoKzy3+3STuKedSofKWYO4GRjyGwX2eevX8ts=; b=NWIaPjIgEMcepaFAB3114Oei8Xu2d/Bb8CgiqnsLk9PJHoM2Wk/d37qs6jdS3noY7C pLXUZW9/z3Gp2J1RGIvozRIREnSvCfyAGWEnC9SQo/+OOhfGUYsoQSIWSwLJTzY0iCJ6 ppu0ZSsF1hnoMVe7NxOHN3DXhebgNMnFXjG3AHYtpqzUaY094P13Gpu5TblTS24c3Kim V8EIe3OLE5TLgBF6Qy+jmUKp6JXlkVagfxYr5CcYm3b3dPEsYiuxHlaX+3e0oQzPgZX1 oIbfcKH5jpQ6K1TII4E6kUAcUn+S/WvC4XjXx7Tk1aFpzBR10tAz2tayfbi/HTFg8uK+ mjYQ== X-Gm-Message-State: AKwxytdOdaQ0HXqoiihV1xEvTPffPWdNnY5Wk5ybA5OJd2nKQr8mB45R hc/WzPwcUw03M8CFJBvlDm4s9w== X-Google-Smtp-Source: ACJfBoudhc1P9CE5RZ2SK/VZGTuoOBLoywZgH671VLAjOtS4Ihl8fM2Z7sva5CtE/xsJ+Cah2vUWmA== X-Received: by 10.28.245.17 with SMTP id t17mr7807214wmh.30.1515939466806; Sun, 14 Jan 2018 06:17:46 -0800 (PST) Received: from localhost.localdomain (2a01cb088610730095116638271b1e6e.ipv6.abo.wanadoo.fr. [2a01:cb08:8610:7300:9511:6638:271b:1e6e]) by smtp.gmail.com with ESMTPSA id d63sm3260179wmd.9.2018.01.14.06.17.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Jan 2018 06:17:45 -0800 (PST) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Sun, 14 Jan 2018 15:17:05 +0100 Message-Id: <9b2c5cc4fdbad8db999707212af864649a262a1e.1515939400.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 2.14.1 In-Reply-To: References: Subject: [Buildroot] [PATCH 09/17] fs: use a per-rootfs fakeroot script X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , "Yann E. MORIN" MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" ... and locate that script in a per-rootfs directory. Signed-off-by: "Yann E. MORIN" Cc: Thomas Petazzoni Cc: Arnout Vandecappelle --- fs/common.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/common.mk b/fs/common.mk index eebe83d6e5..db4f8c23ad 100644 --- a/fs/common.mk +++ b/fs/common.mk @@ -28,7 +28,6 @@ # macro will automatically generate a compressed filesystem image. FS_DIR = $(BUILD_DIR)/buildroot-fs -FAKEROOT_SCRIPT = $(FS_DIR)/fakeroot.fs FULL_DEVICE_TABLE = $(FS_DIR)/device_table.txt ROOTFS_DEVICE_TABLES = $(call qstrip,$(BR2_ROOTFS_DEVICE_TABLE) \ $(BR2_ROOTFS_STATIC_DEVICE_TABLE)) @@ -76,10 +75,11 @@ ROOTFS_$(2)_COMPRESS_CMD = xz -9 -C crc32 -c endif $$(BINARIES_DIR)/rootfs.$(1): ROOTFS=$(2) +$$(BINARIES_DIR)/rootfs.$(1): FAKEROOT_SCRIPT=$$(ROOTFS_$(2)_DIR)/fakeroot $$(BINARIES_DIR)/rootfs.$(1): target-finalize $$(ROOTFS_$(2)_DEPENDENCIES) @$$(call MESSAGE,"Generating root filesystem image rootfs.$(1)") - rm -rf $(FS_DIR) - mkdir -p $(FS_DIR) + rm -rf $(FS_DIR) $$(ROOTFS_$(2)_DIR) + mkdir -p $(FS_DIR) $$(ROOTFS_$(2)_DIR) echo '#!/bin/sh' > $$(FAKEROOT_SCRIPT) echo "set -e" >> $$(FAKEROOT_SCRIPT) $$(foreach hook,$$(ROOTFS_$(2)_PRE_GEN_HOOKS),\ From patchwork Sun Jan 14 14:17:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 860446 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@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; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="EMFC5vF/"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zKJVH3qcYz9t2f for ; Mon, 15 Jan 2018 01:17:59 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 3359188202; Sun, 14 Jan 2018 14:17:57 +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 13l9XEW4I6iN; Sun, 14 Jan 2018 14:17:56 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id EEEA3881C5; Sun, 14 Jan 2018 14:17:55 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 96C0B1C14DD for ; Sun, 14 Jan 2018 14:17:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 93635885B7 for ; Sun, 14 Jan 2018 14:17:50 +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 Okzj6WsWjLYJ for ; Sun, 14 Jan 2018 14:17:50 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by whitealder.osuosl.org (Postfix) with ESMTPS id DA3178859C for ; Sun, 14 Jan 2018 14:17:49 +0000 (UTC) Received: by mail-wm0-f66.google.com with SMTP id 81so8925427wmb.1 for ; Sun, 14 Jan 2018 06:17:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Ej2lI1gY8Q6QiToMLjnsK7jd9nsj7/mwTn1AL4GlTiU=; b=EMFC5vF/Y9gKsCwAatW0XXgV5DDRW/IjyDMjXOzex0qoI/L7srM3agdZH/P4hiqKZ4 ljoNKjKwLPn7PDvdy6gyd04oWEqFrHjuqmYq3M//+raboVQBUPuxuO1wAYlF7JLv+85m 6OVRUzZs9Dlgk/W3809rDXBmsPz7GKB19dJc4x6hVl4ncLczDz/+SYCxcp82DmQNtqQ4 lncwDbr8GLO74jum/UqrU8uZ2ZAMaBYWYS9j0qlwoJ4RWIurWCkcFayDbL95CljPwIuV Q13UU4H8eH6wFSbFCWr23Tsm8S/g7ZymiwxdgJbuUPFIV4z2Df4MVClLJnuc5B1uiJno /uIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=Ej2lI1gY8Q6QiToMLjnsK7jd9nsj7/mwTn1AL4GlTiU=; b=lTay9GGfLk8QYw7U5Tu90sV+Pa+s0SGn3nrGren+12DcUA14NIUuxHihllxWjtUMPJ dGHV15N6i/09RR3IFKSqT47+EgkyDhc4VrG65YdVgf4fNB2cm9+XSOFR3p2goLD69ufn BLJk9pgtMZfCI2tXFsgjovEJnmoDTpzNAg3sRqV1+Z4mHo7Ehh4XG63NwdrytVdftPtd EciQ1gE7y2pESUaEjs+odWwPWI9AJPbZVLVaVu9qTZRL2VBvPqat6NzH/vY4OLiLDlZ3 ph0d3Ax25DCrpXJ6cXHLCK6onEyp+acD8ITMmcAF04ZNv6E5NubhXbYvYiV0ZoKHN2TO piQg== X-Gm-Message-State: AKwxytdj3+hHcWx37/NiBZOiMgF6obZQYUqp6bVeZRLxrfzFQyL0vSgh dAaa8WhcbQVqlYV02qHSTbC1wg== X-Google-Smtp-Source: ACJfBoulkEOdxHBf5Ui2Q8jv5JI7i8SuAvwSNdCg2To+dBM4Nw1soa6yALggkS+9OA1sVs/jfWBW0A== X-Received: by 10.28.32.15 with SMTP id g15mr7567544wmg.22.1515939468210; Sun, 14 Jan 2018 06:17:48 -0800 (PST) Received: from localhost.localdomain (2a01cb088610730095116638271b1e6e.ipv6.abo.wanadoo.fr. [2a01:cb08:8610:7300:9511:6638:271b:1e6e]) by smtp.gmail.com with ESMTPSA id d63sm3260179wmd.9.2018.01.14.06.17.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Jan 2018 06:17:47 -0800 (PST) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Sun, 14 Jan 2018 15:17:06 +0100 Message-Id: <02515a6d2f1137a0333fc0d27328254f8a109fe8.1515939400.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 2.14.1 In-Reply-To: References: Subject: [Buildroot] [PATCH 10/17] fs: split per-rootfs dependency line X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , "Yann E. MORIN" MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: "Yann E. MORIN" Cc: Thomas Petazzoni Cc: Arnout Vandecappelle --- Note: in its own patch for easier review of a later, bigger patch. --- fs/common.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/common.mk b/fs/common.mk index db4f8c23ad..cd132cdbc7 100644 --- a/fs/common.mk +++ b/fs/common.mk @@ -76,7 +76,8 @@ endif $$(BINARIES_DIR)/rootfs.$(1): ROOTFS=$(2) $$(BINARIES_DIR)/rootfs.$(1): FAKEROOT_SCRIPT=$$(ROOTFS_$(2)_DIR)/fakeroot -$$(BINARIES_DIR)/rootfs.$(1): target-finalize $$(ROOTFS_$(2)_DEPENDENCIES) +$$(BINARIES_DIR)/rootfs.$(1): target-finalize +$$(BINARIES_DIR)/rootfs.$(1): $$(ROOTFS_$(2)_DEPENDENCIES) @$$(call MESSAGE,"Generating root filesystem image rootfs.$(1)") rm -rf $(FS_DIR) $$(ROOTFS_$(2)_DIR) mkdir -p $(FS_DIR) $$(ROOTFS_$(2)_DIR) From patchwork Sun Jan 14 14:17:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 860448 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@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; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="nGBOKPyS"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zKJVL70FWz9sR8 for ; Mon, 15 Jan 2018 01:18:02 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id E1499886E5; Sun, 14 Jan 2018 14:17:59 +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 c0tdTWOzd6y8; Sun, 14 Jan 2018 14:17:58 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id B343F885B7; Sun, 14 Jan 2018 14:17:57 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 2667E1C14DD for ; Sun, 14 Jan 2018 14:17:52 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 1F8C187A1E for ; Sun, 14 Jan 2018 14:17:52 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mQwmMGy9GfIu for ; Sun, 14 Jan 2018 14:17:51 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 3F47D87982 for ; Sun, 14 Jan 2018 14:17:51 +0000 (UTC) Received: by mail-wm0-f66.google.com with SMTP id f140so19798940wmd.2 for ; Sun, 14 Jan 2018 06:17:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=LL/lnmLzxAqWH0aCftXWZi3VjmJ2ovlrfRqHUM5Knno=; b=nGBOKPySAwz2cHYnHZ3kdzt1C1XxxfDpGg906UlE4L0ZG1dPTC49RjDCA+1FwgQVWM j6BRuWMyIVZrMWfq4GKwNoPy2KDs6IIcSqrY2DWSZyQ/KUZxQz8Rr9C1GghBvVrvSJ01 pcjs6RTtSKpRR7OAbVy0umTxgESUtrsSLfFsQqYdAuHtn/LfD6KOCnZmvaKx5OkNk/oE gYteqNkwJSpclWYMJEatUzyNX5xgZ1dW1a1UD84x8HfJNfRpVw1dhPpRnUH+T02d485f R22DdjpmtNBKKDXkaysmSu9gOtinYuVsjgEH2luVZoZ3arFDtUeP2Cn1tnfgU8RreO/K MNWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=LL/lnmLzxAqWH0aCftXWZi3VjmJ2ovlrfRqHUM5Knno=; b=a7gprhFOPndZlf/cBss4lfiO+s6XEt9/lMBAs30YZ3X0KIxTgD9nQKNabOb5lFRqja plMrVEsJYTnI5Toor2TBGw+X4WGSKng4IhfBNX3UF1eUVQzGcftFC7x2UR/sFGBofJfD ohkGMP1yi2olqnqjZMr0ZQ4BPmZtCN9YcDdRYVqyjuqU2bH+FrQ0kL9Av1UGO2CVYRLj fdrJYKorsq3csyMD9hMJly4IIRgZybNLb4t2SI9/dhoq+kyPfmXGMh/gutLbNni/gCrc DYFpvF9U/PpyQuhr1WGkiF2KOFG0SKYyd7MMXbjmQmCUmCESUgCRGJpf9M1fYIF5M2tb 1VPg== X-Gm-Message-State: AKwxytcJ7cwUAJLIP0xeCqNyNc9aTU1C4xSsTakMHGz93/DFq9vNdtIO O+FAnSSmuiflFASRWegnx767BQ== X-Google-Smtp-Source: ACJfBotahFr4/Qov+iLdR3T7mdZftUpW5x1vcJBoVT9+DtOLOMBOkLTK4tDgVZr2syLSR5PoFdeDKg== X-Received: by 10.28.96.86 with SMTP id u83mr7791648wmb.63.1515939469534; Sun, 14 Jan 2018 06:17:49 -0800 (PST) Received: from localhost.localdomain (2a01cb088610730095116638271b1e6e.ipv6.abo.wanadoo.fr. [2a01:cb08:8610:7300:9511:6638:271b:1e6e]) by smtp.gmail.com with ESMTPSA id d63sm3260179wmd.9.2018.01.14.06.17.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Jan 2018 06:17:48 -0800 (PST) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Sun, 14 Jan 2018 15:17:07 +0100 Message-Id: <683e7a9addce215eee05c1684164052ec606283c.1515939400.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 2.14.1 In-Reply-To: References: Subject: [Buildroot] [PATCH 11/17] fs: introduce per-rootfs TARGET_DIR variable X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , "Yann E. MORIN" MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" ... which for now still points to the base target directory, but this is a step forward. Signed-off-by: "Yann E. MORIN" Cc: Thomas Petazzoni Cc: Arnout Vandecappelle --- Makefile | 4 +++- fs/common.mk | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 88e66766bf..85075f12fc 100644 --- a/Makefile +++ b/Makefile @@ -215,8 +215,10 @@ BR_GRAPH_OUT := $(or $(BR2_GRAPH_OUT),pdf) BUILD_DIR := $(BASE_DIR)/build BINARIES_DIR := $(BASE_DIR)/images +# The target directory is common to all packages, +# but there is one that is specific to each filesystem. BASE_TARGET_DIR := $(BASE_DIR)/target -TARGET_DIR = $(BASE_TARGET_DIR) +TARGET_DIR = $(if $(ROOTFS),$(ROOTFS_$(ROOTFS)_TARGET_DIR),$(BASE_TARGET_DIR)) # initial definition so that 'make clean' works for most users, even without # .config. HOST_DIR will be overwritten later when .config is included. HOST_DIR := $(BASE_DIR)/host diff --git a/fs/common.mk b/fs/common.mk index cd132cdbc7..363798bb20 100644 --- a/fs/common.mk +++ b/fs/common.mk @@ -40,6 +40,7 @@ define inner-rootfs ROOTFS_$(2)_NAME = $(1) ROOTFS_$(2)_DIR = $$(FS_DIR)/$(1) +ROOTFS_$(2)_TARGET_DIR = $$(BASE_TARGET_DIR) # extra deps ROOTFS_$(2)_DEPENDENCIES += host-fakeroot host-makedevs \ From patchwork Sun Jan 14 14:17:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 860449 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@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; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="qG0B1xer"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zKJVN6tXRz9sR8 for ; Mon, 15 Jan 2018 01:18:04 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 6601988617; Sun, 14 Jan 2018 14:18:03 +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 2MnDk8h-7WIh; Sun, 14 Jan 2018 14:18:00 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 468948868B; Sun, 14 Jan 2018 14:17:59 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 432221C14DD for ; Sun, 14 Jan 2018 14:17:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 3EC6987A4B for ; Sun, 14 Jan 2018 14:17:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id V7TAmD59OfLK for ; Sun, 14 Jan 2018 14:17:52 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 8E39787982 for ; Sun, 14 Jan 2018 14:17:52 +0000 (UTC) Received: by mail-wr0-f195.google.com with SMTP id z48so9235533wrz.6 for ; Sun, 14 Jan 2018 06:17:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=iKR2ZtjDnHA97CbLWvkp2pW9sCknbxw4RPjih08B1bE=; b=qG0B1xerNZiiUnIAJI7zeyJvG/Dskc5UvZnfYQlHeWDXpy4R20lyCkj+H6XoD+EPJB KyuqK1l3tbdfVQ+FeDKzxitMC8RzpehJpVMy1e2yh3uNDTFpWmnRSp4OAPL5bhYc6+3e vy4Fq68E7Us4ecsl0fGTU6VVgTeiV4uPGVeOC+V01j/i6HtuqqjxnR4J9yqRSG02gclG 6x8ictDkFY1QjciggcvGnxmncqamQMb2Vwikhlxv+KOpN+TFZmLS9f63F7nvF9uiqbSu w4Jxf/aT3yB93LR8pDwq/AyHtBwAOxMHf3s2HSTuctJVEojvShTJHp8/97dVSjFu7Tnw uHlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=iKR2ZtjDnHA97CbLWvkp2pW9sCknbxw4RPjih08B1bE=; b=eWDOKWDIR/tvFSkLA7KOVqzKNkUrUs1rkthOuaLV30HWtjIBEh4SCOFyfNhJwZbBAM 7BOu1Im0wSiWeTvXJACA1VU6kJru+s3EvB3u6ETlv30vmfLAK6VL5sYc3aJqfFiFZP2K BieY3coNMn4svReYNyPAO8AUvf7HZ79+/WBApc8fhR57Gu+s7L/AAXDgmz7GDt1Z8GpA y6RdYmS16CiqtFmctb2VkUFcY92rkWFOEUgW7XdR9gcHYKK+mGtM+HFoa6WsLvyxCPXX aNqkggrz4FB8gPXA31Gqi2qoaxfzeffrQ4+2DydaT3gf8agaHJLjWwHwi1EeGOuWf0yf IhAg== X-Gm-Message-State: AKwxyteNI1lh3qSJc83GESOXdqF7gFXYNP68eBrUcjA1M3wmN2bG9Cjq 3aJKp1kQjSgGGO6iYnBy9K3ESg== X-Google-Smtp-Source: ACJfBotz1aymP6yKD4a8LlJQDnpcUbolzWhUZKRxu4My4gxRRq9Me2VD8o3aI6Rc14i9b57sdGklGw== X-Received: by 10.223.152.103 with SMTP id v94mr19596613wrb.233.1515939470902; Sun, 14 Jan 2018 06:17:50 -0800 (PST) Received: from localhost.localdomain (2a01cb088610730095116638271b1e6e.ipv6.abo.wanadoo.fr. [2a01:cb08:8610:7300:9511:6638:271b:1e6e]) by smtp.gmail.com with ESMTPSA id d63sm3260179wmd.9.2018.01.14.06.17.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Jan 2018 06:17:49 -0800 (PST) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Sun, 14 Jan 2018 15:17:08 +0100 Message-Id: <561feacf4e1aec169b41164f874a2bfa22a5bd38.1515939400.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 2.14.1 In-Reply-To: References: Subject: [Buildroot] [PATCH 12/17] fs: new intermediate rootfs-common to gather common dependencies X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , "Yann E. MORIN" MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Before we can create an intermediate tarball for all filesystems, we nedd to move the common dependencies needed to generate that intermediate tarball, rather than levae those dependencies to each filesystem. So, we introduce rootfs-common, which gathers all those common dependencies. Signed-off-by: "Yann E. MORIN" Cc: Thomas Petazzoni Cc: Arnout Vandecappelle --- fs/common.mk | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/fs/common.mk b/fs/common.mk index 363798bb20..3505a32e5d 100644 --- a/fs/common.mk +++ b/fs/common.mk @@ -34,6 +34,24 @@ ROOTFS_DEVICE_TABLES = $(call qstrip,$(BR2_ROOTFS_DEVICE_TABLE) \ USERS_TABLE = $(FS_DIR)/users_table.txt ROOTFS_USERS_TABLES = $(call qstrip,$(BR2_ROOTFS_USERS_TABLES)) +ROOTFS_COMMON_TAR = $(FS_DIR)/rootfs.common.tar + +.PHONY: rootfs-common +rootfs-common: $(ROOTFS_COMMON_TAR) + +ROOTFS_COMMON_DEPENDENCIES = \ + host-fakeroot host-makedevs \ + $(if $(PACKAGES_USERS)$(ROOTFS_USERS_TABLES),host-mkpasswd) + +.PHONY: $(ROOTFS_COMMON_TAR) +# When doing the common tarball, we're not really doing a rootfs. +$(ROOTFS_COMMON_TAR): ROOTFS= +$(ROOTFS_COMMON_TAR): $(ROOTFS_COMMON_DEPENDENCIES) target-finalize + @: + +rootfs-common-show-depends: + @echo $(ROOTFS_COMMON_DEPENDENCIES) + # Since this function will be called from within an $(eval ...) # all variable references except the arguments must be $$-quoted. define inner-rootfs @@ -42,9 +60,7 @@ ROOTFS_$(2)_NAME = $(1) ROOTFS_$(2)_DIR = $$(FS_DIR)/$(1) ROOTFS_$(2)_TARGET_DIR = $$(BASE_TARGET_DIR) -# extra deps -ROOTFS_$(2)_DEPENDENCIES += host-fakeroot host-makedevs \ - $$(if $$(PACKAGES_USERS)$$(ROOTFS_USERS_TABLES),host-mkpasswd) +ROOTFS_$(2)_DEPENDENCIES += rootfs-common ifeq ($$(BR2_TARGET_ROOTFS_$(2)_GZIP),y) ROOTFS_$(2)_COMPRESS_EXT = .gz @@ -77,7 +93,6 @@ endif $$(BINARIES_DIR)/rootfs.$(1): ROOTFS=$(2) $$(BINARIES_DIR)/rootfs.$(1): FAKEROOT_SCRIPT=$$(ROOTFS_$(2)_DIR)/fakeroot -$$(BINARIES_DIR)/rootfs.$(1): target-finalize $$(BINARIES_DIR)/rootfs.$(1): $$(ROOTFS_$(2)_DEPENDENCIES) @$$(call MESSAGE,"Generating root filesystem image rootfs.$(1)") rm -rf $(FS_DIR) $$(ROOTFS_$(2)_DIR) From patchwork Sun Jan 14 14:17:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 860450 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="GuepSjov"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zKJVP3VlGz9sRW for ; Mon, 15 Jan 2018 01:18:05 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 70F7587A5D; Sun, 14 Jan 2018 14:18:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GRBUPlJXW6hs; Sun, 14 Jan 2018 14:18:01 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id A14A987A4B; Sun, 14 Jan 2018 14:18:01 +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 D596D1C14DD for ; Sun, 14 Jan 2018 14:17:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id CE2FC881C5 for ; Sun, 14 Jan 2018 14:17:54 +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 msNX-TQGdWtV for ; Sun, 14 Jan 2018 14:17:54 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by hemlock.osuosl.org (Postfix) with ESMTPS id 207AF881C0 for ; Sun, 14 Jan 2018 14:17:54 +0000 (UTC) Received: by mail-wr0-f193.google.com with SMTP id z48so9235557wrz.6 for ; Sun, 14 Jan 2018 06:17:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=9g9awONtgA2H+Qav4UEEukStT8S0v18hv5CEVi/O3sc=; b=GuepSjov6yEzyEDkEPgKiLZWrWsKc99o9Xp01g1jEM8845xsEscAzFDuIV/Ma1H3Vt 9KVwlOEouznxRTz0GkTbvGq6jq+088B3etLYuoEJBIQH0on7D6+pXvrEgeSkSo6B+5a3 iHFPP4v8IqbC8XkSBGunhLgHpyy85ad6/obFPlcLJwWBNGbgL67En+T3wBrR1INxN5+w MXhMOzIdRYN4lKqr8dtc9s/NciOewnm6QMDFHiI65wO+fl9uzA8Rfn1Y6LdcvjxaSyDO xGDw8kpakEri7BWBuQI8Joz21WqU/0F3pvbb+ufkg+/Ch8wF/K9hYHt3Ghkia7OZx8re TJ/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=9g9awONtgA2H+Qav4UEEukStT8S0v18hv5CEVi/O3sc=; b=Um9QHTUSQMN7hK5+Z2J8JxYXat32ME1BdWzw2UeZZzk25kPRM5HgNfyX+scV0WmbDY nvZuhDXDcHzLjswn+nCu5hd1Akn8ZcDP8jjFeBCaj1+slx5kRGJrp8Mqnu6CvFsZXkJ6 UBkGtC9krlLcVCISKJf906rP0pzQ8qL1gwR3JrCkMvq8zM7L4innMIuGFK2G5D7LLAHT cvjwLZPxxXH1iG7RRMNnhnKJ9QM02xLztcnbYB9Q6gztOuZolvbJht8hGU/FGIxTj88n i3yBEKSLvWKTzjjWmQ1HrfHjn1IKNpBw8aoHdDpBm5/8gT6OMkBhfi4kwl5M0GrWlWB1 evaw== X-Gm-Message-State: AKwxytc3rWaqEDzwC4MwvPmKbsF6LcHNQO4vUCK+bO6uSbG+v5xA9T2N ekQkhiLPpntYi04wDGU2wPO27g== X-Google-Smtp-Source: ACJfBouFkcxcl6rfr5JjlDsACQpT44zEPpzBPQGlPTSHecS/vaDvGrsf0Ms5K3N96QJMThxRlsAWRQ== X-Received: by 10.223.188.18 with SMTP id s18mr7539459wrg.226.1515939472333; Sun, 14 Jan 2018 06:17:52 -0800 (PST) Received: from localhost.localdomain (2a01cb088610730095116638271b1e6e.ipv6.abo.wanadoo.fr. [2a01:cb08:8610:7300:9511:6638:271b:1e6e]) by smtp.gmail.com with ESMTPSA id d63sm3260179wmd.9.2018.01.14.06.17.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Jan 2018 06:17:51 -0800 (PST) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Sun, 14 Jan 2018 15:17:09 +0100 Message-Id: <16d6be958104462fe31d554b4113b7c0569c6e59.1515939400.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 2.14.1 In-Reply-To: References: Subject: [Buildroot] [PATCH 13/17] fs: introduce a macro for reproducible command X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , "Yann E. MORIN" MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: "Yann E. MORIN" Cc: Thomas Petazzoni Cc: Arnout Vandecappelle --- fs/common.mk | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/fs/common.mk b/fs/common.mk index 3505a32e5d..05ae107192 100644 --- a/fs/common.mk +++ b/fs/common.mk @@ -34,6 +34,12 @@ ROOTFS_DEVICE_TABLES = $(call qstrip,$(BR2_ROOTFS_DEVICE_TABLE) \ USERS_TABLE = $(FS_DIR)/users_table.txt ROOTFS_USERS_TABLES = $(call qstrip,$(BR2_ROOTFS_USERS_TABLES)) +ifeq ($(BR2_REPRODUCIBLE),y) +define ROOTFS_REPRODUCIBLE + find $(TARGET_DIR) -print0 | xargs -0 -r touch -hd @$(SOURCE_DATE_EPOCH) +endef +endif + ROOTFS_COMMON_TAR = $(FS_DIR)/rootfs.common.tar .PHONY: rootfs-common @@ -120,9 +126,7 @@ endif echo $$(EXTRA_ENV) $$(s) $$(TARGET_DIR) $$(BR2_ROOTFS_POST_SCRIPT_ARGS) >> $$(FAKEROOT_SCRIPT)$$(sep)) $$(foreach hook,$$(ROOTFS_PRE_CMD_HOOKS),\ $$(call PRINTF,$$($$(hook))) >> $$(FAKEROOT_SCRIPT)$$(sep)) -ifeq ($$(BR2_REPRODUCIBLE),y) - echo "find $$(TARGET_DIR) -print0 | xargs -0 -r touch -hd @$$(SOURCE_DATE_EPOCH)" >> $$(FAKEROOT_SCRIPT) -endif + $$(call PRINTF,$$(ROOTFS_REPRODUCIBLE)) >> $$(FAKEROOT_SCRIPT) $$(call PRINTF,$$(ROOTFS_$(2)_CMD)) >> $$(FAKEROOT_SCRIPT) $$(foreach hook,$$(ROOTFS_POST_CMD_HOOKS),\ $$(call PRINTF,$$($$(hook))) >> $$(FAKEROOT_SCRIPT)$$(sep)) From patchwork Sun Jan 14 14:17:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 860451 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ao/t55ot"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zKJVT6J1Hz9sR8 for ; Mon, 15 Jan 2018 01:18:09 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id F07F587ACA; Sun, 14 Jan 2018 14:18:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xYK-t-Px60V9; Sun, 14 Jan 2018 14:18:03 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id EC1FE87A6F; Sun, 14 Jan 2018 14:18:02 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 25B431C14DD for ; Sun, 14 Jan 2018 14:17:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 21AA687AC3 for ; Sun, 14 Jan 2018 14:17:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CE9TUkOhvy1r for ; Sun, 14 Jan 2018 14:17:56 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by fraxinus.osuosl.org (Postfix) with ESMTPS id BA13D87AAB for ; Sun, 14 Jan 2018 14:17:55 +0000 (UTC) Received: by mail-wr0-f195.google.com with SMTP id o7so9232864wro.8 for ; Sun, 14 Jan 2018 06:17:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=NzdYVBbr82UVjoyOIEzY2botVh8lFWIAqsvryHtkwr8=; b=ao/t55otk5R6Ctw8/PJ7uQSSxyqEMc0lGbBHKDmt2M5mgDsL8f2nSYR4qJ4a40bcJP sBZtV9ilpe8VUQDX0//T81SGvDH3GshGDaAej0DM5TKTL0/Hp3XWJLvdgoNEnFKgkk3R IhnQqErrahlmlT/ZyotkRlIOJvK/E6g90gOivmLo4GhM7MFdiKqPD11Baskfn4IXIJL8 Nkx4nw/PqunEwtoqVDV1NtcT9lwfQ7rrebjJf+85hzWQcuEJUc8dhJuYoOKRGFitXeG2 sSejmT+b1Y0sO4b2pNgLrwcvTe7hMjRsb38t4HjeRCQ/r+Ga7nYAO/cMNs15L3ekrob/ gL2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=NzdYVBbr82UVjoyOIEzY2botVh8lFWIAqsvryHtkwr8=; b=T4NPqNN5W+KZkMu0rDc4pqriigPMrFUkFJfpRypk8WOmxtxM1GdRsL2QLhKog/Hgs9 5J4RO22hkUYqvRilDE7cSY951VWyTPaCj0RQPagZfpebCYPjcg3se7zmb6fccpsfBBxE T6Rb44x6u1p+VkyzTAl9ZFbfcArQunoJ1012AI4uTM2JL5ojQtmawjdx6uRBeMtEsmiW d3t5X410x5BWoEc7hfhX4mBvCeRTUvRvQlOzix6xWeOA15Ia7tJtC+1IReVeNWWHWRNG KC7mEehOrylXLeYbm9/fmhoHchOy69LEWfsEwB14WR8V2X2uphfu0mX+A8qe7Rqz3GRy 6SBg== X-Gm-Message-State: AKGB3mL6D8f98ty5CDBRkeAPgtA7WiHFeBWEsmxwx2vUndk/7UAzWMAM 0M+O1w+WSR1+3ncFOPkqnQmiww== X-Google-Smtp-Source: ACJfBouEbrC4rBeXysInir9MYXno3fwA0tt36+mxWJYYekae997VqiIZG67CIKPe3sa5zOZrjSDnTw== X-Received: by 10.223.145.41 with SMTP id j38mr27506249wrj.247.1515939473915; Sun, 14 Jan 2018 06:17:53 -0800 (PST) Received: from localhost.localdomain (2a01cb088610730095116638271b1e6e.ipv6.abo.wanadoo.fr. [2a01:cb08:8610:7300:9511:6638:271b:1e6e]) by smtp.gmail.com with ESMTPSA id d63sm3260179wmd.9.2018.01.14.06.17.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Jan 2018 06:17:52 -0800 (PST) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Sun, 14 Jan 2018 15:17:10 +0100 Message-Id: <067764c556a34c75de7097f0d0a9b4f1eb6c2c31.1515939400.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 2.14.1 In-Reply-To: References: Subject: [Buildroot] [PATCH 14/17] fs: use a common tarball as base for the other filesystems X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , "Yann E. MORIN" MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Currently, some filesystems may want to tweak the content of the target directory, create special device nodes etc... This all means that: - the content of the target directory for a specific filesystems may depend on whether another filesystem is enabled or not; for example, cpio will create a /init script or symlink and a /dev/console node; - the filesysems can not be built in parallel, because they may change the content of the target directory wil another is being assembled. Furthermore, the same fakeroot script is executed over-and-over-again for each filesystem, to create the device nodes, the users and their homes and files, and setting permissions... We introduce an intermediate tarball, for which we do the full fakeroot shebang. That tarball then serves as the base for the other filesystems, with a very simple fakeroot script that untars the common tarball, and calls the actual filesystem image generator on that. Note that we use a very simple tar command to generate the intermediate tarball, because we are not concerned with reproducibility of the archive itself (only of the archived files). Signed-off-by: "Yann E. MORIN" Cc: Thomas Petazzoni Cc: Arnout Vandecappelle --- fs/common.mk | 75 +++++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 47 insertions(+), 28 deletions(-) diff --git a/fs/common.mk b/fs/common.mk index 05ae107192..f3d42519f6 100644 --- a/fs/common.mk +++ b/fs/common.mk @@ -42,6 +42,19 @@ endif ROOTFS_COMMON_TAR = $(FS_DIR)/rootfs.common.tar +# Command to create the common tarball from the base target directory. +define ROOTFS_COMMON_TAR_CMD + tar cf $(ROOTFS_COMMON_TAR) --numeric-owner \ + --exclude=$(notdir $(TARGET_DIR_WARNING_FILE)) \ + -C $(TARGET_DIR) . +endef + +# Command to extract the common tarball into the per-rootfs target directory +define ROOTFS_COMMON_UNTAR_CMD + mkdir -p $(TARGET_DIR) + tar xf $(ROOTFS_COMMON_TAR) -C $(TARGET_DIR) +endef + .PHONY: rootfs-common rootfs-common: $(ROOTFS_COMMON_TAR) @@ -49,11 +62,39 @@ ROOTFS_COMMON_DEPENDENCIES = \ host-fakeroot host-makedevs \ $(if $(PACKAGES_USERS)$(ROOTFS_USERS_TABLES),host-mkpasswd) -.PHONY: $(ROOTFS_COMMON_TAR) # When doing the common tarball, we're not really doing a rootfs. $(ROOTFS_COMMON_TAR): ROOTFS= +$(ROOTFS_COMMON_TAR): FAKEROOT_SCRIPT=$(FS_DIR)/fakeroot.fs $(ROOTFS_COMMON_TAR): $(ROOTFS_COMMON_DEPENDENCIES) target-finalize - @: + @$(call MESSAGE,"Generating common rootfs tarball") + rm -rf $(FS_DIR) + mkdir -p $(FS_DIR) + echo '#!/bin/sh' > $(FAKEROOT_SCRIPT) + echo "set -e" >> $(FAKEROOT_SCRIPT) + echo "chown -h -R 0:0 $(TARGET_DIR)" >> $(FAKEROOT_SCRIPT) +ifneq ($(ROOTFS_USERS_TABLES),) + cat $(ROOTFS_USERS_TABLES) >> $(USERS_TABLE) +endif + $(call PRINTF,$(PACKAGES_USERS)) >> $(USERS_TABLE) + PATH=$(BR_PATH) $(TOPDIR)/support/scripts/mkusers $(USERS_TABLE) $(TARGET_DIR) >> $(FAKEROOT_SCRIPT) +ifneq ($(ROOTFS_DEVICE_TABLES),) + cat $(ROOTFS_DEVICE_TABLES) > $(FULL_DEVICE_TABLE) +ifeq ($(BR2_ROOTFS_DEVICE_CREATION_STATIC),y) + $(call PRINTF,$(PACKAGES_DEVICES_TABLE)) >> $(FULL_DEVICE_TABLE) +endif +endif + $(call PRINTF,$(PACKAGES_PERMISSIONS_TABLE)) >> $(FULL_DEVICE_TABLE) + echo "$(HOST_DIR)/bin/makedevs -d $(FULL_DEVICE_TABLE) $(TARGET_DIR)" >> $(FAKEROOT_SCRIPT) + $(foreach s,$(call qstrip,$(BR2_ROOTFS_POST_FAKEROOT_SCRIPT)),\ + echo "echo '$(TERM_BOLD)>>> Executing fakeroot script $(s)$(TERM_RESET)'" >> $(FAKEROOT_SCRIPT); \ + echo $(EXTRA_ENV) $(s) $(TARGET_DIR) $(BR2_ROOTFS_POST_SCRIPT_ARGS) >> $(FAKEROOT_SCRIPT)$(sep)) + $(foreach hook,$(ROOTFS_PRE_CMD_HOOKS),\ + $(call PRINTF,$($(hook))) >> $(FAKEROOT_SCRIPT)$(sep)) + $(call PRINTF,$(ROOTFS_COMMON_TAR_CMD)) >> $(FAKEROOT_SCRIPT) + $(foreach hook,$(ROOTFS_POST_CMD_HOOKS),\ + $(call PRINTF,$($(hook))) >> $(FAKEROOT_SCRIPT)$(sep)) + chmod a+x $(FAKEROOT_SCRIPT) + PATH=$(BR_PATH) $(HOST_DIR)/bin/fakeroot -- $(FAKEROOT_SCRIPT) rootfs-common-show-depends: @echo $(ROOTFS_COMMON_DEPENDENCIES) @@ -64,7 +105,7 @@ define inner-rootfs ROOTFS_$(2)_NAME = $(1) ROOTFS_$(2)_DIR = $$(FS_DIR)/$(1) -ROOTFS_$(2)_TARGET_DIR = $$(BASE_TARGET_DIR) +ROOTFS_$(2)_TARGET_DIR = $$(ROOTFS_$(2)_DIR)/target ROOTFS_$(2)_DEPENDENCIES += rootfs-common @@ -101,39 +142,17 @@ $$(BINARIES_DIR)/rootfs.$(1): ROOTFS=$(2) $$(BINARIES_DIR)/rootfs.$(1): FAKEROOT_SCRIPT=$$(ROOTFS_$(2)_DIR)/fakeroot $$(BINARIES_DIR)/rootfs.$(1): $$(ROOTFS_$(2)_DEPENDENCIES) @$$(call MESSAGE,"Generating root filesystem image rootfs.$(1)") - rm -rf $(FS_DIR) $$(ROOTFS_$(2)_DIR) - mkdir -p $(FS_DIR) $$(ROOTFS_$(2)_DIR) + rm -rf $$(ROOTFS_$(2)_DIR) + mkdir -p $$(ROOTFS_$(2)_DIR) echo '#!/bin/sh' > $$(FAKEROOT_SCRIPT) echo "set -e" >> $$(FAKEROOT_SCRIPT) + $$(call PRINTF,$$(ROOTFS_COMMON_UNTAR_CMD)) >> $$(FAKEROOT_SCRIPT) $$(foreach hook,$$(ROOTFS_$(2)_PRE_GEN_HOOKS),\ $$(call PRINTF,$$($$(hook))) >> $$(FAKEROOT_SCRIPT)$$(sep)) - echo "chown -h -R 0:0 $$(TARGET_DIR)" >> $$(FAKEROOT_SCRIPT) -ifneq ($$(ROOTFS_USERS_TABLES),) - cat $$(ROOTFS_USERS_TABLES) >> $$(USERS_TABLE) -endif - $$(call PRINTF,$$(PACKAGES_USERS)) >> $$(USERS_TABLE) - PATH=$$(BR_PATH) $$(TOPDIR)/support/scripts/mkusers $$(USERS_TABLE) $$(TARGET_DIR) >> $$(FAKEROOT_SCRIPT) -ifneq ($$(ROOTFS_DEVICE_TABLES),) - cat $$(ROOTFS_DEVICE_TABLES) > $$(FULL_DEVICE_TABLE) -ifeq ($$(BR2_ROOTFS_DEVICE_CREATION_STATIC),y) - $$(call PRINTF,$$(PACKAGES_DEVICES_TABLE)) >> $$(FULL_DEVICE_TABLE) -endif -endif - $$(call PRINTF,$$(PACKAGES_PERMISSIONS_TABLE)) >> $$(FULL_DEVICE_TABLE) - echo "$$(HOST_DIR)/bin/makedevs -d $$(FULL_DEVICE_TABLE) $$(TARGET_DIR)" >> $$(FAKEROOT_SCRIPT) - $$(foreach s,$$(call qstrip,$$(BR2_ROOTFS_POST_FAKEROOT_SCRIPT)),\ - echo "echo '$$(TERM_BOLD)>>> Executing fakeroot script $$(s)$$(TERM_RESET)'" >> $$(FAKEROOT_SCRIPT); \ - echo $$(EXTRA_ENV) $$(s) $$(TARGET_DIR) $$(BR2_ROOTFS_POST_SCRIPT_ARGS) >> $$(FAKEROOT_SCRIPT)$$(sep)) - $$(foreach hook,$$(ROOTFS_PRE_CMD_HOOKS),\ - $$(call PRINTF,$$($$(hook))) >> $$(FAKEROOT_SCRIPT)$$(sep)) $$(call PRINTF,$$(ROOTFS_REPRODUCIBLE)) >> $$(FAKEROOT_SCRIPT) $$(call PRINTF,$$(ROOTFS_$(2)_CMD)) >> $$(FAKEROOT_SCRIPT) - $$(foreach hook,$$(ROOTFS_POST_CMD_HOOKS),\ - $$(call PRINTF,$$($$(hook))) >> $$(FAKEROOT_SCRIPT)$$(sep)) chmod a+x $$(FAKEROOT_SCRIPT) - rm -f $$(TARGET_DIR_WARNING_FILE) PATH=$$(BR_PATH) $$(HOST_DIR)/bin/fakeroot -- $$(FAKEROOT_SCRIPT) - $$(INSTALL) -m 0644 support/misc/target-dir-warning.txt $$(TARGET_DIR_WARNING_FILE) ifneq ($$(ROOTFS_$(2)_COMPRESS_CMD),) PATH=$$(BR_PATH) $$(ROOTFS_$(2)_COMPRESS_CMD) $$@ > $$@$$(ROOTFS_$(2)_COMPRESS_EXT) endif From patchwork Sun Jan 14 14:17:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 860453 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="eQJ5Tew0"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zKJVX28LFz9sR8 for ; Mon, 15 Jan 2018 01:18:12 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id E8C4D87AD0; Sun, 14 Jan 2018 14:18:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id D-6M851XBEx4; Sun, 14 Jan 2018 14:18:04 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 6D9DB87A5E; Sun, 14 Jan 2018 14:18:04 +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 6F8531C14DD for ; Sun, 14 Jan 2018 14:17:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 42AE888207 for ; Sun, 14 Jan 2018 14:17:58 +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 zGB0avmGYLSH for ; Sun, 14 Jan 2018 14:17:57 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f45.google.com (mail-wm0-f45.google.com [74.125.82.45]) by hemlock.osuosl.org (Postfix) with ESMTPS id 227FB881C0 for ; Sun, 14 Jan 2018 14:17:57 +0000 (UTC) Received: by mail-wm0-f45.google.com with SMTP id f140so19799185wmd.2 for ; Sun, 14 Jan 2018 06:17:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=RZZ8lsIv1OF1y1NaHLANnfbNqB+tA/dBudv1wGYRJFg=; b=eQJ5Tew0LZ4DmqjulUJqPX1EQ1uPAy95nQKtMx4grLao0N3AqOk3/li/jDJGebv5kf s4A2whE81CZHXrTTE6/odtaL3e26A1r3qcI5OmIYJbjlY2v0THKPu3rTJ/KdMVse0Luj G0CAYZ2QMcR0sEwiauECSMcYzw04eQg/59Oe/+wgbUI8L3Dpwj6Oivg/2p6zCACtENNX BNHAB/eQFmwnaq5JInejBBy3FtZUvucVPZV8jLo2WQ90m0JnylT2wAnxxsPZum3rgvUP S5GYgax4XBN9qYx2akMDn7LmV8rq+ixQbz/n9Rsx++0pW5y6rXu0rsHqnBCmql0eLyoV iQNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=RZZ8lsIv1OF1y1NaHLANnfbNqB+tA/dBudv1wGYRJFg=; b=um9kA/cw3duzvmyOIyV3OkjMJRS8g4TJQFy485mB85nY+xp6rHZpvcNz9u0XsJCBn/ 8r8tKzbCsfcEz4wHPQXpwz1Yd92UhhHyRGyjTpHPyvMp7adPPIwdCGU9DmKco1ZCvzqS gbbWLP0W1BcHZxIcdXqaHkK8pv7qTfGGueTmSvsuHhk1B5b8Dupx3PXzfRnildHkIO1g zVd2M7G+Nzv6RrrZ/YpvlAVn7i8N67/Qr/JOagOyGKN8kuDZGQ1qOtlFDv9K9OcCLl2V OIMGzCfuv7nIDcM5OS2JqML58JoB6aeOkKHB+KUqwpQ6kmFxv99t+XVGlqrC5mTf25ct mjgw== X-Gm-Message-State: AKwxytcagGPu66MCRGlYhQxXI2iv4B5Cy/YfPLmXqaG1LpZvyCIFMMaf KUY7bqD23s34Fma+1fORZbu0mA== X-Google-Smtp-Source: ACJfBouluB1R2JPIiKYtoQeEXtZe0Hi3jcvgxeLwPkHa0wDi1kTPedBgS4RSvAMbcaFKasNmtWnmQw== X-Received: by 10.28.135.142 with SMTP id j136mr7598912wmd.132.1515939475410; Sun, 14 Jan 2018 06:17:55 -0800 (PST) Received: from localhost.localdomain (2a01cb088610730095116638271b1e6e.ipv6.abo.wanadoo.fr. [2a01:cb08:8610:7300:9511:6638:271b:1e6e]) by smtp.gmail.com with ESMTPSA id d63sm3260179wmd.9.2018.01.14.06.17.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Jan 2018 06:17:54 -0800 (PST) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Sun, 14 Jan 2018 15:17:11 +0100 Message-Id: <5e2351c0305eb06166dfa18a93f859588c293a3e.1515939400.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 2.14.1 In-Reply-To: References: Subject: [Buildroot] [PATCH 15/17] fs: run packages' filesystem hooks in a copy of target/ X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , "Yann E. MORIN" MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Currently, some packages may regigter hooks to be run just before and judt after the generic tarball image is generated, because they need to prepare the filesystem for read-only or read-write operation. However, this means that, if any of the hooks or the image generation fails, the target directory is left in a dangling, inconsistent state. We fix that by doing a copy of target/, run the hooks on that copy, generate the generic tarball image out of that, and get rid of the copy. This way, we can guarantee consistency of the target directory, and we can even ditch support for post-fs hooks (those that restore target/). Signed-off-by: "Yann E. MORIN" Cc: Thomas Petazzoni Cc: Arnout Vandecappelle --- fs/common.mk | 7 +++++-- support/testing/tests/core/test_post_scripts.py | 23 +++++++++++++---------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/fs/common.mk b/fs/common.mk index f3d42519f6..8bb26f1146 100644 --- a/fs/common.mk +++ b/fs/common.mk @@ -58,17 +58,20 @@ endef .PHONY: rootfs-common rootfs-common: $(ROOTFS_COMMON_TAR) +# Emulate being in a filesystem, so that we can have our own TARGET_DIR. +ROOTFS_COMMON_TARGET_DIR = $(FS_DIR)/target + ROOTFS_COMMON_DEPENDENCIES = \ host-fakeroot host-makedevs \ $(if $(PACKAGES_USERS)$(ROOTFS_USERS_TABLES),host-mkpasswd) -# When doing the common tarball, we're not really doing a rootfs. -$(ROOTFS_COMMON_TAR): ROOTFS= +$(ROOTFS_COMMON_TAR): ROOTFS=COMMON $(ROOTFS_COMMON_TAR): FAKEROOT_SCRIPT=$(FS_DIR)/fakeroot.fs $(ROOTFS_COMMON_TAR): $(ROOTFS_COMMON_DEPENDENCIES) target-finalize @$(call MESSAGE,"Generating common rootfs tarball") rm -rf $(FS_DIR) mkdir -p $(FS_DIR) + rsync -au $(BASE_TARGET_DIR)/ $(TARGET_DIR) echo '#!/bin/sh' > $(FAKEROOT_SCRIPT) echo "set -e" >> $(FAKEROOT_SCRIPT) echo "chown -h -R 0:0 $(TARGET_DIR)" >> $(FAKEROOT_SCRIPT) diff --git a/support/testing/tests/core/test_post_scripts.py b/support/testing/tests/core/test_post_scripts.py index edb339d8c4..a0e5b6b454 100644 --- a/support/testing/tests/core/test_post_scripts.py +++ b/support/testing/tests/core/test_post_scripts.py @@ -18,17 +18,17 @@ class TestPostScripts(infra.basetest.BRTest): infra.filepath("tests/core/post-fakeroot.sh"), infra.filepath("tests/core/post-image.sh")) - def check_post_log_file(self, path, what): + def check_post_log_file(self, f, what, target_dir): lines = {} - with open(path, 'rb') as csvfile: + with open(os.path.join(self.builddir, "build", f), 'rb') as csvfile: r = csv.reader(csvfile, delimiter=',') for row in r: lines[row[0]] = row[1] - self.assertEqual(lines["arg1"], os.path.join(self.builddir, what)) + self.assertEqual(lines["arg1"], what) self.assertEqual(lines["arg2"], "foobar") self.assertEqual(lines["arg3"], "baz") - self.assertEqual(lines["TARGET_DIR"], os.path.join(self.builddir, "target")) + self.assertEqual(lines["TARGET_DIR"], target_dir) self.assertEqual(lines["BUILD_DIR"], os.path.join(self.builddir, "build")) self.assertEqual(lines["HOST_DIR"], os.path.join(self.builddir, "host")) staging = os.readlink(os.path.join(self.builddir, "staging")) @@ -37,9 +37,12 @@ class TestPostScripts(infra.basetest.BRTest): self.assertEqual(lines["BR2_CONFIG"], os.path.join(self.builddir, ".config")) def test_run(self): - f = os.path.join(self.builddir, "build", "post-build.log") - self.check_post_log_file(f, "target") - f = os.path.join(self.builddir, "build", "post-fakeroot.log") - self.check_post_log_file(f, "target") - f = os.path.join(self.builddir, "build", "post-image.log") - self.check_post_log_file(f, "images") + self.check_post_log_file("post-build.log", + os.path.join(self.builddir, "target"), + os.path.join(self.builddir, "target")) + self.check_post_log_file("post-fakeroot.log", + os.path.join(self.builddir, "build/buildroot-fs/target"), + os.path.join(self.builddir, "build/buildroot-fs/target")) + self.check_post_log_file("post-image.log", + os.path.join(self.builddir, "images"), + os.path.join(self.builddir, "target")) From patchwork Sun Jan 14 14:17:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 860454 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="YvJL+Qbv"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zKJVj2lqtz9sR8 for ; Mon, 15 Jan 2018 01:18:21 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 584F687A30; Sun, 14 Jan 2018 14:18:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Vrpn7kJMu6JO; Sun, 14 Jan 2018 14:18:08 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id C909987AC9; Sun, 14 Jan 2018 14:18:05 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 6495D1C14DD for ; Sun, 14 Jan 2018 14:17:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 4766F87A1F for ; Sun, 14 Jan 2018 14:17:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mvUef3vNhKv0 for ; Sun, 14 Jan 2018 14:17:58 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 8D9EB87966 for ; Sun, 14 Jan 2018 14:17:58 +0000 (UTC) Received: by mail-wm0-f66.google.com with SMTP id t74so1507039wme.3 for ; Sun, 14 Jan 2018 06:17:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=1C23ldk/w82Km7+XDRQa5b1O3LhVK3+WpiRd1/W5eqY=; b=YvJL+QbvailQ9iX56DTPlghpYvx3TlemXmUykT+nA3LNLDC5/DkgGVgmXerQY2+Ohq D7MMefEftvaNC4i0TOT/dhHXnCy0c0LPWWZbnCVL57Vq5gpKdz909DqjWcc5s9dX4UVr Movyu6WSdf1x9Dq8O+xK4S58T80TP7Q2nMWWOZuG4k6CJmXfasaglgHzi9U1TjCOp0Uo At41DmrMQI/ld6/3vBk0MypNjQOFozD/pK6y+R+g30gaeeqCwj0Um99gDsBHaijLCfxO x3qPHXSmWY3asphiHCDhSEDwcH+VVjbtxcGxOImc2F8Dm14lciwmPWSJGK1dX4kZSVQL IWBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=1C23ldk/w82Km7+XDRQa5b1O3LhVK3+WpiRd1/W5eqY=; b=qwdxVPv/nznvhy6ioY47fYDXk5i6HPPdnjIRikSwklsXXnxco5+UO6CqECCuJvrvYb 32CpfKKQow1NnpNUfjtfQ1uT0AsXoiPXPE1P5UkDYxeYeQGVXb/xL2C6wGfQfIfn/YAo nU/xwhxViHC+rYy13wqeyOW3btW7m8D0s97F6cbabUokTTRbI0rRqt6/u11Xbz8kCSbV ESlHSyWJnjYGIH0a/xbQm7vVwN2BuzzIdjV1jNaDplfHpQPskKVHjyOE5Uo5x/fPmtlw g0xpX3vaMUwvwrV7XcQrRwvB9XsZ0TG1wYKXybl5VV3gXKrmjlWqj0x69+BKqyA9Rl04 t4tw== X-Gm-Message-State: AKwxytcnu7Qx345RBjEs/MhB3SZxVtoIjHzRJNQ5dRT/oISoDYMHtdvT h1n7G9CwJb/C2C/SZgqqgLJ0Dw== X-Google-Smtp-Source: ACJfBovzD9huxBWRKPsvduMwVnyigHshg3CeWXW1kNKgu0jaH1lbvqTvXL8GdfzUZqA8jIUs04Pmzg== X-Received: by 10.28.14.133 with SMTP id 127mr7575483wmo.152.1515939476838; Sun, 14 Jan 2018 06:17:56 -0800 (PST) Received: from localhost.localdomain (2a01cb088610730095116638271b1e6e.ipv6.abo.wanadoo.fr. [2a01:cb08:8610:7300:9511:6638:271b:1e6e]) by smtp.gmail.com with ESMTPSA id d63sm3260179wmd.9.2018.01.14.06.17.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Jan 2018 06:17:55 -0800 (PST) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Sun, 14 Jan 2018 15:17:12 +0100 Message-Id: <58168436098aca4c262e989c9ccf08e5c079b3bb.1515939400.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 2.14.1 In-Reply-To: References: Subject: [Buildroot] [PATCH 16/17] fs: get rid of package-provided post-fs hooks X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , "Yann E. MORIN" MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Now that the pre-fs ones are run on a transient copy of target/, the post-fs hooks are no longer needed because we no longer need to restore the target/ directory as it is only a internal copy. Remove support for the post-fs hooks, and update the sole package using them. Unlike for the pre-/post-gen hooks, we do not add a legacy check because this was mostly a purely-internal detail that was never really exposed nor documented. Signed-off-by: "Yann E. MORIN" Cc: Thomas Petazzoni Cc: Arnout Vandecappelle --- fs/common.mk | 2 -- package/pkg-generic.mk | 2 -- package/skeleton-init-systemd/skeleton-init-systemd.mk | 6 ------ 3 files changed, 10 deletions(-) diff --git a/fs/common.mk b/fs/common.mk index 8bb26f1146..bacc98ec68 100644 --- a/fs/common.mk +++ b/fs/common.mk @@ -94,8 +94,6 @@ endif $(foreach hook,$(ROOTFS_PRE_CMD_HOOKS),\ $(call PRINTF,$($(hook))) >> $(FAKEROOT_SCRIPT)$(sep)) $(call PRINTF,$(ROOTFS_COMMON_TAR_CMD)) >> $(FAKEROOT_SCRIPT) - $(foreach hook,$(ROOTFS_POST_CMD_HOOKS),\ - $(call PRINTF,$($(hook))) >> $(FAKEROOT_SCRIPT)$(sep)) chmod a+x $(FAKEROOT_SCRIPT) PATH=$(BR_PATH) $(HOST_DIR)/bin/fakeroot -- $(FAKEROOT_SCRIPT) diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index cb30d29f89..c7e6f72461 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -637,7 +637,6 @@ $(2)_PRE_LEGAL_INFO_HOOKS ?= $(2)_POST_LEGAL_INFO_HOOKS ?= $(2)_TARGET_FINALIZE_HOOKS ?= $(2)_ROOTFS_PRE_CMD_HOOKS ?= -$(2)_ROOTFS_POST_CMD_HOOKS ?= # human-friendly targets and target sequencing $(1): $(1)-install @@ -948,7 +947,6 @@ PACKAGES_USERS += $$($(2)_USERS)$$(sep) endif TARGET_FINALIZE_HOOKS += $$($(2)_TARGET_FINALIZE_HOOKS) ROOTFS_PRE_CMD_HOOKS += $$($(2)_ROOTFS_PRE_CMD_HOOKS) -ROOTFS_POST_CMD_HOOKS += $$($(2)_ROOTFS_POST_CMD_HOOKS) ifeq ($$($(2)_SITE_METHOD),svn) DL_TOOLS_DEPENDENCIES += svn diff --git a/package/skeleton-init-systemd/skeleton-init-systemd.mk b/package/skeleton-init-systemd/skeleton-init-systemd.mk index a2d4e8c4b3..7da801ac4e 100644 --- a/package/skeleton-init-systemd/skeleton-init-systemd.mk +++ b/package/skeleton-init-systemd/skeleton-init-systemd.mk @@ -54,12 +54,6 @@ define SKELETON_INIT_SYSTEMD_PRE_ROOTFS_VAR endef SKELETON_INIT_SYSTEMD_ROOTFS_PRE_CMD_HOOKS += SKELETON_INIT_SYSTEMD_PRE_ROOTFS_VAR -define SKELETON_INIT_SYSTEMD_POST_ROOTFS_VAR - rm -rf $(TARGET_DIR)/var - ln -s usr/share/factory/var $(TARGET_DIR)/var -endef -SKELETON_INIT_SYSTEMD_ROOTFS_POST_CMD_HOOKS += SKELETON_INIT_SYSTEMD_POST_ROOTFS_VAR - endif define SKELETON_INIT_SYSTEMD_INSTALL_TARGET_CMDS From patchwork Sun Jan 14 14:17:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 860452 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@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; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="FH1NFmj8"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zKJVV0Jhlz9sRW for ; Mon, 15 Jan 2018 01:18:10 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 2CB56881C5; Sun, 14 Jan 2018 14:18:08 +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 ytu28CwPIw-E; Sun, 14 Jan 2018 14:18:07 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 1237788193; Sun, 14 Jan 2018 14:18:07 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 046F91C14DD for ; Sun, 14 Jan 2018 14:18:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id EF5A788617 for ; Sun, 14 Jan 2018 14:18:02 +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 jG2QhD4fH5FS for ; Sun, 14 Jan 2018 14:18:00 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by whitealder.osuosl.org (Postfix) with ESMTPS id BFEF38862E for ; Sun, 14 Jan 2018 14:17:59 +0000 (UTC) Received: by mail-wm0-f46.google.com with SMTP id f3so3999049wmc.1 for ; Sun, 14 Jan 2018 06:17:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=j6FyMZwcm0FE0XA84E/qJq5143H1y+BGJPKq8HTVOF0=; b=FH1NFmj8lt4JZMfvk6ey1HLndrGTkAVafmCOFHhNziGPnkekdXZKDR4pdd0XpZf/qk VPW5m5hxhBG2JcpJ1x48VnbmTR1JbZl+MpqRTVH51+skarEbqDy6yojolg4rJISSG2h9 htOGUwBacXa9wUnTGslQzTvkDfdxnAybzyXJo67r4xLvyE6dKFTXlipwfae2gD7HV5RL gdkxUdXuQplcYsfbolEs1jQpJOq3EKxrC8PxE+L9FxiDD5tw0NMjeB7j+nUmqAS3huaf WxzdgATYrvOs3nTqPl7vPoB7SG5JdmBNTfSQBEyHJNOJTBgyzrAAYJEmOFgpvu/HNat6 GxVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=j6FyMZwcm0FE0XA84E/qJq5143H1y+BGJPKq8HTVOF0=; b=Ik3/ZtFz/UOUDC4GByYNJ9f6+PMxg2EiZYo+jmuOb9QaDFJD8bmrq412V5s79ji3Ap sYX2J2vj772qZs0ub8PUr31ysqkv/eDh6ZR5Pdf/EFC3C0oiICS11VJPRaHV5tVtIOyV U0csx4jQZdpwCnUUL/emPvJhlkVQPWKFO6flsZPoRS/e8WltmmjDWnGFO779vZu+Lpu7 f6qz8sfadZq2Xp9/EA8trFr40H7ACFlqMzIQXcfkXaN1j5vQdbbFRHjXwm7i7XMQoF7s 6NqKbIUc6DWOf2mlMdN/rdVyfAUs2whmS3C9ZX3X0w2SSz1IZTQq8hbbOhN6sBcu0a25 glAQ== X-Gm-Message-State: AKwxytddIvliQlb53sXvAV86FcQvSqpwVL2zIT/khrmYVmGa1txDU4Oh Q7MQDYtoRtSwSsGmdknp1dSElQ== X-Google-Smtp-Source: ACJfBotkKPl32mcXelZgGfE5pZce9Cnnv7nTh3xhymlDxc/L+2+3tsBLMr0k3b1CtG7xJA7ZX/F65Q== X-Received: by 10.28.147.66 with SMTP id v63mr5068061wmd.118.1515939478104; Sun, 14 Jan 2018 06:17:58 -0800 (PST) Received: from localhost.localdomain (2a01cb088610730095116638271b1e6e.ipv6.abo.wanadoo.fr. [2a01:cb08:8610:7300:9511:6638:271b:1e6e]) by smtp.gmail.com with ESMTPSA id d63sm3260179wmd.9.2018.01.14.06.17.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Jan 2018 06:17:57 -0800 (PST) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Sun, 14 Jan 2018 15:17:13 +0100 Message-Id: <2e287d91a65316ba4a8dc49feb963872b69a13b6.1515939400.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 2.14.1 In-Reply-To: References: Subject: [Buildroot] [PATCH 17/17] fs: remove intermediate artefacts X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , "Yann E. MORIN" MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Each of the intermediate, per-rootfs target directories, as well as the intermediate tarball, can take quite some place, and is mostly a duplication of what's already in target/. The only delta, if any, would be the tweaks made by the filesystem image generations, but those tweaks are most probably only meaningfull when seen as root. We normally do not remove intermediate files, but those can be quite large, and are not directly usable by, nor accessible to the user. So, get rid of them once the filesystem has been generated. This does not need to be done in fakeroot. Signed-off-by: "Yann E. MORIN" Cc: Thomas Petazzoni Cc: Arnout Vandecappelle --- Makefile | 1 + fs/common.mk | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 85075f12fc..6d23c67d39 100644 --- a/Makefile +++ b/Makefile @@ -752,6 +752,7 @@ endif .PHONY: target-post-image target-post-image: $(TARGETS_ROOTFS) target-finalize + @rm -f $(ROOTFS_COMMON_TAR) @$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_IMAGE_SCRIPT)), \ $(call MESSAGE,"Executing post-image script $(s)"); \ $(EXTRA_ENV) $(s) $(BINARIES_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep)) diff --git a/fs/common.mk b/fs/common.mk index bacc98ec68..2ee130ee08 100644 --- a/fs/common.mk +++ b/fs/common.mk @@ -96,6 +96,7 @@ endif $(call PRINTF,$(ROOTFS_COMMON_TAR_CMD)) >> $(FAKEROOT_SCRIPT) chmod a+x $(FAKEROOT_SCRIPT) PATH=$(BR_PATH) $(HOST_DIR)/bin/fakeroot -- $(FAKEROOT_SCRIPT) + $(Q)rm -rf $(TARGET_DIR) rootfs-common-show-depends: @echo $(ROOTFS_COMMON_DEPENDENCIES) @@ -154,6 +155,7 @@ $$(BINARIES_DIR)/rootfs.$(1): $$(ROOTFS_$(2)_DEPENDENCIES) $$(call PRINTF,$$(ROOTFS_$(2)_CMD)) >> $$(FAKEROOT_SCRIPT) chmod a+x $$(FAKEROOT_SCRIPT) PATH=$$(BR_PATH) $$(HOST_DIR)/bin/fakeroot -- $$(FAKEROOT_SCRIPT) + $(Q)rm -rf $$(TARGET_DIR) ifneq ($$(ROOTFS_$(2)_COMPRESS_CMD),) PATH=$$(BR_PATH) $$(ROOTFS_$(2)_COMPRESS_CMD) $$@ > $$@$$(ROOTFS_$(2)_COMPRESS_EXT) endif