From patchwork Sun Sep 22 12:55:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 1165760 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=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="NN8dpTgR"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46bnVX60Xxz9sNF for ; Sun, 22 Sep 2019 22:55:14 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id CE2C38543B; Sun, 22 Sep 2019 12:55:10 +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 cOHtW8tell6D; Sun, 22 Sep 2019 12:55:08 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 943FA853C5; Sun, 22 Sep 2019 12:55:08 +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 EA7EA1BF2A9 for ; Sun, 22 Sep 2019 12:55:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id DE4DC853C5 for ; Sun, 22 Sep 2019 12:55:07 +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 Cz0jZuX-ot3k for ; Sun, 22 Sep 2019 12:55:07 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by whitealder.osuosl.org (Postfix) with ESMTPS id D65F0853B9 for ; Sun, 22 Sep 2019 12:55:06 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id v17so6404628wml.4 for ; Sun, 22 Sep 2019 05:55:06 -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:mime-version :content-transfer-encoding; bh=3bUdv/k0zJvZ/LAM9p63yaEman3d/Yl2vOglK0Y62J4=; b=NN8dpTgR/b4XtivnvMBrhGj5N+Yxun7TT/5eJnMoz6RL/3a+Id0dqtBwnw9g8TCR7b ofFos6ZnHrzWg3e3sP/WqNS6ECQYcqwARqP0JfQcjOiO4utMrPgG/tpDb/2qKY8N4Xdu HGhvKGeLTgVESyUBQQjtqvxnzPa0l8uRlrbUvKYUZkViadaOGm1O0wnKew1p2rmpNlBw ItzA0CraBOU4BS1dInWENXnpb201GsMo0zAnnT6SH4LWQKcOxVEIGlOma/5spOCe8H33 LcFU1UdtVusrzHiWYfJJyXE2S1NU7ymCpQfVYV2x0sUV1cI5qT4R4v0uC11pe9WNxUPl QU0w== 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 :mime-version:content-transfer-encoding; bh=3bUdv/k0zJvZ/LAM9p63yaEman3d/Yl2vOglK0Y62J4=; b=qMxCq65O/sNRrgaaap1UDxmf5MBtWIg72pq53gmLtMHjVCAYaJvtwK+o09Rvec6cJY CZ7flisMRrdaUbtZbdeP7ch8awUKRMk7aD5ue7arFM9MokmXmnpdcdgba3HMfVFpKvDA JYWg2fkc9YAEWzBKuEPm+cZLlabeQuY4bGwJz1snInm/aycpDkyMmlB4cQbF2bpWaVmH ILglQ5lgAwXFvXqyaCd99SjHIGs1k3vPLeIQRC7o2qbvdnjqw+60BLDWAMfEmcCljqD1 RKtdcixTn5V4jtJnll3rUQOzlH/QXdnmZw00g2CkJUa51pn5WZvj7U8mUwzIGS4hdt9c JV/g== X-Gm-Message-State: APjAAAUrcMziVIqIHgd7vK2AI1m2GZUDtDDDTYW6YW3jdhwikR/mapjW CpQbQFaOB2ZoOOOxFM6nhQ5X+csf X-Google-Smtp-Source: APXvYqxwfTU+EUj0BSieOJqshdnPeAS26gIWQeOFstdK2fPW1jky+2FfQXl+Fr+il/XQWUuadH2sWw== X-Received: by 2002:a1c:cbc3:: with SMTP id b186mr10603126wmg.130.1569156905006; Sun, 22 Sep 2019 05:55:05 -0700 (PDT) Received: from localhost.localdomain ([2a01:cb19:8b51:cb00:5c87:9b59:c02d:9138]) by smtp.gmail.com with ESMTPSA id 17sm7703137wrl.15.2019.09.22.05.55.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Sep 2019 05:55:04 -0700 (PDT) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Sun, 22 Sep 2019 14:55:00 +0200 Message-Id: <20190922125500.13865-1-yann.morin.1998@free.fr> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH] core/show-info: extend with kconfig variables 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: Thomas De Schampheleire , "Yann E. MORIN" , Thomas Petazzoni Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Extend the output of show-info with the kconfig variables applicable to each item in the list: - the main variable, if it exists - the list of sub-options, if any The main variable may not exist for host packages or for some low-level target packages (e.g. virtual packages), and does not exist for the pseudo, common rootfs. Even though a host package may not have a main option, it may still have sub-options (e.g. a blind option to enable an optional feature, like an hypotetical BR2_PACKAGE_HOST_PYTHON_NEEDS_SSL). For a package, the new ouput may now contain structures like: "busybox": { "kconfig_var": { "BR2_PACKAGE_BUSYBOX": "y", "options": { "BR2_PACKAGE_BUSYBOX_CONFIG": "package/busybox/busybox.config", "BR2_PACKAGE_BUSYBOX_CONFIG_FRAGMENT_FILES": "", "BR2_PACKAGE_BUSYBOX_SHOW_OTHERS": "y" } }, [...] } or for a filesystem: "rootfs-tar": { "kconfig_var": { "BR2_TARGET_ROOTFS_TAR": "y", "options": { "BR2_TARGET_ROOTFS_TAR_NONE": "y", "BR2_TARGET_ROOTFS_TAR_OPTIONS": "" } }, [...] }, or for an item with no kconfig presence (most probably a host package): "host-foo": { "kconfig_var": { "options": {} }, [...] } Note: for some special packages, the sub-options do not follow the traditional naming convention. For example, the option pointing to the uClibc config file is named BR2_UCLIBC_CONFIG, instead of the expected BR2_PACKAGE_UCLIBC_CONFIG. Therefore, those variables do not appear in the output of show-info. Signed-off-by: Yann E. MORIN Cc: Arnout Vandecappelle Cc: Thomas Petazzoni Cc: Thomas De Schampheleire --- package/pkg-utils.mk | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk index 74ade437d9..a05bf54527 100644 --- a/package/pkg-utils.mk +++ b/package/pkg-utils.mk @@ -97,6 +97,16 @@ define _json-info-pkg endef define _json-info-pkg-details + "kconfig_var": { + $(if $(filter $($(1)_KCONFIG_VAR),$(.VARIABLES)), + "$($(1)_KCONFIG_VAR)": "$($($(1)_KCONFIG_VAR))"$(comma) + ) + "options": { + $(foreach v,$(sort $(filter $($(1)_KCONFIG_VAR)_%,$(.VARIABLES))), + "${v}": "$(call qstrip,$($(v)))"$(comma) + ) + } + }, "version": "$($(1)_DL_VERSION)", "licenses": "$($(1)_LICENSE)", "install_target": $(call yesno-to-bool,$($(1)_INSTALL_TARGET)), @@ -119,6 +129,16 @@ define _json-info-pkg-details endef define _json-info-fs + "kconfig_var": { + $(if $(filter BR2_TARGET_$(1),$(.VARIABLES)), + "BR2_TARGET_$(1)": "$(BR2_TARGET_$(1))"$(comma) + ) + "options": { + $(foreach v,$(sort $(filter BR2_TARGET_$(1)_%,$(.VARIABLES))), + "${v}": "$(call qstrip,$($(v)))"$(comma) + ) + } + }, "dependencies": [ $(call make-comma-list,$(sort $($(1)_DEPENDENCIES))) ]