lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK7LNATQeT8MaQr450x0SpHJV=QU7nrfWfDO1ZRKimppVZG4KA@mail.gmail.com>
Date:   Fri, 12 May 2023 01:15:49 +0900
From:   Masahiro Yamada <masahiroy@...nel.org>
To:     Jiri Slaby <jirislaby@...nel.org>
Cc:     Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
        andreas.noever@...il.com, michael.jamet@...el.com,
        Mika Westerberg <mika.westerberg@...ux.intel.com>,
        YehezkelShB@...il.com, USB list <linux-usb@...r.kernel.org>,
        Linux kernel mailing list <linux-kernel@...r.kernel.org>,
        Steven Rostedt <rostedt@...dmis.org>
Subject: Re: make localmodconfig doesn't work for thunderbolt

+CC Steven Rostedt, author of streamline_config.pl



On Wed, May 10, 2023 at 8:01 PM Jiri Slaby <jirislaby@...nel.org> wrote:
>
> Hi,
>
> if I use localmodconfig for example like this:
> mkdir /tmp/tb/
> echo thunderbolt >/tmp/tb/lsmod
> make O=/tmp/tb LSMOD=/tmp/tb/lsmod localmodconfig
>
> I get:
> using config: '.config'
> thunderbolt config not found!!
>
> $ grep 'USB4\>' /tmp/tb/.config
> # CONFIG_USB4 is not set
>
> I believe it's due to:
>    obj-${CONFIG_USB4} := thunderbolt.o
> in drivers/thunderbolt/Makefile. I.e. ${} used instead of more common $().
>
> But even if I change the parser:
>
> --- a/scripts/kconfig/streamline_config.pl
> +++ b/scripts/kconfig/streamline_config.pl
> @@ -317,7 +317,7 @@ foreach my $makefile (@makefiles) {
>          $_ = convert_vars($_, %make_vars);
>
>          # collect objects after obj-$(CONFIG_FOO_BAR)
> -       if (/obj-\$\((CONFIG_[^\)]*)\)\s*[+:]?=\s*(.*)/) {
> +       if (/obj-\$[({](CONFIG_[^})]*)[)}]\s*[+:]?=\s*(.*)/) {
>              $var = $1;
>              $objs = $2;
>
>
> I see:
> module thunderbolt did not have configs CONFIG_USB4
>
> and:
> $ grep 'USB4\>' /tmp/tb/.config
> # CONFIG_USB4 is not set
>
> So two questions:
> 1) is ${} supported and should be the above change sent as a patch? Or
> should be drivers/thunderbolt/Makefile fixed to use $(). (And maybe
> other Makefiles too.)


I believe streamline_config.pl should be fixed.

There is no good reason to support only $(), but not ${}.


In fact, the comment line around line 395 of this script
uses the curly brace style.

  # a loaded module. This is a direct obj-${CONFIG_FOO} += bar.o






> 2) how to fix that 'thunderbolt did not have configs'?

That warning is CONFIG_USB4 was unset in the resulting .config.

Was CONFIG_USB4 enabled before running localmodconfig?

In my understanding, the purpose of localmodconfig
is to slim down the .config file.

It disables unneeded CONFIG options, but
it does not enable needed CONFIG options.




If I start from allnoconfig (i.e. CONFIG_USB4 is unset), I see the warning.

$ echo thunderbolt >/tmp/tb/lsmod
$ make -s O=/tmp/tb allnoconfig
$ make O=/tmp/tb LSMOD=/tmp/tb/lsmod  localmodconfig
  GEN     Makefile
using config: '.config'
module thunderbolt did not have configs CONFIG_USB4



If I start from allmodconfig (i.e. CONFIG_USB4 is m), I do not see the warning.

$ echo thunderbolt >/tmp/tb/lsmod
$ make -s O=/tmp/tb allmodconfig
$ make O=/tmp/tb LSMOD=/tmp/tb/lsmod  localmodconfig
  GEN     Makefile
using config: '.config'





-- 
Best Regards
Masahiro Yamada

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ