From patchwork Wed Sep 5 16:06:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 966525 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.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="awUTXEII"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4257r648rcz9sDT for ; Thu, 6 Sep 2018 02:07:02 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id D846928C0D; Wed, 5 Sep 2018 16:06:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IPp3tdRHhWHM; Wed, 5 Sep 2018 16:06:56 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 53B3C22921; Wed, 5 Sep 2018 16:06:56 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 1D1F61C2DCA for ; Wed, 5 Sep 2018 16:06:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 17A37226F3 for ; Wed, 5 Sep 2018 16:06:47 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id p53rch5ti2A7 for ; Wed, 5 Sep 2018 16:06:46 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by silver.osuosl.org (Postfix) with ESMTPS id 2BB0722921 for ; Wed, 5 Sep 2018 16:06:46 +0000 (UTC) Received: by mail-wr1-f48.google.com with SMTP id 20-v6so8225669wrb.12 for ; Wed, 05 Sep 2018 09:06:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=82PdMNLQjqINJlQbpVXcOEdbhAxhXOu0IYm9RW/bheI=; b=awUTXEIIeuoi0DtbbtRHCSTQxRuCsRLnmSA5z4xgq9TrEXZU8XGE8HYjgWXs4XjwtI m+R6NfaRDQDLBbpmyYXfSRHiDyNXFiatyQGfRCwXQSojCWYoqy0hdHHiVg3NREOo6us4 FjsH5w9T93zV8WTpzCWU7U1dJDJ0t/1pqENis= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=82PdMNLQjqINJlQbpVXcOEdbhAxhXOu0IYm9RW/bheI=; b=V81UOMDiKxNzm38zBLpJporPPTwaWOZY4/kYBAWAkrmJvUY4lYumqFtpKSL7nUwnfG 1sdEYnyK5yeX8o/8KYEDKtzs+s/ax5t/lku0Ml3Qxn4A0m4Rt0K+pg6ezA9QBWV3TOiz yE0M1ub4NVp6SJf6e4Jmt0PmEhLqXFjwxcLKEcT0TIpDRbgXbAj2TwpdJeCQNaGuSHUq Ki8qpvl+7UWES7XUgKKU9dScTTE5qKRTofeWzgtdR16HcVUphN761xeX7cHU7CWIQEMl c4oPV/uzYhmUH6lx+XZuPPhuOYwTKHmQo3ZsiKHzBrslGpA1yb4VD5ocXewPYWqLD+Se Vp5w== X-Gm-Message-State: APzg51BFa+Gsp9+S2PxsGoK+sdgBU98HlQrNgfIW5NodWmga7L2ROJ/8 ODsrD+/xmByTrvkjoWlsR3ClkYaWAXs= X-Google-Smtp-Source: ANB0VdZSyxtY3gJAeSaaVJcnDXpy+uFRYAkTr+B+IE7AeECr4Y2ZH/Z0TggPKx1kKiPUQDRog7q2rQ== X-Received: by 2002:adf:afd3:: with SMTP id y19-v6mr27128508wrd.176.1536163604220; Wed, 05 Sep 2018 09:06:44 -0700 (PDT) Received: from localhost.localdomain ([89.202.204.147]) by smtp.gmail.com with ESMTPSA id k34-v6sm3525308wre.18.2018.09.05.09.06.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 05 Sep 2018 09:06:43 -0700 (PDT) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Wed, 5 Sep 2018 18:06:34 +0200 Message-Id: <1536163596-5310-2-git-send-email-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536163596-5310-1-git-send-email-angelo@amarulasolutions.com> References: <1536163596-5310-1-git-send-email-angelo@amarulasolutions.com> Subject: [Buildroot] [PATCH v3 1/3] Makefile: add tainting support X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Angelo Compagnucci MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Angelo Compagnucci 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 Signed-off-by: Angelo Compagnucci --- 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),@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)