Re: hidden string Kconfig ?

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

 



On Thu, Nov 15, 2018 at 9:50 AM Randy Dunlap <rdunlap@xxxxxxxxxxxxx> wrote:
>
> On 11/14/18 4:47 PM, Daniel Walker wrote:
> > On Wed, Nov 14, 2018 at 04:37:43PM -0800, Randy Dunlap wrote:
> >> On 11/14/18 4:07 PM, Daniel Walker wrote:
> >>> On Wed, Nov 14, 2018 at 03:16:17PM -0800, Randy Dunlap wrote:
> >>>> 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"
> >>>>
> >>>>
> >>>> and "make oldconfig" gives me a .config file that contains:
> >>>> CONFIG_SPECIAL_STRING="special"
> >>>
> >>> I have this (in init/Kconfig),
> >>>
> >>> config CMDLINE
> >>>         string
> >>>
> >>> then inside my .config I have this,
> >>> CONFIG_CMDLINE="console=ttyS0"
> >>>
> >>> if you run  "make menuconfig", and change something then save. The
> >>> CONFIG_CMDLINE is gone.
> >>>
> >>> What I would want is for that option to remain untouched.
> >>
> >> Interesting.  I guess luckily for me I was testing with today's linux-next,
> >> which contains the CMDLINE Kconfig symbols in init/Kconfig, including this one:
> >>
> >> config CMDLINE
> >>      string ""
> >>
> >>
> >> and that does work with your "console=ttyS0" + make oldconfig or make xconfig.
> >>
> >> But apparently the string does need to have a prompt ("").
> >> Without that (as you listed it), the value does disappear.
> >
> > Yeah, the patch your talking about is from my -next tree. I'm trying to get rid
> > of the prompt .. There is no description, and no one should be setting that.
> > It's only there so that people don't lose their old CONFIG_CMDLINE.
>
> Yeah, not surprised to hear that.
>
> > It seems like Kconfig should be able to handle this because you may have an
> > obsolete string option which you may want to retain silently in the Kconfig.
>
> OK, I'll let the kconfig maintainer comment on that.



In current Kconfig, a 'string' type symbol is written to the .config when

[1] it has a visible prompt
    https://github.com/masahir0y/linux/blob/v4.19/scripts/kconfig/symbol.c#L364

   or

[2] it has a default property
    https://github.com/masahir0y/linux/blob/v4.19/scripts/kconfig/symbol.c#L421



I am open to changing the behavior
as long as it keeps grammatical consistency, though.


As far as I understood this particular case,
CONFIG_CMDLINE will go away after the GENERIC_CMDLINE migration is done.

(At least, upstream x86 and powerpc defconfig files seem complete).



Perhaps, some prompt for migration could be useful?

config CMDLINE
        string "(LEGACY) Please make this empty and use CMDLINE_PREPEND instead"




-- 
Best Regards
Masahiro Yamada



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

  Powered by Linux