From patchwork Wed Oct 30 13:27:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Santos X-Patchwork-Id: 1186698 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="FqdPOjxW"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4738RM4VF8z9sPL for ; Thu, 31 Oct 2019 00:28:31 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 06FBD87DDB; Wed, 30 Oct 2019 13:28:30 +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 bN6m7P3mOQXq; Wed, 30 Oct 2019 13:28:29 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 4563887DB1; Wed, 30 Oct 2019 13:28:29 +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 E1D4F1BF9BF for ; Wed, 30 Oct 2019 13:28:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 6430387D6E for ; Wed, 30 Oct 2019 13:28:23 +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 J3Lrzw2e7Ekg for ; Wed, 30 Oct 2019 13:28:20 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qt1-f193.google.com (mail-qt1-f193.google.com [209.85.160.193]) by hemlock.osuosl.org (Postfix) with ESMTPS id 50FFB87DB1 for ; Wed, 30 Oct 2019 13:28:18 +0000 (UTC) Received: by mail-qt1-f193.google.com with SMTP id g50so3201678qtb.4 for ; Wed, 30 Oct 2019 06:28:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=uXYd8hV/ftH7UiCLO0ZVIJZRlD2GuK1CgDBuWgOrmeo=; b=FqdPOjxWYMmKzcxNIr01LsDEAVaZvoZG2pfevX1Dpi5T9w3Qy8Jm3BSEZN7BVNRNI6 13FXW9GVi+gE8ouw/2TB0cTdu3fxxe/axQOqPfkUVE2K+OrlIosijwpL+ULZH+adCyo3 7ucBzQbv9UWm3mJfSjOPUtuoUCCV9N00cMdvlhcQ42VAHd375TxoYrxma/2TvxeSLZ8u FyBsMm+wjnj7DcU8pYZk0dqx27YLYcQiFTUJ/MQjYsyyfXxsiWBGqeIvsjJRVNH4OfSD hvPL+WkSG4XPqiR1e5182J4t/SCCcuOyjmiE7OwzeTe8Mb6YqRsc4VliCWaGWHKT0DHf x1JA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=uXYd8hV/ftH7UiCLO0ZVIJZRlD2GuK1CgDBuWgOrmeo=; b=PDvthWUonIrJRc8p5pNL278A8q14Dqt7wH553ibhs7j4isVQB9jmLmAgBW+usZsLNl Qs7FkMnqeRcL8KIoX1J+rpfacw2TaGEHtgW5332NpyKy9pcbc8eIGsnsU/GLhy7YjjX+ 0at2n4M3t9oILdV8RRoXB2PO0X2jFgKTCNp7RQ9X4sIDgt4hDW009oR8jbuyjzMklLDN fdZOK+/+q10eFhebO2O68Ky01gTNrGW56Th1gNt8tWLv3e4/uW46t3m5sBUQmOteT3OS Gy/+ArDA0YwQDuPuKb8ixLXy+yP2jtWALUrUUEYb5EDzBtc+ZU+lSECgQlN2j4CNFg4V 6uqg== X-Gm-Message-State: APjAAAWwqcPMQbd5jsjx1+fM7gs7NV4+rI3+wxC4ec0VnuNBVlhnku0B KOl7bNqmsu0Sd2oL0mH9eXns+vL0Iag= X-Google-Smtp-Source: APXvYqwG7XlXWGvX7I8XF4tJR6NykKPSbV4rRfznEwx4ebMkx+wLJfMXt4X4JZPdqfe1WRHq65MhPQ== X-Received: by 2002:a0c:887a:: with SMTP id 55mr29420390qvm.137.1572442096963; Wed, 30 Oct 2019 06:28:16 -0700 (PDT) Received: from casantos.remote.csb ([177.97.64.39]) by smtp.gmail.com with ESMTPSA id v54sm102773qtc.77.2019.10.30.06.28.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Oct 2019 06:28:16 -0700 (PDT) From: unixmania@gmail.com To: buildroot@buildroot.org Date: Wed, 30 Oct 2019 10:27:57 -0300 Message-Id: <20191030132759.8643-2-unixmania@gmail.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20191030132759.8643-1-unixmania@gmail.com> References: <20191030132759.8643-1-unixmania@gmail.com> Subject: [Buildroot] [PATCH RFC 1/3] package/pkg-generic.mk: support hooks and tables in virtual packages X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eric Le Bihan , Bernd Kuhls , Carlos Santos , Thomas Petazzoni , "Yann E . MORIN" , Adam Duskett , Maxime Hadjinlian MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Carlos Santos Virtual packages are not built but it's useful to allow them to have permission/device/user tables and target-finalize/rootfs-pre-cmd hooks. With this change we don't need to replicate date as currently done in eudev and systemd user tables or test if the package is selected to add a target-finalize hook as in luainterpreter. Signed-off-by: Carlos Santos --- package/pkg-generic.mk | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index 893faba22a..7b3f1646ae 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -930,6 +930,7 @@ $$($(2)_TARGET_DIRCLEAN): PKG=$(2) # Compute the name of the Kconfig option that correspond to the # package being enabled. We handle three cases: the special Linux # kernel case, the bootloaders case, and the normal packages case. +# Virtual packages are handled separately (see below). ifeq ($(1),linux) $(2)_KCONFIG_VAR = BR2_LINUX_KERNEL else ifneq ($$(filter boot/% $$(foreach dir,$$(BR2_EXTERNAL_DIRS),$$(dir)/boot/%),$(pkgdir)),) @@ -1118,6 +1119,22 @@ ifneq ($$($(2)_HELP_CMDS),) HELP_PACKAGES += $(2) endif +# Virtual packages are not built but it's useful to allow them to have +# permission/device/user tables and target-finalize/rootfs-pre-cmd hooks. +else ifeq ($$(BR2_PACKAGE_HAS_$(2)),y) # $(2)_KCONFIG_VAR + +ifneq ($$($(2)_PERMISSIONS),) +PACKAGES_PERMISSIONS_TABLE += $$($(2)_PERMISSIONS)$$(sep) +endif +ifneq ($$($(2)_DEVICES),) +PACKAGES_DEVICES_TABLE += $$($(2)_DEVICES)$$(sep) +endif +ifneq ($$($(2)_USERS),) +PACKAGES_USERS += $$($(2)_USERS)$$(sep) +endif +TARGET_FINALIZE_HOOKS += $$($(2)_TARGET_FINALIZE_HOOKS) +ROOTFS_PRE_CMD_HOOKS += $$($(2)_ROOTFS_PRE_CMD_HOOKS) + endif # $(2)_KCONFIG_VAR endef # inner-generic-package