From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: "Michal Suchánek" <msuchanek@suse.de>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Takashi Iwai <tiwai@suse.de>, Andreas Schwab <schwab@suse.de>,
Michal Kubecek <mkubecek@suse.cz>,
Michal Marek <michal.lkml@markovi.net>,
Jonathan Corbet <corbet@lwn.net>,
Yoshinori Sato <ysato@users.sourceforge.jp>,
Rich Felker <dalias@libc.org>,
"David S. Miller" <davem@davemloft.net>,
Jeff Dike <jdike@addtoit.com>,
Richard Weinberger <richard@nod.at>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
X86 ML <x86@kernel.org>, Kees Cook <keescook@chromium.org>,
Philippe Ombredanne <pombredanne@nexb.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Ulf Magnusson <ulfalizer@gmail.com>,
Jeff Mahoney <jeffm@suse.com>,
"Peter Zijlstra," <peterz@infradead.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Frederic Weisbecker <frederic@kernel.org>,
Randy Dunlap <rdunlap@infradead.org>,
Dominik Brodowski <linux@dominikbrodowski.net>,
Nicholas Piggin <npiggin@gmail.com>,
Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
"open list:DOCUMENTATION" <linux-doc@vger.kernel.org>,
Linux-sh list <linux-sh@vger.kernel.org>,
sparclinux <sparclinux@vger.kernel.org>,
linux-um@lists.infradead.org
Subject: Re: due to kconfig changes kernel config file is no longer sufficient for configuring the kernel
Date: Mon, 3 Sep 2018 19:06:00 +0900 [thread overview]
Message-ID: <CAK7LNAQ5Q-DPL006UJzs-dAhMo5Cdaa9P+UAD+XL67QvPw353g@mail.gmail.com> (raw)
In-Reply-To: <20180820233331.08dd2bfb@naga.suse.cz>
Hi,
2018-08-21 6:33 GMT+09:00 Michal Suchánek <msuchanek@suse.de>:
> Hello,
>
> On Tue, 21 Aug 2018 03:15:12 +0900
> Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
>
>> 2018-08-07 3:07 GMT+09:00 Michal Suchánek <msuchanek@suse.de>:
>> > On Mon, 30 Jul 2018 17:02:42 +0900
>> > Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
>> >
>> >> 2018-06-28 18:16 GMT+09:00 Michal Suchánek <msuchanek@suse.de>:
>> >> > On Wed, 27 Jun 2018 23:07:21 +0900
>> >> > Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
>> >> >
>
>> >>
>> >>
>> >>
>> >> >>
>> >> >> out-of-tree modules are built with exactly the same
>> >> >> configuration as used for the kernel.
>> >> >
>> >> > It is not true. And that is the problem. You need the config file
>> >> > and dump of the environment passed to the make command at
>> >> > configuration time to get the exact same configuration. The
>> >> > environment is not saved anywhere, though.
>> >>
>> >>
>> >> Why dump of the environment?
>> >>
>> >>
>> >> If you are building external modules natively
>> >> your distribution provides /lib/modules/$(uname -r)/build,
>> >> which contains files enough for building external modules.
>> >>
>> >> You can pass the directory path to M=... parameter. That's it.
>> >
>> > No, that's not it. Since passing ARCH=i386 is the de-facto standard
>> > to configure a 32bit kernel and the result of passing that was not
>> > saved you need to pass it to make as well.
>>
>>
>> If you pass ARCH= for the configuration phase,
>> you need to pass the same ARCH= in the build phase.
>>
>>
>>
>>
>> What I can suggest for you is:
>>
>>
>> $ make ARCH=i386 defconfig
>> $ make ARCH=i386
>>
>> OR
>>
>> $ make i386_defconfig
>> $ make
>
> Maybe you missed that but I do not want to build the defconfig. I want
> to build a *particular* config which has been saved in a file
> beforehand.
>>
>> > And you need to patch a number of
>> > 3rd party build scripts that build a kernel module as part of a
>> > bigger project.
>>
>>
>> You do not need to patch a number of scripts.
>>
>> Just one liner fix.
>> Add 'export ARCH=i386' in the top level script.
>
> And that does not work because there is no toplevel script. rpm has
> three toplevel scripts - prep, build and install.
OK, I understood real problem cases.
I wrote patches to support non-interactive .config updates.
For package building like rpm, deb, etc.
the target ARCH is determined when creating a source package.
If so, it would not hurt to hard-code to record ARCH in the spec file.
> Building out-of-tree module is another toplevel script.
As I said before, the .config is not reconfigured
when building out-of-tree modules.
Out-of-tree modules are built with the .config
that has been used to build vmlinux
regardless of whether you pass ARCH=i386, ARCH=x86_64, or nothing.
If rpmbuild is given target option like 'rpmbuild --target i386 ...",
it think it makes sense to propagate it to ARCH=.
> And it does not suffice to 'export ARCH=i386'. What if it was a 64bit
> config? How do I tell?
>
> With more and more options left out of the config that depend on
> compiler features, environment variables, phase of the moon or whatnot
> you can't even tell what kind of kernel the user is running by looking
> at the config.
I added non-interactive .config update.
Please try it.
--
Best Regards
Masahiro Yamada
next prev parent reply other threads:[~2018-09-03 10:07 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-27 12:37 due to kconfig changes kernel config file is no longer sufficient for configuring the kernel Michal Suchánek
2018-06-27 14:07 ` Masahiro Yamada
2018-06-28 9:16 ` Michal Suchánek
2018-07-26 8:33 ` Michal Suchánek
2018-07-30 8:02 ` Masahiro Yamada
2018-08-06 18:07 ` Michal Suchánek
2018-08-20 18:15 ` Masahiro Yamada
2018-08-20 18:37 ` Takashi Iwai
2018-09-03 10:23 ` Masahiro Yamada
2018-08-20 21:33 ` Michal Suchánek
2018-09-03 10:06 ` Masahiro Yamada [this message]
2018-08-06 18:33 ` Michal Kubecek
2018-08-20 18:24 ` Masahiro Yamada
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAK7LNAQ5Q-DPL006UJzs-dAhMo5Cdaa9P+UAD+XL67QvPw353g@mail.gmail.com \
--to=yamada.masahiro@socionext.com \
--cc=corbet@lwn.net \
--cc=dalias@libc.org \
--cc=davem@davemloft.net \
--cc=frederic@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=hpa@zytor.com \
--cc=jdike@addtoit.com \
--cc=jeffm@suse.com \
--cc=keescook@chromium.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=linux-um@lists.infradead.org \
--cc=linux@dominikbrodowski.net \
--cc=mathieu.desnoyers@efficios.com \
--cc=michal.lkml@markovi.net \
--cc=mingo@redhat.com \
--cc=mkubecek@suse.cz \
--cc=msuchanek@suse.de \
--cc=npiggin@gmail.com \
--cc=peterz@infradead.org \
--cc=pombredanne@nexb.com \
--cc=rdunlap@infradead.org \
--cc=richard@nod.at \
--cc=schwab@suse.de \
--cc=sparclinux@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=tiwai@suse.de \
--cc=ulfalizer@gmail.com \
--cc=x86@kernel.org \
--cc=ysato@users.sourceforge.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).