SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Here it takes about 5 minutes to build the kernel (5.11) with config-generic,
and about 35 minutes to build 'bzImage modules'.
I run 'make -j9', CPU is an AMD FX-8320E (eight cores).
My 1st run with the compile pair on 5.10.19 was similar but slightly longer than your numbers. 6 min for the generic kernel portion & 46 minutes for the modules. I need to streamline Pat's scripts to only build those 2 packages without having to build the other 3 packages.
Distribution: slackware, slackware from scratch, LFS, slackware [arm], linux Mint...
Posts: 1,564
Rep:
- on i7-6700 with 16 GB ram (make -j9): time ./build-all-kernels.sh (45 mn)
- on bi-Xeon E5645 with 16 GB ram (make - j25): time ./build-all-kernels.sh (48 mn), it's an old server.
I know that it is comparing apples and oranges but I have just compiled my stable, default kernel that I use to drive my daily -current usage. Today it is 5.10.18 with the following very small changes:
Patched to allow proper operation of my Kindle Oasis (very important to me!!)
Local version added in (-ads)
Built in Ext4 (may as well while I am there!)
So only small changes to the kernel and using PV's config. The following process was then timed:
Code:
make -j 32 bzImage modules && \
make -j 32 modules_install && \
cp -v arch/x86/boot/bzImage /boot/vmlinuz-5.10.18-ads
And this process (which takes up 100% CPU usage of a 16 core Threadripper 2950X) took a total of 7 minutes. And it insulates me against any kernel issues in the future .
Edit: I love the way the newer AMD 5900X / 5950X CPUs chew up this task!!
I know that it is comparing apples and oranges but I have just compiled my stable, default kernel that I use to drive my daily -current usage. Today it is 5.10.18 with the following very small changes:
Patched to allow proper operation of my Kindle Oasis (very important to me!!)
Local version added in (-ads)
Built in Ext4 (may as well while I am there!)
So only small changes to the kernel and using PV's config. The following process was then timed:
Code:
make -j 32 bzImage modules && \
make -j 32 modules_install && \
cp -v arch/x86/boot/bzImage /boot/vmlinuz-5.10.18-ads
And this process (which takes up 100% CPU usage of a 16 core Threadripper 2950X) took a total of 7 minutes. And it insulates me against any kernel issues in the future .
Edit: I love the way the newer AMD 5900X / 5950X CPUs chew up this task!!
Couldn't agree more. My 5930k would take around 20-25 minutes to compile wine. My new 5900x can knock it out in about 7 minutes flat now.
make -j 32 bzImage modules && \
make -j 32 modules_install && \
cp -v arch/x86/boot/bzImage /boot/vmlinuz-5.10.18-ads
And this process (which takes up 100% CPU usage of a 16 core Threadripper 2950X) took a total of 7 minutes. And it insulates me against any kernel issues in the future .
Edit: I love the way the newer AMD 5900X / 5950X CPUs chew up this task!!
A while back (may be around a year now so details are a bit hazy) I did do some test compiles on a 40c/80t (quad 10c/20t) server beast. I probably tested both kernels, firefox and a couple others.
One thing I remember noticing was that on some of those compiles (sorry, don't remember which anymore) the memory footprint peeked at over 200GB RAM. And that server did not do anything but the compiling at the time. So - especially with many threads there may also be a RAM requirement following it. My point being; you can't just throw more CPUs on a problem if you don't have enough RAM for it available also.
One thing I remember noticing was that on some of those compiles (sorry, don't remember which anymore) the memory footprint peeked at over 200GB RAM. And that server did not do anything but the compiling at the time. So - especially with many threads there may also be a RAM requirement following it. My point being; you can't just throw more CPUs on a problem if you don't have enough RAM for it available also.
When I built the computer I thought I went a little crazy when I invested in 32GiB RAM but this turned out to be a decent investment. In part for the compile issues that you have mentioned but also for the running of Virtual Machines. I notice in particular with my Windows 10 VM all allocated RAM is taken completely, no matter what the current windows requirement is. Crazy.
ALso for checking out 32bit and 64bit Slackware 14.2 installations for SBo scripts that I maintain, I can have both VMs open at the same time..
Try to tweak the config suitable for your hardware. It takes about 3mins to compile on thinkpad x230.
I agree, if compiling a custom kernel first things I change in configuration is processor type, then I get rid of most modules which I know I'll never use. I have no recent hardware (I7 4790k) but compilation time is fast enough with stripped down configuration.
During boot only what's needed gets picked from huge and used?
And with the insanely high read speeds of SSDs, any shortened load time must be in millisceonds?
At least that's what I thought, so would you care to enlighten me?
If you have hardware that requires newer kernel than the distro stock kernel (it can happen if you run stable version), if you like some features as built-in rather than as modules, if you want some modules not installed instead of blacklisting them, enable feature not enabled in stock... I aggree for the speed gain being non relevant though
During boot only what's needed gets picked from huge and used?
And with the insanely high read speeds of SSDs, any shortened load time must be in millisceonds?
At least that's what I thought, so would you care to enlighten me?
It's not only customizing for performance. In my case, I stick to kernel series 5.4.x, because it's easier for compatibility reasons, and I also need a few security features enabled.
Distribution: Slackware 15.0 x64, Slackware Live 15.0 x64
Posts: 618
Rep:
Okay gang...for dummies like me - where and how does one get/do the kernel build? I'd like to try it out just for comparison with my 7 year old machine (I build my own when I can afford it, and surviving on a disability check makes that not near as often as I wish I could, so my current system is an AMD FX8350 w/16GB RAM and 14.2 on an SSD), but especially so I can do as keefaz mentions, just for my own reasons to customize my kernel if I decide to do such a thing some time in the future with my Slackware version I'm using at the time hopefully that being whatever Pat is going to name the latest and greatest when he's ready to give it to the world).
Where is one getting Pat's scripts for building kernels and are/is the kernel downloaded from kernel.org or from the same place Pat's scripts are found? Where too does one get the .config file to be adjusted for my customization?
I really did try to look around and search the 'net, but the things that have come up I'm not really sure are what I should use or what everyone in this thread is talking about using.
For instance, the kernel build script I believe is the one being used is here, correct?
The '.config' file would be one of these here? If so, those are for a 5.10.x kernel and I would just change it for whatever version I get/find and download, right?
The scripts are in the source dir as you said, the config file in your /boot and the cookbook did not changed much from 2.6 that's found in the documentation (author Alien Bob, will edit with link).
Where is one getting Pat's scripts for building kernels and are/is the kernel downloaded from kernel.org or from the same place Pat's scripts are found?
Either is fine. The kernels in a Slackware mirror are the same as the ones from kernel.org. I usually grab them from my local Slackware mirror.
Quote:
Originally Posted by FTIO
For instance, the kernel build script I believe is the one being used is here, correct?
You can use Pat's kernel build script, but it builds both the huge and generic kernels and creates packages for the headers, source, modules, and the kernels themselves. That's overkill for my usage. Kernels are the only thing I install without being a package. They're really self-contained, so I've never worried about it. However, if you do want packages, you could continue to use Pat's script.
Quote:
Originally Posted by FTIO
Where too does one get the .config file to be adjusted for my customization?
The '.config' file would be one of these here? If so, those are for a 5.10.x kernel and I would just change it for whatever version I get/find and download, right?
Kernel configs are designed for that specific version, however, configs within the same series (5.10.x) rarely change, so they're usually good to use without modification (although, it's always a good idea to run make oldconfig, just to make sure there aren't any incompatible options).
In case you weren't aware, there is no official kernel terminology for huge and generic kernels. These are Slackware terms and relate to whether most things are compiled into the kernel or compiled as modules. If you're running a 64bit system, simply grab the huge or generic kernel that ends in x64, copy/move it to the root of your extracted kernel source and save it as .config in the root of the directory.
Configuring the kernel can be a lot of work, so many will just use Pat's config, as it has pretty good defaults. If you want to get into configuring your kernel, you can use make menuconfig, make xconfig, or make gconfig. There's far too many options to explain in a post, but they do have a help and they will occasionally say "If unsure, do this".
Once you're ready to build, it's pretty easy:
Code:
make all # Builds the kernel and modules
make modules_install # Installs the modules to /lib/modules/
Then you simply copy your kernel from arch/x86/boot/bzImage to where your bootloader needs it (/boot/ for lilo, /boot/efi/EFI/Slackware/ for elilo), generate an initrd (if needed), and update your bootloader.
Code:
cp arch/x86/boot/bzImage /boot/efi/EFI/Slackware/vmlinuz-generic-5.10.19
$(/usr/share/mkinitrd/mkinitrd_command_generator.sh -k 5.10.19) # Needed for unmodified generic kernel
mv /boot/initrd.gz /boot/efi/EFI/Slackware/initrd-5.10.19.gz # Needed for unmodified generic kernel
nano /boot/efi/EFI/Slackware/elilo.conf # Add the new entries for the 5.10.19 kernel
reboot
Okay gang...for dummies like me - where and how does one get/do the kernel build? I'd like to try it out just for comparison with my 7 year old machine (I build my own when I can afford it, and surviving on a disability check makes that not near as often as I wish I could, so my current system is an AMD FX8350 w/16GB RAM and 14.2 on an SSD), but especially so I can do as keefaz mentions, just for my own reasons to customize my kernel if I decide to do such a thing some time in the future with my Slackware version I'm using at the time hopefully that being whatever Pat is going to name the latest and greatest when he's ready to give it to the world).
Where is one getting Pat's scripts for building kernels and are/is the kernel downloaded from kernel.org or from the same place Pat's scripts are found? Where too does one get the .config file to be adjusted for my customization?
I really did try to look around and search the 'net, but the things that have come up I'm not really sure are what I should use or what everyone in this thread is talking about using.
For instance, the kernel build script I believe is the one being used is here, correct?
The '.config' file would be one of these here? If so, those are for a 5.10.x kernel and I would just change it for whatever version I get/find and download, right?
Bassmadrigal already gave you good advice.
But if you want to build outside package management. So, just download the source from kernel.org, and do it all yourself. then this is a pretty good guide. later you can script that if you want.
the configs can be get from the kernel-generic-5.10.xx package. just extract that, and you will find the config file in the extracted boot directory. if you need a different kernel, for example kernel 5.4.xx, you can get the configs Thanks to SlackwareUK. in that case just pick the latest kernel-generic-5.4.xx package, extract that, and again in the extrated boot dir you will find the config for that kernel. and use that config to make olddefconfig or make menuconfig to change some stuff. They have other kernels as well. good luck.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.