From patchwork Fri Nov 2 11:41:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anders Roxell X-Patchwork-Id: 10665309 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 92FF415E9 for ; Fri, 2 Nov 2018 11:41:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C64A2B559 for ; Fri, 2 Nov 2018 11:41:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6E6032B567; Fri, 2 Nov 2018 11:41:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 06D532B559 for ; Fri, 2 Nov 2018 11:41:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726085AbeKBUs2 (ORCPT ); Fri, 2 Nov 2018 16:48:28 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:43783 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726041AbeKBUs2 (ORCPT ); Fri, 2 Nov 2018 16:48:28 -0400 Received: by mail-lf1-f66.google.com with SMTP id u18so1100656lff.10 for ; Fri, 02 Nov 2018 04:41:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=Mj2QZxUx6dVHSn2ZCozI/Vd9NNqleLHIpi3vz3MvkLE=; b=NMF1q5mGzw/98bEjtQILZ5uky78p9bTsaHK7klILVQ2s+wV4x0D7In1RNDQTJd/o1f iuaL4CEdJaiVWbAc09r/jZub31Ev0pR6QauLktPLenv61KCydYRC1R/ci4Lekzit+eN8 rQT/KhXjsPCOXwQPmlr+Jng1MoTyuDPUur2yg= 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; bh=Mj2QZxUx6dVHSn2ZCozI/Vd9NNqleLHIpi3vz3MvkLE=; b=ecKlVW3dLfLu/W0hj/XVhp0nxdF83l4qsq0c1oLCuxLZRmfM2CgYsG0rf5T/a2y6pt 23QARr1u7I07W2pSaBph/L3Xt0D5SJmfsTk8Sfs4AQGsSyULHD2MGFqBGcSMIzrlqL2M F6JWrMa5b+HlNJBAZnHd7B9D2ypm64jwyeFQ4k9MyJZLJSbsQ0buRzSUw0lm2Zc2J1Ho QHB21ZDWFsq6hs7iioBia3Z/feRGKO+aqenvuL1dh3IKFVAQHNLYhdI+HdAc/UAItoKY Poge49cb8/gCeac15g3NloMYm9GcIotTAz1uw+iJd5gyvXqY7FKs5yqTSgw7gyea4+LN ThcA== X-Gm-Message-State: AGRZ1gKyUytzMBl8NKGm0WwbUsnBFJDK01cXV0xJFlg7LmsP5YtdhNir ZDvoOojp8CZJm+/X4H8myTjnjg== X-Google-Smtp-Source: AJdET5cEbNjTJzF8LdoF+A2UfOO/3Dp+e3TmYNsMNlnzb7/I2HXZ9qEE14LtWzsXhGwMGg3KazBE+g== X-Received: by 2002:a19:914b:: with SMTP id y11mr6351934lfj.98.1541158892788; Fri, 02 Nov 2018 04:41:32 -0700 (PDT) Received: from localhost (c-732171d5.07-21-73746f28.bbcust.telenor.se. [213.113.33.115]) by smtp.gmail.com with ESMTPSA id k9-v6sm630668ljk.97.2018.11.02.04.41.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 02 Nov 2018 04:41:32 -0700 (PDT) From: Anders Roxell To: yamada.masahiro@socionext.com Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, dvhart@infradead.org, arnd@arndb.de, Anders Roxell Subject: [PATCH] scripts/kconfig/merge_config: don't redefine 'y' to 'm' Date: Fri, 2 Nov 2018 12:41:19 +0100 Message-Id: <20181102114119.23859-1-anders.roxell@linaro.org> X-Mailer: git-send-email 2.11.0 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In today's merge_config.sh the order of the config fragment files dictates the output of a config option. With this approach we will get different .config files depending on the order of the config fragment files. Adding a switch to add precedence for builtin over modules, this will make the .config file the same Suggested-by: Arnd Bergmann Signed-off-by: Anders Roxell --- scripts/kconfig/merge_config.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh index da66e7742282..902a60b45614 100755 --- a/scripts/kconfig/merge_config.sh +++ b/scripts/kconfig/merge_config.sh @@ -32,6 +32,7 @@ usage() { 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" + echo " -y make builtin have precedence over modules" echo " -O dir to put generated output files. Consider setting \$KCONFIG_CONFIG instead." echo echo "Used prefix: '$CONFIG_PREFIX'. You can redefine it with \$CONFIG_ environment variable." @@ -40,6 +41,7 @@ usage() { RUNMAKE=true ALLTARGET=alldefconfig WARNREDUN=false +BUILTIN=false OUTPUT=. CONFIG_PREFIX=${CONFIG_-CONFIG_} @@ -64,6 +66,11 @@ while true; do shift continue ;; + "-y") + BUILTIN=true + shift + continue + ;; "-O") if [ -d $2 ];then OUTPUT=$(echo $2 | sed 's/\/*$//') @@ -122,7 +129,13 @@ for MERGE_FILE in $MERGE_LIST ; do grep -q -w $CFG $TMP_FILE || continue PREV_VAL=$(grep -w $CFG $TMP_FILE) NEW_VAL=$(grep -w $CFG $MERGE_FILE) - if [ "x$PREV_VAL" != "x$NEW_VAL" ] ; then + if test "$BUILTIN" = "true" && echo $PREV_VAL |grep -Eq '^\w+=y' && echo $NEW_VAL |grep -Eq '^\w+=m' ; then + echo Value of $CFG is \'y\' and we don\'t want to redefine the fragment $MERGE_FILE: + echo Previous value: $PREV_VAL + echo New value: $NEW_VAL + echo Will use previous value. + echo + elif [ "x$PREV_VAL" != "x$NEW_VAL" ] ; then echo Value of $CFG is redefined by fragment $MERGE_FILE: echo Previous value: $PREV_VAL echo New value: $NEW_VAL