LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Recompiling kernel in Slackware, any special commands? (https://www.linuxquestions.org/questions/slackware-14/recompiling-kernel-in-slackware-any-special-commands-638693/)

Romanus81 04-29-2008 11:37 AM

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

Carpo 04-29-2008 11:38 AM

you cant wait 15mins ? - only way to speed it up it to remove what you don't need

BCarey 04-29-2008 11:57 AM

Quote:

Originally Posted by Romanus81 (Post 3136807)
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.

Brian

cathectic 04-29-2008 12:55 PM

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.

T3slider 04-30-2008 05:20 PM

The best (or one of the best) kernel building guides for Slackware is available here, provided by Alien Bob: http://alien.slackbook.org/dokuwiki/...kernelbuilding

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.

Woodsman 05-02-2008 08:51 PM

Quote:

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. ;)

Rupa 05-03-2008 04:49 AM

*) You don't need to rebuild your initrd.gz if the kernel version is the same.

*) 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.

bgeddy 05-03-2008 06:41 AM

Quote:

Make takes over 15 minutes to do, is there any way to speed it up?
Took me 6 hours first time I did it. Fifteen minutes is just time for a coffee !

T3slider 05-03-2008 12:08 PM

Quote:

Originally Posted by Rupa
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).


All times are GMT -5. The time now is 10:20 AM.