Go to file
Yann E. MORIN f8177b7813 core: introduce new global show-info
Users are increasingly trying to extract information about packages. For
example, they might need to get the list of URIs, or the dependencies of
a package.

Although we do have a bunch of rules to generate some of that, this is
done in ad-hoc way, with most of the output formats just ad-hoc, raw,
unformatted blurbs, mostly internal data dumped as-is.

Introduce a new rule, show-info, that provides a properly formatted
output of all the meta-information about packages: name, type, version,
licenses, dependencies...

We choose to use JSON as the output format, because it is pretty
versatile, has parsers in virtually all languages, has tools to parse
from the shell (jq). It also closely matches Python data structure,
which makes it easy to use with our own internal tools as well. Finally,
JSON being a key-value store, allows for easy expanding the output
without requiring existing consumers to be updated; new, unknown keys
are simply ignored by those (as long as they are true JSON parsers).

The complex part of this change was the conditional output of parts of
the data: virtual packages have no source, version, license or
downloads, unlike non-virtual packages. Same goes for filesystems. We
use a wrapper macro, show-info, that de-multiplexes unto either the
package-related- or filesystem-related macros, and for packages, we also
use a detailed macro for non-virtual packages.

It is non-trivial to properly output correct JSON blurbs, especially
when trying to output an array of objects, like so, where the last item
shall not be followed by a comma:  [ { ... }, { ... } ]

So, we use a trick (as sugegsted by Arnout), to $(subst) any pair of
",}" or ", }" or ",]" or ", ]" with only the respective closing symbol,
"}" or "]".

The whole stuff is $(strip)ed to make it a somewhat-minified JSON blurb
that fits on a single line with all spaces squashed (but still with
spaces, as it is not possible to differentiate spaces between JSON
elements from spaces inside JSON strings).

Reported-by: Thomas De Schampheleire <patrickdepinguin@gmail.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2019-04-15 23:37:44 +02:00
arch arch/mips: add (Marvell) Octeon III processor 2019-02-04 17:30:18 +01:00
board configs/asus_tinker_rk3288: adjust U-Boot config to boot larger kernel image 2019-04-15 21:37:43 +02:00
boot boot/opensbi: add hash file 2019-04-10 11:54:51 +02:00
configs configs/asus_tinker_rk3288: bump to Linux kernel 5.0 and u-boot 2019.01 2019-04-15 21:38:29 +02:00
docs docs/website: update for 2019.02.1 2019-03-30 09:18:11 +01:00
fs fs: add all recursive dependencies to packages list 2019-04-15 23:36:25 +02:00
linux linux: simplify LINUX_BUILD_CMDS 2019-04-13 17:15:19 +02:00
package core: introduce new global show-info 2019-04-15 23:37:44 +02:00
support infra/utils: add helper to generate comma-separated lists 2019-04-15 23:24:13 +02:00
system system/skeleton: remove password expiration from shadow 2019-03-20 23:06:29 +01:00
toolchain toolchain/toolchain-external-custom: support Linux 5.1 2019-04-07 09:10:52 +02:00
utils utils/genrandconfig: test configurations with BR2_SYSTEM_ENABLE_NLS 2019-04-14 11:26:58 +02:00
.defconfig
.flake8 .flake8: fix check for 80/132 columns 2019-04-10 12:31:33 +02:00
.gitignore
.gitlab-ci.yml .gitlab-ci.yml: reorder jobs 2019-04-13 15:28:55 +02:00
.gitlab-ci.yml.in .gitlab-ci.yml: reorder jobs 2019-04-13 15:28:55 +02:00
CHANGES Update for 2019.02.1 2019-03-30 09:14:19 +01:00
Config.in toolchain: set the ssp gcc option in kconfig 2019-03-13 00:01:55 +01:00
Config.in.legacy package/lunit: remove package 2019-04-03 21:35:46 +02:00
COPYING
DEVELOPERS package/dacapo: new package 2019-04-14 15:32:34 +02:00
Makefile core: introduce new global show-info 2019-04-15 23:37:44 +02:00
Makefile.legacy
README

Buildroot is a simple, efficient and easy-to-use tool to generate embedded
Linux systems through cross-compilation.

The documentation can be found in docs/manual. You can generate a text
document with 'make manual-text' and read output/docs/manual/manual.text.
Online documentation can be found at http://buildroot.org/docs.html

To build and use the buildroot stuff, do the following:

1) run 'make menuconfig'
2) select the target architecture and the packages you wish to compile
3) run 'make'
4) wait while it compiles
5) find the kernel, bootloader, root filesystem, etc. in output/images

You do not need to be root to build or run buildroot.  Have fun!

Buildroot comes with a basic configuration for a number of boards. Run
'make list-defconfigs' to view the list of provided configurations.

Please feed suggestions, bug reports, insults, and bribes back to the
buildroot mailing list: buildroot@buildroot.org
You can also find us on #buildroot on Freenode IRC.

If you would like to contribute patches, please read
https://buildroot.org/manual.html#submitting-patches