From patchwork Thu Oct 25 02:20:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nasser Afshin X-Patchwork-Id: 988890 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.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Nmv1m+Ez"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42gW7s5N0cz9sBZ for ; Thu, 25 Oct 2018 13:20:56 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id B56E786FA4; Thu, 25 Oct 2018 02:20:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 11u9Kl1lVi-Z; Thu, 25 Oct 2018 02:20:52 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id C22A286F78; Thu, 25 Oct 2018 02:20:52 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 43B3E1BF336 for ; Thu, 25 Oct 2018 02:20:52 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 40D8388639 for ; Thu, 25 Oct 2018 02:20:52 +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 cu4XqyBnK2sz for ; Thu, 25 Oct 2018 02:20:51 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by hemlock.osuosl.org (Postfix) with ESMTPS id 58E3D885F6 for ; Thu, 25 Oct 2018 02:20:51 +0000 (UTC) Received: by mail-wm1-f65.google.com with SMTP id r63-v6so7264218wma.4 for ; Wed, 24 Oct 2018 19:20:51 -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=C9e0dgkrk1V9tlSwpvXu+WphQ9ocaBUx2pp7iRaY2Go=; b=Nmv1m+EzwN50pTQ8U+euP7PH4PJNLdL156uKL1/wv8H7dWSvo1m+HZcE+2dniyJuct WRCrH+/zVHwJ9rS6qzaL8sjCKRTGW9Hc4Urnwp1d8qzmuhwMyCz/a1UJFfQbsBslgvBN plwcaXqsG0pZLDEPGDt2ftdbzv04CrOiHoXXL1Nec981F5ZJ8HDV1HSSWcqiTLPH2dEv BMYD1Xt5Pcvl+YhuHLmTncHkc0NS8s1ah+yReygiCN5tI3H0sVrVDcSj5NiIy2hdvEgU 29UM3StmdaGDB6K/Uuc4Cqi/eXncDf14u9sfotqNMI6OAWYK50tET9h38tanWl7Rcwer n5Wg== 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=C9e0dgkrk1V9tlSwpvXu+WphQ9ocaBUx2pp7iRaY2Go=; b=eds4I+1NHKTgVck9aP9U3SJab1s/XLKTNsgJ4jekLPPzWY529rXywZ1SMlQtXKpMKj vZTYQ12Ikan3y0s4RiKqcfAZ8NzKNYut8YXwCQRecAsWCa6yUFaGt9oI4FJoZ4n0mLAE OA5/jjd4Iz3mqJ5EUJZPv+hr1rgqU09PZUvjp/hNwiQvpNoxo+bjPDVJn4WFHfpTBhk4 Mw9zOTV5IwC3WOPnBrlF3ozO1xUOqKBUboblvJBDuYup45faS0uMTEd++obUgSjwZZoh fWhKZvSWdHvXSC6dVWAemNmD27gDoy+ZK466VsuC/x91pU9VGjYVVMqQxSc86dIzTarJ RORg== X-Gm-Message-State: AGRZ1gL71EjDAOcrIIBSOe1firx6gFqrhTh5ykpI+0WeWwXVKr9T1FGd ui9ug8Rax6PONh0WmIYGOmw= X-Google-Smtp-Source: AJdET5fzP3pPoZb1i/g3VWod85KqB/+1jlTsL8aYZkLoemaN6SVRCHwQt+mGTn1ezlqPiHaSZ2sjtg== X-Received: by 2002:a7b:c1c6:: with SMTP id a6-v6mr79070wmj.18.1540434049693; Wed, 24 Oct 2018 19:20:49 -0700 (PDT) Received: from localhost.localdomain ([151.239.92.136]) by smtp.gmail.com with ESMTPSA id y16-v6sm6342819wru.18.2018.10.24.19.20.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Oct 2018 19:20:48 -0700 (PDT) From: Nasser Afshin To: Arnout Vandecappelle Date: Thu, 25 Oct 2018 05:50:31 +0330 Message-Id: <20181025022031.14043-1-afshin.nasser@gmail.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20181025011343.29512-1-afshin.nasser@gmail.com> References: <20181025011343.29512-1-afshin.nasser@gmail.com> Subject: [Buildroot] [PATCH v3] merge_config.sh: merge also buildroot config files 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: Nasser Afshin , buildroot MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Angelo Compagnucci 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 Signed-off-by: Nasser Afshin Reviewed-by: Petr Vorel --- I forgot to apply the presented patch. Now it's applied. support/kconfig/merge_config.sh | 9 ++++- ...18-fix-finding-redundant-config-mechanism.patch | 41 ++++++++++++++++++++++ support/kconfig/patches/series | 1 + 3 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 support/kconfig/patches/18-fix-finding-redundant-config-mechanism.patch diff --git a/support/kconfig/merge_config.sh b/support/kconfig/merge_config.sh index 67d1314476..f22198023c 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,7 @@ RUNMAKE=true ALLTARGET=alldefconfig WARNREDUN=false OUTPUT=. +CONFIG_PREFIX=CONFIG_ while true; do case $1 in @@ -71,6 +73,11 @@ while true; do shift 2 continue ;; + "-b") + CONFIG_PREFIX=BR2_ + shift + continue + ;; *) break ;; @@ -99,7 +106,7 @@ if [ ! -r "$INITFILE" ]; then fi 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 ./.tmp.config.XXXXXXXXXX) echo "Using $INITFILE as base" diff --git a/support/kconfig/patches/18-fix-finding-redundant-config-mechanism.patch b/support/kconfig/patches/18-fix-finding-redundant-config-mechanism.patch new file mode 100644 index 0000000000..eec92a5fad --- /dev/null +++ b/support/kconfig/patches/18-fix-finding-redundant-config-mechanism.patch @@ -0,0 +1,41 @@ +Index: kconfig/merge_config.sh +=================================================================== +--- kconfig.orig/merge_config.sh ++++ 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,7 @@ RUNMAKE=true + ALLTARGET=alldefconfig + WARNREDUN=false + OUTPUT=. ++CONFIG_PREFIX=CONFIG_ + + while true; do + case $1 in +@@ -71,6 +73,11 @@ while true; do + shift 2 + continue + ;; ++ "-b") ++ CONFIG_PREFIX=BR2_ ++ shift ++ continue ++ ;; + *) + break + ;; +@@ -99,7 +106,7 @@ if [ ! -r "$INITFILE" ]; then + fi + + 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 ./.tmp.config.XXXXXXXXXX) + + echo "Using $INITFILE as base" diff --git a/support/kconfig/patches/series b/support/kconfig/patches/series index 36591e2189..5ebc2e0225 100644 --- a/support/kconfig/patches/series +++ b/support/kconfig/patches/series @@ -6,3 +6,4 @@ 14-support-out-of-tree-config.patch 16-fix-space-to-de-select-options.patch 17-backport-kecho.patch +18-fix-finding-redundant-config-mechanism.patch