From: Angelo Compagnucci <angelo@amarulasolutions.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v3 1/3] Makefile: add tainting support
Date: Wed, 5 Sep 2018 18:06:34 +0200 [thread overview]
Message-ID: <1536163596-5310-2-git-send-email-angelo@amarulasolutions.com> (raw)
In-Reply-To: <1536163596-5310-1-git-send-email-angelo@amarulasolutions.com>
From: Angelo Compagnucci <angelo.compagnucci@gmail.com>
Packages who harms the build reproducibility or licensing can declare
FOO_TAINTS variable. If a package taints the build it will be added
to a list of tainting packages. The build ends with a warning if the
tainting packages list is not empty. Moreover, legal info will show
a warning in presence of a tainting package.
Angelo Compagnucci <angelo@amarulasolutions.com>
Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
---
Makefile | 10 ++++++++++
package/pkg-generic.mk | 8 ++++++++
2 files changed, 18 insertions(+)
diff --git a/Makefile b/Makefile
index 9d66bba..ad61130 100644
--- a/Makefile
+++ b/Makefile
@@ -758,12 +758,21 @@ endif
touch $(TARGET_DIR)/usr
+.PHONY: check-tainted
+check-tainted:
+ifneq ($(BR2_TAINTED_BY),)
+ $(error Your buildroot configuration is tainted by: $(BR2_TAINTED_BY))
+else
+ @echo "Your buildroot configuration is not tainted"
+endif
+
.PHONY: target-post-image
target-post-image: $(TARGETS_ROOTFS) target-finalize
@rm -f $(ROOTFS_COMMON_TAR)
@$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_IMAGE_SCRIPT)), \
$(call MESSAGE,"Executing post-image script $(s)"); \
$(EXTRA_ENV) $(s) $(BINARIES_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep))
+ $(if $(BR2_TAINTED_BY), at echo "WARNING: Your buildroot configuration is tainted by: $(BR2_TAINTED_BY).")
.PHONY: source
source: $(foreach p,$(PACKAGES),$(p)-all-source)
@@ -1070,6 +1079,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 ' check-tainted - check if any selected package harms build reproducibility or licensing'
@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 91b61c6..bcb4acd 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -551,6 +551,10 @@ ifndef $(2)_REDISTRIBUTE
endif
endif
+ifdef $(2)_TAINTS
+BR2_TAINTED_BY+=$$($(2)_RAWNAME)
+endif
+
$(2)_REDISTRIBUTE ?= YES
$(2)_REDIST_SOURCES_DIR = $$(REDIST_SOURCES_DIR_$$(call UPPERCASE,$(4)))/$$($(2)_BASENAME_RAW)
@@ -909,6 +913,10 @@ else
$(Q)$$(foreach F,$$($(2)_LICENSE_FILES),$$(call legal-license-file,$$($(2)_RAWNAME),$$($(2)_BASENAME_RAW),$$($(2)_PKGDIR),$$(F),$$($(2)_DIR)/$$(F),$$(call UPPERCASE,$(4)))$$(sep))
endif # license files
+ifeq ($$(call qstrip,$$($(2)_TAINTS)),YES)
+ $(Q)$$(call legal-warning-pkg,$$($(2)_RAWNAME),unknown license for additional modules or dependencies)
+endif
+
ifeq ($$($(2)_SITE_METHOD),local)
# Packages without a tarball: don't save and warn
@$$(call legal-warning-nosource,$$($(2)_RAWNAME),local)
--
2.7.4
next prev parent reply other threads:[~2018-09-05 16:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-05 16:06 [Buildroot] [PATCH v3 0/3] Add tainting support to buildroot Angelo Compagnucci
2018-09-05 16:06 ` Angelo Compagnucci [this message]
2018-09-05 19:37 ` [Buildroot] [PATCH v3 1/3] Makefile: add tainting support Thomas Petazzoni
2018-09-05 21:45 ` Angelo Compagnucci
2018-09-05 22:01 ` Thomas Petazzoni
2018-09-05 22:22 ` Angelo Compagnucci
2018-09-05 16:06 ` [Buildroot] [PATCH v3 2/3] docs/manual: adding infos about tainting Angelo Compagnucci
2018-09-05 16:06 ` [Buildroot] [PATCH v3 3/3] package/nodejs: taint the build on external modules Angelo Compagnucci
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=1536163596-5310-2-git-send-email-angelo@amarulasolutions.com \
--to=angelo@amarulasolutions.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