Recompiling kernel in Slackware, any special commands?
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.
Recompiling kernel in Slackware, any special commands?
If I need to edit my .config file in my kernel, all I need to do is
Code:
make xconfig
#patch kernel, reconfigure parts, etc.
make
make modules_install
make install
Correct?
Make takes over 15 minutes to do, is there any way to speed it up?
Do I need to run mkinitrd each time I recompile my kernel?
Thank you for answering my questions.
~Romanus
If I need to edit my .config file in my kernel, all I need to do is
Code:
make xconfig
#patch kernel, reconfigure parts, etc.
make
make modules_install
make install
Correct?
Make takes over 15 minutes to do, is there any way to speed it up?
Do I need to run mkinitrd each time I recompile my kernel?
Thank you for answering my questions.
~Romanus
You will need to rerun lilo and mkinitrd. Personally I do not "make install", but manually copy the new image into /boot and edit lilo.conf. Don't blow away your working kernel until you've tested your new one. Notice that mkinitrd allows you change the name of the initrd.img so, again, you don't over-write your working configuration until you've tested your new one.
If you build in the drivers for stuff you need to boot the system into your custom kernel (e.g. file systems, drive controllers, etc) you can bypass the need for the initrd as well.
I prefer manually copying over the (very few) files needed instead of running `make install` just so I know exactly what I did and so it's basically impossible to screw anything up at all (the only possible system-wide screw-up is `make modules_install`, but as long as you're not compiling an identical kernel version as an already installed kernel, or if you changed the EXTRAVERSION option to prevent overwriting a directory in /lib/modules/, you should be fine). As a side note, if you build the kernel in your user's home directory (or even better a directory within your user's home directory...) then the ONLY commands needed to be run as root are `make modules_install` and when copying stuff over to /boot.
If you compile the filesystem used on your root partition (/) into the kernel, then you shouldn't need an initrd except in special cases. Otherwise, yes, you will need an initrd.
Make takes over 15 minutes to do, is there any way to speed it up?
In those immortal words: Patience Grasshopper!
When I compiled my new kernel on my old 350 MHz PII, I needed 3-1/4 hours or so. With my new 2.3 GHz BE-2400 dual core AM2 and 2 GB of RAM (been 10 years since I bought a new box!) --- using the make -j4 option, I now compile the kernel in about 15 minutes. I'm like a pig in mud having to now "wait" a whopping 15 minutes.
If you don't do 'make clean' in the kernel source tree, the second build should be much faster if you just change a few things.
Although that approach may offer instant gratification (a quicker compile) I'd be wary of using it. Depending on what you changed in the kernel, it can be fine -- but if you don't know what you're doing it may do strange things. I always make sure to run `make mrproper` (or `make clean`) before compiling -- even immediately after untarring the sources (they're not always perfect when you download them).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.