aboutsummaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorGravatar Yann E. MORIN <yann.morin.1998@free.fr>2019-04-15 21:47:32 +0200
committerGravatar Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>2019-04-15 23:47:22 +0200
commit5abb88218ecbb517b6a9f64a1f8b0a36fb9814aa (patch)
treeba387cdac3a13635c6f542c683f0732657b48f31 /fs
parentf8177b78132698b39ae3c49a0ee2f1d6828f8324 (diff)
downloadbuildroot-5abb88218ecbb517b6a9f64a1f8b0a36fb9814aa.tar.gz
buildroot-5abb88218ecbb517b6a9f64a1f8b0a36fb9814aa.tar.bz2
core: add per-package and per-filesystem show-info
Sometimes, it is need to quickly get the metadata of a subset of packages, without resorting to a full-blown JSON query. Introduce a new per-package (and per-filesystem) foo-show-info rule, that otputs a per-entity valid JSON blob. Note that calling it for multiple packages and.or filesystems at once will not generate a valid JSON blob, as there would be no separator between the JSON elements: $ make {foo,bar}-show-info { "foo": { foo stuff } } { "bar": { bar stuff } } However, jq is able to absorb this, with its slurping ability, which generates an array (ellipsed and manualy reformated for readability): $ make {foo,bar}-show-info |jq -s . - [ { "foo": { foo stuff } }, { "bar": { bar stuff } } ] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com> Cc: Arnout Vandecappelle <arnout@mind.be> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Diffstat (limited to 'fs')
-rw-r--r--fs/common.mk11
1 files changed, 10 insertions, 1 deletions
diff --git a/fs/common.mk b/fs/common.mk
index f7989eac57..6dd1774726 100644
--- a/fs/common.mk
+++ b/fs/common.mk
@@ -87,6 +87,11 @@ endif
rootfs-common-show-depends:
@echo $(ROOTFS_COMMON_DEPENDENCIES)
+.PHONY: rootfs-common-show-info
+rootfs-common-show-info:
+ @:
+ $(info $(call clean-json,{ $(call json-info,ROOTFS_COMMON) }))
+
# Since this function will be called from within an $(eval ...)
# all variable references except the arguments must be $$-quoted.
define inner-rootfs
@@ -184,9 +189,13 @@ endif
rootfs-$(1)-show-depends:
@echo $$(ROOTFS_$(2)_DEPENDENCIES)
+rootfs-$(1)-show-info:
+ @:
+ $$(info $$(call clean-json,{ $$(call json-info,ROOTFS_$(2)) }))
+
rootfs-$(1): $$(BINARIES_DIR)/$$(ROOTFS_$(2)_FINAL_IMAGE_NAME)
-.PHONY: rootfs-$(1) rootfs-$(1)-show-depends
+.PHONY: rootfs-$(1) rootfs-$(1)-show-depends rootfs-$(1)-show-info
ifeq ($$(BR2_TARGET_ROOTFS_$(2)),y)
TARGETS_ROOTFS += rootfs-$(1)