From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [NEXT 01/26] cpe-info: new make target
Date: Tue, 27 Feb 2018 22:40:38 +0100 [thread overview]
Message-ID: <20180227224038.30ae1e48@windsurf.lan> (raw)
In-Reply-To: <1519697441-54194-2-git-send-email-matthew.weber@rockwellcollins.com>
Hello,
On Mon, 26 Feb 2018 20:10:16 -0600, Matt Weber wrote:
> Similar to make legal-info, produce a csv delimited
> file containing all selected packages CPE
> identification.
>
> Signed-off-by: Matt Weber <matthew.weber@rockwellcollins.com>
> ---
> Makefile | 17 ++++++++++++++++-
> package/pkg-generic.mk | 12 ++++++++++++
> package/pkg-utils.mk | 8 ++++++++
> 3 files changed, 36 insertions(+), 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index ec39bcd..7eda990 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -146,7 +146,7 @@ nobuild_targets := source %-source \
> clean distclean help show-targets graph-depends \
> %-graph-depends %-show-depends %-show-version \
> graph-build graph-size list-defconfigs \
> - savedefconfig printvars
> + savedefconfig printvars cpe-info %-cpe-info
> ifeq ($(MAKECMDGOALS),)
> BR_BUILDING = y
> else ifneq ($(filter-out $(nobuild_targets),$(MAKECMDGOALS)),)
> @@ -230,6 +230,7 @@ LEGAL_MANIFEST_CSV_TARGET = $(LEGAL_INFO_DIR)/manifest.csv
> LEGAL_MANIFEST_CSV_HOST = $(LEGAL_INFO_DIR)/host-manifest.csv
> LEGAL_WARNINGS = $(LEGAL_INFO_DIR)/.warnings
> LEGAL_REPORT = $(LEGAL_INFO_DIR)/README
> +CPE_MANIFEST_CSV = $(BASE_DIR)/cpe-manifest.csv
>
> ################################################################################
> #
> @@ -788,6 +789,19 @@ legal-info: dirs legal-info-clean legal-info-prepare $(foreach p,$(PACKAGES),$(p
> mv .legal-info.sha256 legal-info.sha256)
> @echo "Legal info produced in $(LEGAL_INFO_DIR)"
>
> +.PHONY: cpe-info-clean
> +cpe-info-clean:
> + @rm -f $(CPE_MANIFEST_CSV)
> +
> +.PHONY: cpe-info-prepare
> +cpe-info-prepare:
> + @$(call MESSAGE,"Gathering CPE info")
> + @$(call cpe-manifest,CPE ID,CVE PATCHED,PACKAGE,VERSION,SOURCE SITE)
> +
> +.PHONY: cpe-info
> +cpe-info: cpe-info-clean cpe-info-prepare $(foreach p,$(PACKAGES),$(p)-cpe-info)
> + @echo "CPE info produced in $(CPE_MANIFEST_CSV)"
> +
> .PHONY: show-targets
> show-targets:
> @echo $(sort $(PACKAGES)) $(sort $(TARGETS_ROOTFS))
> @@ -1047,6 +1061,7 @@ help:
> @echo ' source - download all sources needed for offline-build'
> @echo ' external-deps - list external packages used'
> @echo ' legal-info - generate info about license compliance'
> + @echo ' cpe-info - generate info about security CPE identification'
> @echo ' printvars - dump all the internal variables'
> @echo
> @echo ' make V=0|1 - 0 => quiet build (default), 1 => verbose build'
> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> index a2a12e7..8622787 100644
> --- a/package/pkg-generic.mk
> +++ b/package/pkg-generic.mk
> @@ -830,6 +830,17 @@ else
> $(2)_KCONFIG_VAR = BR2_PACKAGE_$(2)
> endif
>
> +$(1)-cpe-info: PKG=$(2)
> +$(1)-cpe-info:
> +ifneq ($$(call qstrip,$$($(2)_SOURCE)),)
> + @$$(call MESSAGE,"Collecting cpe info")
> +ifeq ($$(call qstrip,$$($(2)_CPE_ID)),)
> + $(Q)$$(call cpe-manifest,"unknown",$$($(2)_CVE_PATCHED),$$($(2)_RAWNAME),$$($(2)_VERSION),$$($(2)_ACTUAL_SOURCE_SITE))
> +else
> + $(Q)$$(foreach id,$$($(2)_CPE_ID),$$(call cpe-manifest,$$(id),$$($(2)_CVE_PATCHED),$$($(2)_RAWNAME),$$($(2)_VERSION),$$($(2)_ACTUAL_SOURCE_SITE))$$(sep))
> +endif
> +endif
A question is: do we need a new make target, or can an external script
do the same thing ?
After all, "make printvars" gives you pretty much the needed
information. All what is missing is that you can't easily get the list
of selected packages in the current configuration, but that would be
useful for me for the pkg-stats script as well. So a "make
show-packages" or "make list-packages" could be useful.
Perhaps that's how we can make our two different needs converge: by
having external scripts rather than adding more stuff to the package
infrastructure. A ./utils/cpe-report script could do pretty much what
you've done here.
Thoughts ?
Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com
next prev parent reply other threads:[~2018-02-27 21:40 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-27 2:10 [Buildroot] [NEXT 00/26] Package CVE Reporting Matt Weber
2018-02-27 2:10 ` [Buildroot] [NEXT 01/26] cpe-info: new make target Matt Weber
2018-02-27 21:40 ` Thomas Petazzoni [this message]
2018-02-28 4:30 ` Matthew Weber
2018-03-01 20:21 ` Arnout Vandecappelle
2018-02-27 2:10 ` [Buildroot] [NEXT 02/26] cpe-info: update manual for new pkg vars Matt Weber
2018-02-27 21:43 ` Thomas Petazzoni
2018-02-28 4:22 ` Matthew Weber
2018-02-27 2:10 ` [Buildroot] [NEXT 03/26] cpe-info: id prefix/suffix Matt Weber
2018-02-27 21:45 ` Thomas Petazzoni
2018-02-28 4:14 ` Matthew Weber
2018-03-01 20:34 ` Arnout Vandecappelle
2018-03-03 3:01 ` Matthew Weber
2018-03-01 20:32 ` Arnout Vandecappelle
2018-02-27 2:10 ` [Buildroot] [NEXT 04/26] cpe-info: only report target pkgs Matt Weber
2018-02-27 21:45 ` Thomas Petazzoni
2018-02-28 4:13 ` Matthew Weber
2018-02-27 2:10 ` [Buildroot] [NEXT 05/26] bash: add CPE id Matt Weber
2018-02-27 2:10 ` [Buildroot] [NEXT 06/26] boa: " Matt Weber
2018-02-27 22:17 ` Thomas Petazzoni
2018-02-28 4:00 ` Matthew Weber
2018-02-28 6:38 ` Thomas Petazzoni
2018-03-01 20:47 ` Arnout Vandecappelle
2018-03-01 22:55 ` Matthew Weber
2018-03-02 8:19 ` Arnout Vandecappelle
2018-03-02 9:49 ` Thomas Petazzoni
2018-03-02 16:14 ` Matthew Weber
2018-02-27 2:10 ` [Buildroot] [NEXT 07/26] boost: " Matt Weber
2018-02-27 2:10 ` [Buildroot] [NEXT 08/26] busybox: " Matt Weber
2018-02-27 2:10 ` [Buildroot] [NEXT 09/26] bzip2: " Matt Weber
2018-02-27 2:10 ` [Buildroot] [NEXT 10/26] dhcp: " Matt Weber
2018-02-27 2:10 ` [Buildroot] [NEXT 11/26] e2fsprogs: " Matt Weber
2018-02-27 2:10 ` [Buildroot] [NEXT 12/26] gdb: " Matt Weber
2018-02-27 2:10 ` [Buildroot] [NEXT 13/26] glibc: " Matt Weber
2018-02-27 2:10 ` [Buildroot] [NEXT 14/26] gnupg: " Matt Weber
2018-02-27 2:10 ` [Buildroot] [NEXT 15/26] gzip: " Matt Weber
2018-02-27 2:10 ` [Buildroot] [NEXT 16/26] iproute2: " Matt Weber
2018-02-27 2:10 ` [Buildroot] [NEXT 17/26] libgcrypt: " Matt Weber
2018-02-27 2:10 ` [Buildroot] [NEXT 18/26] libopenssl: " Matt Weber
2018-02-27 2:10 ` [Buildroot] [NEXT 19/26] libzlib: " Matt Weber
2018-02-27 2:10 ` [Buildroot] [NEXT 20/26] linux: " Matt Weber
2018-02-27 22:18 ` Thomas Petazzoni
2018-02-28 4:12 ` Matthew Weber
2018-03-02 9:55 ` Thomas Petazzoni
2018-02-27 2:10 ` [Buildroot] [NEXT 21/26] linux-headers: " Matt Weber
2018-02-27 2:10 ` [Buildroot] [NEXT 22/26] openssh: " Matt Weber
2018-02-27 2:10 ` [Buildroot] [NEXT 23/26] rsyslog: " Matt Weber
2018-02-27 2:10 ` [Buildroot] [NEXT 24/26] tcpdump: " Matt Weber
2018-02-27 2:10 ` [Buildroot] [NEXT 25/26] util-linux: " Matt Weber
2018-02-27 2:10 ` [Buildroot] [NEXT 26/26] xerces: " Matt Weber
2018-02-27 21:37 ` [Buildroot] [NEXT 00/26] Package CVE Reporting Thomas Petazzoni
2018-02-28 4:42 ` Matthew Weber
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180227224038.30ae1e48@windsurf.lan \
--to=thomas.petazzoni@bootlin.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox