From patchwork Sat Mar 31 09:05:51 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: 893736 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=free.fr Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="blxEjW27"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40Cszg1n6Gz9s1r for ; Sat, 31 Mar 2018 20:06:23 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id E12433078B; Sat, 31 Mar 2018 09:06:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MMioINITvkS4; Sat, 31 Mar 2018 09:06:19 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 610CC25F2A; Sat, 31 Mar 2018 09:06:19 +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 D30811C062E for ; Sat, 31 Mar 2018 09:06:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id CF16189209 for ; Sat, 31 Mar 2018 09:06:12 +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 1ZQKre8tbHS8 for ; Sat, 31 Mar 2018 09:06:12 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by fraxinus.osuosl.org (Postfix) with ESMTPS id CA6A389205 for ; Sat, 31 Mar 2018 09:06:10 +0000 (UTC) Received: by mail-wm0-f67.google.com with SMTP id l9so18534272wmh.2 for ; Sat, 31 Mar 2018 02:06:10 -0700 (PDT) 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=NpKibzIQgBNPZpYpmMR9/tVKcQL71Fj66EUBTy3Xm24=; b=blxEjW27rIszjIW4S0qBo2osTAlopiK2CjWUvDXepQey5KnBVW1xnygkA/y6O2NLbS bDU7i4vRsBeVV81SJwpsmsC91ThRiQKWWWv1u5/eUvJbzd0LqCRf1ZQ3TE1kj6MYjjR+ 4NV2aVcnRQfPSMmYawAM2tNnBDL8+tPhrvnbYyWQDRT2clxInpt1dnO6oQPeJFzFNSrx aX6BOJQUpH68O8z+LQC7ucHcPn4GhT4uY+0xQDa2EPvUoVT6rCa+x7s3wC3vC+0LVRfR 3TKjWkEd+iSb6DKTPhrJBhKKIO/WBb7gGU75mo2bKB39hVNdeb9330rzkCZvQQnCz290 AaJg== 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=NpKibzIQgBNPZpYpmMR9/tVKcQL71Fj66EUBTy3Xm24=; b=Wovz25g/earxZezLnwxWWbn8PjLIMSiFkPOB18AF/Jo+3v6ro5kTvQhIzUhF7pyHXq UaeTh35F2egs+KlcT/uf7Naw7zcRcTerCUM2kecE+1V5wdW+h3EzxKZ1tJCxPzGgpxlA O1SfyfPuel2vwOw9CZPA5S6q4mzSZ1hLvjjAlEpZ54Vg3JJlIgEy2vF5mrvESRwhmi6o Bq3L/6OU8oNhw90mcrrdIrJErr6wKuFbpsf0LbSZMU6GAg6Qj8bxzcSaafX+fZHaQg+/ p7rq1aOYfvDLZy+EaF0PZcNOJLOhcVcW8rGmun/Iv3FhOT7XHg0bLSM7I89WUHzj52vj Bwbg== X-Gm-Message-State: ALQs6tABrXQ2pcjD0l1VcEyBtxJUsJVGmFbWgiEqWujnCnwJhwhzgzda yaJnmkLhgnNJxy8y1KHMr9EtDw== X-Google-Smtp-Source: AIpwx49oGAW3KYUzLRLqHBSSFaBJ1SEvOAH64vINUYT8qK3Z8IzKJweIPyM4kDrAL5dP6SL02H3Htg== X-Received: by 10.28.160.9 with SMTP id j9mr4508861wme.50.1522487168875; Sat, 31 Mar 2018 02:06:08 -0700 (PDT) Received: from scaer.online.net (ns304657.ip-46-105-103.eu. [46.105.103.66]) by smtp.gmail.com with ESMTPSA id u110sm18111490wrc.72.2018.03.31.02.06.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 31 Mar 2018 02:06:08 -0700 (PDT) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Sat, 31 Mar 2018 11:05:51 +0200 Message-Id: <2c9871505f740e5fec41247211aa86aa47feef6b.1522487149.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 2.14.1 In-Reply-To: References: Subject: [Buildroot] [PATCH 05/15 v4] 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: "Yann E. MORIN" , Thomas Petazzoni 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 41624b859e..e17675be9b 100644 --- a/Makefile +++ b/Makefile @@ -680,6 +680,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 6d82f7027e..152e1d0c67 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -384,6 +384,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))),)