Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp14811990ybl; Mon, 30 Dec 2019 17:57:16 -0800 (PST) X-Google-Smtp-Source: APXvYqzJxSrTG7Ou3fp+H+s+abkx583z1Uhrz9dP7qSZkV5XQ+uYe9WdTwVZQ8LgeQWzY+AkTVb6 X-Received: by 2002:a05:6830:109a:: with SMTP id y26mr73712741oto.227.1577757436304; Mon, 30 Dec 2019 17:57:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577757436; cv=none; d=google.com; s=arc-20160816; b=0BCggYOwT+GS6La/YgvvZEUB9wjzLsJGDMQPLorvMx4EmWnj7Gt1zkyOTR/imr6emE Ckjc3IGa4IGGC9HlaDkRWrBkfO57aNzTqa55dGNQ36TmfozMSP+XkD7y0vgU2pku5ee4 YATW2jDl1Ao5lH5fMfV9d0LRcrsOjq1EYVRI9/9L2JxNQ81I/bBQwSkKGo6Oq/DbdGBf v24lFG7mlP3l6QdEuQtNwGekSG2Plnr9nNELyLnK09IrlQ8pPBNQgnvyrLcbiDp+vJDE xBGkotxmmamguXsB1i9uOZjMHRQ7URg865MNRXhNpdhTstZRNjUXCN86mwXDHy9n7+Fd 5kvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=ApuuxSnOlWyhyWlsLnrZd/9wfqDmn/bch30M7+TIg5s=; b=rkw4F3HaG1wCdlXE37xpB9wmFPkDFjMbfO9ZRu6mU/x4TZwrBm0qblFlENZkkedXz9 4Fuv5fcpfEhHJhI9tmHH7hC+6aYB7OvDD+IlcxuSc1nFWJYsbr0yFs5q8SyfURzSl5yi xWSMbAUDj7xh4dnhxR2NlwopsOLEviSRIzpDMXkNHmQAqduF61YpS6Ui1nhADDmF6yMe +opn27Ka248XTgaxfzbJ5APsHGuDVh4eK0HGy8BWVVoGqe3DMT2zDy5L67hIcElcd3y+ 2v3fG7GdiWFzkMeJHJ8kXazlW0SH6kikO5vDvUEzBjSlMmuHhDsxGCmRA1oJQJIsZuNI wXxg== ARC-Authentication-Results: i=1; mx.google.com; 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 r15si21621707ota.264.2019.12.30.17.57.03; Mon, 30 Dec 2019 17:57:16 -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; 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 S1726538AbfLaBzU (ORCPT + 99 others); Mon, 30 Dec 2019 20:55:20 -0500 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:55071 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725379AbfLaBzU (ORCPT ); Mon, 30 Dec 2019 20:55:20 -0500 Received: from callcc.thunk.org (96-72-102-169-static.hfc.comcastbusiness.net [96.72.102.169] (may be forged)) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id xBV1tF26016563 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 30 Dec 2019 20:55:16 -0500 Received: by callcc.thunk.org (Postfix, from userid 15806) id 66770420485; Mon, 30 Dec 2019 20:55:15 -0500 (EST) Date: Mon, 30 Dec 2019 20:55:15 -0500 From: "Theodore Y. Ts'o" To: Rob Landley Cc: linux-kernel@vger.kernel.org Subject: Re: Why is CONFIG_VT forced on? Message-ID: <20191231015515.GB3669@mit.edu> References: <9b79fb95-f20c-f299-f568-0ffb60305f04@landley.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <9b79fb95-f20c-f299-f568-0ffb60305f04@landley.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 30, 2019 at 06:30:15PM -0600, Rob Landley wrote: > On x86-64 menuconfig, CONFIG_VT is forced on (in drivers->char devices->virtual > terminal), but the help doesn't mention a "selects", and I didn't spot anything > obvious in "find . -name 'Kconfig*' | xargs grep -rw VT". It's forced on because of this: config VT bool "Virtual terminal" if EXPERT ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The above is syntatic sugar for this: bool prompt "Virtual terminal" if EXPERT What this means is that the prompt is shown only if CONFIG_EXPERT is enabled. If CONFIG_EXPERT is not set, then the default value (which for CONFIG_VT is "yes") is used, with no way to change it. Basically, this is because we don't want naive users to build a kernel which displays nothing on the console; for PC class systems, 99.99% of the time, you really do want the virtual terminal enabled. > Congratulations, you've reinvented "come from". I'm mostly familiar with the > kconfig plumbing from _before_ you made it turing complete: how do I navigate this? In the case where something was actually selected, it is explained as such when you search for that config variable. So for example, if you run "make menuconfig", and then type '/' to search for a configuration parameter, and then type "CONFIG_JBD2" and return. What you will see is this: Symbol: JBD2 [=y] │ Type : tristate │ Defined at fs/jbd2/Kconfig:2 │ Depends on: BLOCK [=y] │ Selects: CRC32 [=y] && CRYPTO [=y] && CRYPTO_CRC32C [=y] │ Selected by [y]: │ - EXT4_FS [=y] && BLOCK [=y] │ Selected by [n]: │ - EXT3_FS [=n] && BLOCK [=y] │ - OCFS2_FS [=n] && BLOCK [=y] && NET [=y] && SYSFS [=y] && CONFIGFS_FS [=y] The values in square brackets tell you what the current value of these configuration parameters. So it tells you that CONFIG_JBD2 is yes, CONFIG_BLOCK is yes, EXT3_FS is no, OCFS2_FS is no, etc. It also tells you that it is currently selected automatically because CONFIG_EXT4_FS and CONFIG_BLOCK is enabled. If CONFIG_EXT3_FS and CONFIG_BLOCK was yes, that would also cause CONFIG_JBD2 to be selected. And since CONFIG_JBD2 is enabled, it will force CONFIG_CRC32, CONFIG_CRYPTO, and CONFIG_CRC32C to be selected. It also tells you that you can find the actual definition at fs/jbd2/Kconfig, at line #2. > I'm guessing "stick printfs into the menuconfig binary" is the recommended next > step for investigating this? Or is there a trick I'm missing? See above. The menuconfig configuration parameter search feature tells you all about how a particular CONFIG_XXX, and what dependencies to be enabled in order for you to be able enable that parameter, and why it might have been enabled via the select command. What's not there is an explanation for why a parameter like CONFIG_VT is enabled. Right now, /CONFIG_VT will display: Symbol: VT [=y] Type : bool Prompt: Virtual terminal Location: -> Device Drivers -> Character devices (1) -> Enable TTY (TTY [=y]) Defined at drivers/tty/Kconfig:13 Depends on: TTY [=y] && !UML Selects: INPUT [=y] Now, if you look at line 13 of drivers/tty/Kconfig, you'd see: config VT bool "Virtual terminal" if EXPERT depends on !UML select INPUT default y ---help--- If you say Y here, you will get support for terminal devices with ... Perhaps it would be nice if the output of /CONFIG_VT included something like: Prompt requires CONFIG_EXPERT [=n], default y I'm sure the kbuild maintainers would love to consider a patch which did this. :-) Cheers, - Ted