From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: MIME-Version: 1.0 In-Reply-To: <20180820233331.08dd2bfb@naga.suse.cz> References: <20180627143705.5a1fed1c@kitsune.suse.cz> <20180628111623.3807fe9b@naga.suse.cz> <20180806200725.4efa5d35@kitsune.suse.cz> <20180820233331.08dd2bfb@naga.suse.cz> From: Masahiro Yamada Date: Mon, 3 Sep 2018 19:06:00 +0900 Message-ID: Subject: Re: due to kconfig changes kernel config file is no longer sufficient for configuring the kernel Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-sh-owner@vger.kernel.org To: =?UTF-8?Q?Michal_Such=C3=A1nek?= Cc: Linux Kernel Mailing List , Takashi Iwai , Andreas Schwab , Michal Kubecek , Michal Marek , Jonathan Corbet , Yoshinori Sato , Rich Felker , "David S. Miller" , Jeff Dike , Richard Weinberger , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , X86 ML , Kees Cook , Philippe Ombredanne , Greg Kroah-Hartman , Ulf Magnusson , Jeff Mahoney , "Peter Zijlstra," , Mathieu Desnoyers , Frederic Weisbecker , Randy Dunlap , Dominik Brodowski , Nicholas Piggin , Linux Kbuild mailing list , "open list:DOCUMENTATION" , Linux-sh list , sparclinux , linux-um@lists.infradead.org List-ID: Hi, 2018-08-21 6:33 GMT+09:00 Michal Such=C3=A1nek : > Hello, > > On Tue, 21 Aug 2018 03:15:12 +0900 > Masahiro Yamada wrote: > >> 2018-08-07 3:07 GMT+09:00 Michal Such=C3=A1nek : >> > On Mon, 30 Jul 2018 17:02:42 +0900 >> > Masahiro Yamada wrote: >> > >> >> 2018-06-28 18:16 GMT+09:00 Michal Such=C3=A1nek : >> >> > On Wed, 27 Jun 2018 23:07:21 +0900 >> >> > Masahiro Yamada 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=3D... parameter. That's it. >> > >> > No, that's not it. Since passing ARCH=3Di386 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=3D for the configuration phase, >> you need to pass the same ARCH=3D in the build phase. >> >> >> >> >> What I can suggest for you is: >> >> >> $ make ARCH=3Di386 defconfig >> $ make ARCH=3Di386 >> >> 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=3Di386' 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=3Di386, ARCH=3Dx86_64, or nothing. If rpmbuild is given target option like 'rpmbuild --target i386 ...", it think it makes sense to propagate it to ARCH=3D. > And it does not suffice to 'export ARCH=3Di386'. 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. --=20 Best Regards Masahiro Yamada