Re: hidden string Kconfig ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 15, 2018 at 12:16 AM Randy Dunlap <rdunlap@xxxxxxxxxxxxx> wrote:
>
> On 11/14/18 2:32 PM, Daniel Walker wrote:
> > Hi,
> >
> >
> > I'm trying to find out if it's possible to have a string in Kconfig which is
> > hidden from the menu, but still exists in the .config?
> >
> > Like,
> >
> > HIDDEN_STRING
> >       string
> >
> > then in the config file there would be,
> > CONFIG_HIDDEN_STRING="hidden"
> >
> > and the config option wouldn't be used for anything inside Kconfig. It would
> > just get set from the .config , or not be set?
> >
> > The above sample, I've not been able to make work. The string in the .config
> > gets erased when menuconfig runs.
> >
> > Any help appreciated.
>
> Hi,
>
> There are several "string" Kconfig symbols in init/Kconfig that do not have
> a prompt string after them.  I believe that these do what you are asking about.
> If not, please provide your example that is not working.
>
> Or:  this one works for me:
>
> ---
>  init/Kconfig |    4 ++++
>  1 file changed, 4 insertions(+)
>
> --- linux-next-20181114.orig/init/Kconfig
> +++ linux-next-20181114/init/Kconfig
> @@ -1858,6 +1858,10 @@ config CMDLINE
>
>  endif
>
> +config SPECIAL_STRING
> +       string
> +       default "special"
> +
>  endmenu                # General setup
>
>  source "arch/Kconfig"

This will work.

Also worth noting is that assignments to symbols without prompts
('string "prompt"') in .config files have no effect on the symbol's
value when the .config file is read back in by Kconfig. Setting a
symbol's value in a .config file is effectively the same as setting it
in the menuconfig interface.

The reason promptless symbols still get written out is that it makes
.config a complete configuration file, which is important when .config
files are included in Makefiles to read configuration settings from
there (.config files use Make syntax).

As a note, Kbuild includes include/config/auto.conf (a generated
configuration file) instead of .config. That makes the build work even
if .config is outdated (you get an implicit olddefconfig).

Cheers,
Ulf



[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux