From patchwork Tue Jan 21 23:09:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Mayer X-Patchwork-Id: 1226832 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=broadcom.com header.i=@broadcom.com header.a=rsa-sha256 header.s=google header.b=Bp+dI/dI; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 482Q3k6YG4z9sNF for ; Wed, 22 Jan 2020 10:39:14 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id F1DC587B39; Tue, 21 Jan 2020 23:39:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id T74TVXslTTqD; Tue, 21 Jan 2020 23:39:10 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id A812087B3C; Tue, 21 Jan 2020 23:39:10 +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 C5DE91BF982 for ; Tue, 21 Jan 2020 23:38:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id C17D220534 for ; Tue, 21 Jan 2020 23:38:59 +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 aTTdxjIMfQAH for ; Tue, 21 Jan 2020 23:38:57 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) by silver.osuosl.org (Postfix) with ESMTPS id B0F4B20531 for ; Tue, 21 Jan 2020 23:38:56 +0000 (UTC) Received: by mail-lj1-f178.google.com with SMTP id u1so4709451ljk.7 for ; Tue, 21 Jan 2020 15:38:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=mOLKRdqNdKycpap4ufyhKZ0HjwjwG5Fjfm1g9/nl+gA=; b=Bp+dI/dIhYQBgL3Ar9LBxSIZAK8sL9UjTgcAb7xkIzsh4nWjs3vo8oYoUchmaShEY8 Ia3W8BOXN+RH/DK0+8v8Jr7WYgOgjrIM7obtbq2HAO2wTY14dEuGJFqc3wsccczpyQA+ 5B/nr61na/g421Vd1NY/GfN2k0uCiXI9/winA= 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=mOLKRdqNdKycpap4ufyhKZ0HjwjwG5Fjfm1g9/nl+gA=; b=dCC9qZEiY1SuQwXiX+hbLu+q6v1BxnUsUEBHAFYhS9SiPOsqzDjtWml0ruKsd/Z+Uv T362BctJZC1qz6exKmt4wJGblyhk0qnMGwpqj2ivFA9fszl/Fqv2Ci2LvBFhE26zwQBh nM0wTc3MN7Mp1NmmlAOeBGIHhRFklX7cw5+AHIRpyyOP4isX7/c+XRDj9YDNieKiYnTx kSmJX0qsOc1yib8BnxIxNMfxBTq88jSRnU7UR+rZXGRlhVaNQHyEYjXNewBgVCeji373 IvHslh/P+J3G7Ms9b7s/xNVFrOY2FmJf3Np/3oe8iVicqw5mN8fWgA4/cZa/mPSuBAWN Wtew== X-Gm-Message-State: APjAAAW6QQkSb58gGdEz93Olu4rJxjsa3jrBJS9mzbjbbsSxRhN0uvLY JOFPiTG0KQRpCzQrm9FFQgbhZR++tnurXQPs2tWu3nnERET710Eoo1LFFlJ/3gluQZcszUKOZzv KUSGKhtmr8yDGEOUM/+AXFPr7CEicoHYkG4BWVLOPeYyV7VDNZ1IiAL7SPXrjgC+ARRF0 X-Google-Smtp-Source: APXvYqwxWqqNS+pKroTKzHYgEDMiq4NLPpr/XyPrF2Er/RiTsFuF7vCbrvyMyv7LZjP3K+hUQId+OA== X-Received: by 2002:adf:ebc6:: with SMTP id v6mr7295377wrn.75.1579648224020; Tue, 21 Jan 2020 15:10:24 -0800 (PST) Received: from lbrmn-mmayer.ric.broadcom.com ([192.19.228.250]) by smtp.gmail.com with ESMTPSA id d16sm58865490wrg.27.2020.01.21.15.10.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jan 2020 15:10:23 -0800 (PST) From: Markus Mayer To: buildroot@buildroot.org Date: Tue, 21 Jan 2020 15:09:56 -0800 Message-Id: <20200121230956.23129-2-mmayer@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200121230956.23129-1-mmayer@broadcom.com> References: <20200121230956.23129-1-mmayer@broadcom.com> Subject: [Buildroot] [PATCH 1/1] system/Config.in: introduce pre-build script X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Markus Mayer MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" We introduce the concept of a pre-build script that works similar to the already existing post-build and post-image scripts. The pre-build script(s) are executed before the build commences. This allows a user to run some preperatory tasks prior to the build. Signed-off-by: Markus Mayer --- Makefile | 3 +++ system/Config.in | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/Makefile b/Makefile index a58ca7821d2d..9bf9f1aa05ee 100644 --- a/Makefile +++ b/Makefile @@ -579,6 +579,9 @@ $(BUILD_DIR)/buildroot-config/auto.conf: $(BR2_CONFIG) .PHONY: prepare prepare: $(BUILD_DIR)/buildroot-config/auto.conf + @$(foreach s, $(call qstrip,$(BR2_ROOTFS_PRE_BUILD_SCRIPT)), \ + $(call MESSAGE,"Executing pre-build script $(s)"); \ + $(EXTRA_ENV) $(s) $(TARGET_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep)) .PHONY: world world: target-post-image diff --git a/system/Config.in b/system/Config.in index c8c5be40e096..7b890aed1abb 100644 --- a/system/Config.in +++ b/system/Config.in @@ -518,6 +518,16 @@ config BR2_ROOTFS_OVERLAY They are copied as-is into the rootfs, excluding files ending with ~ and .git, .svn and .hg directories. +config BR2_ROOTFS_PRE_BUILD_SCRIPT + string "Custom scripts to run before commencing the build" + default "" + help + Specify a space-separated list of scripts to be run before the + build commences. + + This gives users the opportunity to do board-specific + preparations before starting the build. + config BR2_ROOTFS_POST_BUILD_SCRIPT string "Custom scripts to run before creating filesystem images" default ""