Hi all, <https://twitter.com/enzo_dancing> I have just finished reading most of "The Linux Kernel in a Nutshell". 1. I wish I knew about this book two weeks ago 2. I'm currently recompiling my kernel in a VM, by having copied the base .config file from /boot as it's been recompiling, for now, more than an hour, I started having questions and carried on reading the book hoping to find answers. Turns out I don't need every modules and driver that Ubuntu has in its initial .config file for my VM. Having understood that and found all the modules I actually need (thanks find_all_modules.sh). I'm trying to devise a strategy to take the output of that script and make a brand new minimal .config file. However, the only solution I've found is doing it manually via make menuconfig. This seems to be a rather long process, which I wouldn't mind doing if there aren't any other alternatives. Is there any other way? Thanks, Enzo
On Fri, 21 Feb 2020 23:41:10 +0000, Enzo Desiage said:
modules I actually need (thanks find_all_modules.sh). I'm trying to devise a strategy to take the output of that script and make a brand new minimal .config file. However, the only solution I've found is doing it manually via make menuconfig. This seems to be a rather long process, which I wouldn't mind doing if there aren't any other alternatives. Is there any other way?
Step 1: Plug in all your USB widgets and storage and other hot-pluggables long enough for the kernel to load each device's drivers. Step 2: 'make localmodconfig'. This will create a .config that only has those modules that were actually loaded at the time (there's also an option to take the output of an 'lsmod', in case you're doing the builds on a different machine)
Thanks, it worked! I had a look back at the book and couldn't find the command 'make localmodconfig' in "The Linux Kernel in a Nutshell" book, why is that? Was it introduced in recent years?
On Sat, 22 Feb 2020 17:39:03 +0000, Enzo Desiage said:
I had a look back at the book and couldn't find the command 'make localmodconfig' in "The Linux Kernel in a Nutshell" book, why is that? Was it introduced in recent years?
Depends what you call "recent". Looks like v2.6.30-ish. commit 03fa25da8335a942161a8070b3298cfd4edf9b6a Author: Steven Rostedt <srostedt@redhat.com> Date: Wed Apr 29 22:52:22 2009 -0400 kconfig: make localmodconfig to run streamline_config.pl Running the streamline_config.pl script manually can still be confusing for some users. This patch adds the localmodconfig option. This will automatically run streamline_config.pl on the current .config and then run "make silentoldconfig" to fix any wholes that might have been created. $ make localmodconfig This will remove any module configurations in .config that are not needed to compile the modules that are loaded. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Next time try make -j<number of cpu cores + 1 )
I thought it was limited by the number of processor threads? In this case, if each CPU core has just one thread, the +1 does not really serve a purpose? Cheers, On Sun, 23 Feb 2020 at 09:26, Aruna Hewapathirane < aruna.hewapathirane@gmail.com> wrote:
On Sat, Feb 22, 2020 at 12:39 PM Enzo Desiage <enzo@desiage.org> wrote Thanks, it worked!
Next time try make -j<number of cpu cores + 1 ) , that is lets say you have two cores ?
make -j3
usually will cut down compile time in half :-)
Aruna _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-- Pratyush Das(Reik)
Pratyush Das <reikdas@gmail.com> writes:
Next time try make -j<number of cpu cores + 1 )
I thought it was limited by the number of processor threads? In this case, if each CPU core has just one thread, the +1 does not really serve a purpose?
It's not limited. And the processes will compete for more than just CPU resources, so it can make sense to run a few more than you have CPU cores. This gives the scheduler something to work with when some of the make processes are blocking on IO. Personally I often use twice the number of cores, including the hyperthreaded ones. So I run 'make -j16' on a 4 core CPU with HT. You won't see much improvement by overcommitting like this, but it doesn't harm either. Bjørn
On Sat, Feb 22, 2020 at 05:39:03PM +0000, Enzo Desiage wrote:
Thanks, it worked! I had a look back at the book and couldn't find the command 'make localmodconfig' in "The Linux Kernel in a Nutshell" book, why is that? Was it introduced in recent years?
localmodconfig came right after I finished writing that book. It would have made it much easier to write had it been there at the time :) greg k-h
Thanks, it makes more sense now! On Sun, Feb 23, 2020 at 7:31 AM Greg KH <greg@kroah.com> wrote:
On Sat, Feb 22, 2020 at 05:39:03PM +0000, Enzo Desiage wrote:
Thanks, it worked! I had a look back at the book and couldn't find the command 'make localmodconfig' in "The Linux Kernel in a Nutshell" book, why is that? Was it introduced in recent years?
localmodconfig came right after I finished writing that book. It would have made it much easier to write had it been there at the time :)
greg k-h
participants (6)
-
Aruna Hewapathirane -
Bjørn Mork -
Enzo Desiage -
Greg KH -
Pratyush Das -
Valdis Klētnieks