From patchwork Fri Feb 16 18:38:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 128627 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp870567ljc; Fri, 16 Feb 2018 10:49:31 -0800 (PST) X-Google-Smtp-Source: AH8x226AVLJMAN7jHX+Q5TwhXYEyMyVeL+NAQATz76Qa2ddYBvrz0e9dFazxliOdtMr+AUtxf1+j X-Received: by 10.98.253.17 with SMTP id p17mr2208364pfh.105.1518806971528; Fri, 16 Feb 2018 10:49:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518806971; cv=none; d=google.com; s=arc-20160816; b=K967ffg02PsLPZNd8jp3Q9eQv9VCbvXkekokCczVoetsSCAy0D/+abP1NPu4AgxWzZ 7kUo2mXhvBlctSDc+0STdKAiBfaMysqini0hQ001kt+uYQmUVkwOWhnoizdeKDcQ+dFc ksUCmuyxFXBuEEIleMgj/O9Cj0jjentBrZe/w4HpI/b8uYwm07w4DpNe6Nrn8MMp8LCV HDn6UrNBjiMQC29GN+NCGLjp6BmisaS1XS3kBWOL8fhK9wci3zQw5kNwi3KBvUwdaoKV iWd29Ed6KRJiRGaG8rozM+6uoUuzzgiqGNHGJKHoqrKepfEnKIiHe3fDFdW7ewzFqXbv ceIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=5v0/HrzAJlD9iSgCxrOCACm9vCZI9W7j1VzmKYbwL2Y=; b=qXgVWgX9TaZFyo+9V+oU8gAQed2kE/SzAhhqMVziHcn9/8gGaPsTqOmx5VfaMptTNB 7t9kKQ7LWeiccNSvpV5GbJdzGmHT9Ak6RX1X63on0MZBycrYmgNNYqxwfc0sAXZ+vhQp icgLcotiEaG3Mh79pqMnwrCRNAtyPKtms980CJ+m5/GEQgBcy0lFDBA1Y2Z6toIu5pO1 B4dRzhejxoLPCIk5j2rbO1+98oNrPXeXnQowWtiOVT4qAQH51wP8v6IzJLbRV4ms9Qpy xCYsrN+JVRZCZKyKw4x9OtsSTkrcQwaIzZMTNVKrmC4fHjsCZo3SfY3MAAcJ6tLHxbYD iNnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=jgNgpdo1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f5si12574pgr.235.2018.02.16.10.49.31; Fri, 16 Feb 2018 10:49:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=jgNgpdo1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752003AbeBPSsA (ORCPT + 28 others); Fri, 16 Feb 2018 13:48:00 -0500 Received: from conuserg-07.nifty.com ([210.131.2.74]:57766 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752657AbeBPSlS (ORCPT ); Fri, 16 Feb 2018 13:41:18 -0500 Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-07.nifty.com with ESMTP id w1GIdBT7013418; Sat, 17 Feb 2018 03:39:16 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com w1GIdBT7013418 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1518806356; bh=5v0/HrzAJlD9iSgCxrOCACm9vCZI9W7j1VzmKYbwL2Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jgNgpdo15pK7YCpwxKoWxUm00nyR5hItRvmC3oe9rT/yci83X39iW//SRa6VwbIuo kRFleu1DuHAilsgoIN4dX6uVdbw0aUWK6Lr23Augg7JKK8/XOTMeNbW+rSTtsyK8Od G7No9F/4cZzwxZOQGr9PCy4jLZ9yRsiD1iAh15eVu/meC1U/zoF2FmlhogGDq7LpBn 0ooIFAiHVEaHx5tIbbRhItynv+3CfmtXgkdI11+KO6plBVkc8ACkmF+BnF5aHCzhSz JLQsagApZQ0MoLO902pKr4nx5rwhIoyslaXSaeri7aKXnzq18c3qfGTWWbl8Oai2Bp FR1TdLg0qUJIA== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org, Linus Torvalds Cc: Greg Kroah-Hartman , Arnd Bergmann , Kees Cook , Randy Dunlap , Ulf Magnusson , Sam Ravnborg , Michal Marek , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH 04/23] kconfig: set SYMBOL_AUTO to the symbol marked with defconfig_list Date: Sat, 17 Feb 2018 03:38:32 +0900 Message-Id: <1518806331-7101-5-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518806331-7101-1-git-send-email-yamada.masahiro@socionext.com> References: <1518806331-7101-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The 'defconfig_list' is a weird attribute. If the '.config' is missing, conf_read_simple() iterates over all visible defaults, then it uses the first one for which fopen() succeeds. config DEFCONFIG_LIST string depends on !UML option defconfig_list default "/lib/modules/$UNAME_RELEASE/.config" default "/etc/kernel-config" default "/boot/config-$UNAME_RELEASE" default "$ARCH_DEFCONFIG" default "arch/$ARCH/defconfig" However, like other symbols, the first visible default is always written out to the .config file. This might be different from what has been actually used. For example, on my machine, the third one "/boot/config-$UNAME_RELEASE" is opened, like follows: $ rm .config $ make oldconfig 2>/dev/null scripts/kconfig/conf --oldconfig Kconfig # # using defaults found in /boot/config-4.4.0-112-generic # * * Restart config... * * * IRQ subsystem * Expose irq internals in debugfs (GENERIC_IRQ_DEBUGFS) [N/y/?] (NEW) However, the resulted .config file contains the first one since it is visible: $ grep CONFIG_DEFCONFIG_LIST .config CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" In order to stop confusing people, prevent this CONFIG option from being written to the .config file. Signed-off-by: Masahiro Yamada --- I'd like to fix the root case of this weirdness later. (and other 'option' attributes as well) But, this series is focusing a more important work in a bigger picture. For now, I decided to just hide CONFIG_DEFCONFIG_LIST from the .config file. scripts/kconfig/menu.c | 1 + 1 file changed, 1 insertion(+) -- 2.7.4 Reviewed-by: Ulf Magnusson diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index 9922285..36cd3e1 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c @@ -212,6 +212,7 @@ void menu_add_option(int token, char *arg) sym_defconfig_list = current_entry->sym; else if (sym_defconfig_list != current_entry->sym) zconf_error("trying to redefine defconfig symbol"); + sym_defconfig_list->flags |= SYMBOL_AUTO; break; case T_OPT_ENV: prop_add_env(arg);