From patchwork Tue Oct 10 20:43:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 824051 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@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; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="gXZWAx4V"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yBTbh5LCCz9sBd for ; Wed, 11 Oct 2017 07:43:44 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 2A35A302BC; Tue, 10 Oct 2017 20:43:43 +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 5j7AQRGDXx5w; Tue, 10 Oct 2017 20:43:42 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 7C95430313; Tue, 10 Oct 2017 20:43:42 +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 0E02C1C232E for ; Tue, 10 Oct 2017 20:43:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 00F5F30313 for ; Tue, 10 Oct 2017 20:43:39 +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 w5KnKKJ0alZS for ; Tue, 10 Oct 2017 20:43:38 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by silver.osuosl.org (Postfix) with ESMTPS id 151CF302BC for ; Tue, 10 Oct 2017 20:43:38 +0000 (UTC) Received: by mail-wm0-f66.google.com with SMTP id 131so230896wmk.3 for ; Tue, 10 Oct 2017 13:43:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KSShLGlwKvspjDOT2XtuDItvF0l3TXSayyNoTHuYQmM=; b=gXZWAx4VumqTqd0yAbkFLvvaTT134U64fCoeKFG3Dr6S+pBwR4xbJp/LTKkR5bXofs z8DLYPz++HmR9X7cMWa+xU5fzzIT8vHzdVDv+1B62RM/VNiwLAcVjiiwahCr2Zqwhxhk PZWh3B3V5upKSG2/o6l+EMbwWiKaGouHhch+wV/QOk9F0iGdLmPdWIigDNMs9NnsKypi JeEd7agBnkP4bd+dGYcOqvBQYEyXtFKk2lE+9ta37wzlI1tu9BdCOBab+CTzFxwBw6CS RpOkTb1d4I1Ug6gCNqCcH5F+P3GDNtS3aAEpON+odpIPOWgkSni5mqHLMJQH/QoArVdD AydQ== 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=KSShLGlwKvspjDOT2XtuDItvF0l3TXSayyNoTHuYQmM=; b=J4tow52RYgfZDnuPibu8jGPpBsBbchC+YPfZmcr19dVH27D1Azy9A0X4fCrYSekbUW 5gVuxWe2pQmhdBkHAthVdMPhvjC+wngBY7iRT+CG/OrAnN416zLSiWpFdTGY4DNfY6Va 4F61LNSNQ0lnqg0nn2/MReGijodlzd1GWVH/nYo0A1Gk/0XZf6h/x+jMrHpF4G7gH+ST P4jQF2NLOeP12DjgjZt5xePMVedsZWnLz6bllw9S3YZHIz8TFi4jgvGO3OEGzyXC86gz qUQH+j+IqsJP7VTXm8NySx6fjLIo7lpzNWXsC4uSBFcPr/NPug96yft9EYwhcMugbu7+ rH1Q== X-Gm-Message-State: AMCzsaXNQVY1QADifMlYwB0OvaxU+PUbzhyDpVj578/Xw+EAg4TzgnLd gq3yQxPwcO/JqzsJFdEJvQ1+4r0U X-Google-Smtp-Source: AOwi7QD+GHHJ2DiIj/rKZodflvfhYB5bTtj2b2sGmTtqPqY7Wkc9ay3Ky4MkemJ7bPLG1k3XxMQ4Jg== X-Received: by 10.223.132.101 with SMTP id 92mr12843688wrf.85.1507668216144; Tue, 10 Oct 2017 13:43:36 -0700 (PDT) Received: from localhost.localdomain ([89.202.204.147]) by smtp.gmail.com with ESMTPSA id 55sm12339205wrw.60.2017.10.10.13.43.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 Oct 2017 13:43:35 -0700 (PDT) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Tue, 10 Oct 2017 22:43:28 +0200 Message-Id: <1507668210-5427-2-git-send-email-angelo.compagnucci@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1507668210-5427-1-git-send-email-angelo.compagnucci@gmail.com> References: <1507668210-5427-1-git-send-email-angelo.compagnucci@gmail.com> Subject: [Buildroot] [RFC 1/3] support/kconfig/merge_config.sh: merge also buildroot config files X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This patch adds a way to merge buildroot config file programmatically. It adds an option (-b, buildroot mode) to manage buildroot config files. The buildroot mode changes the way the script looks for configurations entries using the BR2_ prefix and modify the call to the make command to be buildroot friendly. Signed-off-by: Angelo Compagnucci --- support/kconfig/merge_config.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/support/kconfig/merge_config.sh b/support/kconfig/merge_config.sh index 8a1708b..cb6e439 100755 --- a/support/kconfig/merge_config.sh +++ b/support/kconfig/merge_config.sh @@ -29,6 +29,7 @@ trap clean_up HUP INT TERM usage() { echo "Usage: $0 [OPTIONS] [CONFIG [...]]" echo " -h display this help text" + echo " -b buildroot mode (searches for BR2_ and uses a custom make command)" echo " -m only merge the fragments, do not execute the make command" echo " -n use allnoconfig instead of alldefconfig" echo " -r list redundant entries when merging fragments" @@ -39,6 +40,8 @@ MAKE=true ALLTARGET=alldefconfig WARNREDUN=false OUTPUT=. +BUILDROOT_MODE=FALSE +CONFIG_PREFIX=CONFIG_ while true; do case $1 in @@ -71,6 +74,12 @@ while true; do shift 2 continue ;; + "-b") + BUILDROOT_MODE=true + CONFIG_PREFIX=BR2_ + shift + continue + ;; *) break ;; @@ -81,7 +90,7 @@ INITFILE=$1 shift; MERGE_LIST=$* -SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(CONFIG_[a-zA-Z0-9_]*\)[= ].*/\2/p" +SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(${CONFIG_PREFIX}[a-zA-Z0-9_]*\)[= ].*/\2/p" TMP_FILE=$(mktemp -t .tmp.config.XXXXXXXXXX) echo "Using $INITFILE as base" @@ -131,7 +140,12 @@ fi # Use the merged file as the starting point for: # alldefconfig: Fills in any missing symbols with Kconfig default # allnoconfig: Fills in any missing symbols with # CONFIG_* is not set +if [ "$BUILDROOT_MODE" = "false" ]; then make KCONFIG_ALLCONFIG=$TMP_FILE $OUTPUT_ARG $ALLTARGET +else +cp $TMP_FILE $OUTPUT/.config +make $OUTPUT_ARG olddefconfig +fi # Check all specified config values took (might have missed-dependency issues)