LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-29-2008, 12:37 PM   #1
Romanus81
Member
 
Registered: Feb 2008
Posts: 201

Rep: Reputation: 31
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
 
Old 04-29-2008, 12:38 PM   #2
Carpo
Member
 
Registered: Aug 2003
Location: Somewhere
Distribution: Gentoo (for now)
Posts: 364

Rep: Reputation: 30
you cant wait 15mins ? - only way to speed it up it to remove what you don't need
 
Old 04-29-2008, 12:57 PM   #3
BCarey
Senior Member
 
Registered: Oct 2005
Location: New Mexico
Distribution: Slackware
Posts: 1,639

Rep: Reputation: Disabled
Quote:
Originally Posted by Romanus81 View Post
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
 
Old 04-29-2008, 01:55 PM   #4
cathectic
Member
 
Registered: Sep 2004
Location: UK, Europe
Distribution: Slackware64
Posts: 761

Rep: Reputation: 35
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.
 
Old 04-30-2008, 06:20 PM   #5
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367

Rep: Reputation: 844Reputation: 844Reputation: 844Reputation: 844Reputation: 844Reputation: 844Reputation: 844
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.
 
Old 05-02-2008, 09:51 PM   #6
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
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.
 
Old 05-03-2008, 05:49 AM   #7
Rupa
Member
 
Registered: Apr 2008
Location: Berlin, Germany
Distribution: Slackware, Debian, NetBSD
Posts: 80

Rep: Reputation: 27
*) 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.
 
Old 05-03-2008, 07:41 AM   #8
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 232Reputation: 232Reputation: 232
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 !
 
Old 05-03-2008, 01:08 PM   #9
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367

Rep: Reputation: 844Reputation: 844Reputation: 844Reputation: 844Reputation: 844Reputation: 844Reputation: 844
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).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Increasing Kernel stack size to 8k without recompiling the Kernel deathman Linux - Software 2 04-08-2006 05:39 AM
recompiling glibc on slackware 10.2 win32sux Slackware 10 10-07-2005 02:35 PM
recompiling the kernel-SLACKWARE greklas Slackware 6 08-29-2004 01:29 PM
can i compile just one kernel module whithout recompiling the whole kernel? edman007 Linux - Software 3 02-17-2004 04:05 PM
recompiling kernal slackware 7.1 gamji44 Slackware 5 09-08-2003 12:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration