LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-08-2005, 02:48 PM   #1
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Recompiling a kernel


Hi people, I recently installed Gentoo 2005.1 with the plain 2.6.12.5 kernel. When I was configuring the kernel during the installation, I left out some things that should have been in there (like support for mounting SMB shares :/). Is it possible to kind of keep my old kernel config, but just add support for the things I need and recompile? I've seen somewhere (and I can't remember exactly where now, maybe Gentoo's forums) that says to just

# cd /usr/src/linux
# make menuconfig
# make && make modules_install

Is that the correct procedure or is there something else I need to do as well? I know I should backup the .config and my linux-2.6.12.5 files just in case.

Also, when how do I know when to compile something as a module and when to build it in to the kernel?

Edit: doing a search comes up with lots of horror stories; loads of people seem to end up with something not working after recompiling. I'm a little apprehensive because of this :/.

Any help appreciated, thanks.

Last edited by Nylex; 09-08-2005 at 02:49 PM.
 
Old 09-08-2005, 03:18 PM   #2
dracolich
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 1,280

Rep: Reputation: 64
Right, everyones going to make some mistakes the first time. Maybe the second time, too. If you use the LILO boot loader add another command to that list. After you've copied the new kernel image and System.map into /boot run the lilo command.

As long as you keep a backup of the original .config and keep your current working kernel in the boot loader you should be ok. If the new one has problems you can still boot the old one.
 
Old 09-08-2005, 03:27 PM   #3
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Original Poster
Rep: Reputation: Disabled
Actually, I'm using GRUB now since that was the default for Gentoo (although, I could have used LILO, seeing as I'm more used to it). Thanks for the reply!
 
Old 09-08-2005, 03:35 PM   #4
Charred
Member
 
Registered: Mar 2005
Location: Utah, USA
Distribution: Slackware 11
Posts: 816
Blog Entries: 2

Rep: Reputation: 30
I use the following steps to ensure I can reboot if I screw up a kernel make:
  • Ensure a usable vmlinux is under /boot.
  • #: mkdir /boot/2.6.x
  • Change /etc/lilo.conf to load "Linux" from /boot/2.6.x/vmlinuz and "safe" from /boot/vmlinuz; enable "prompt" and "timeout" options. Save changes (duh).
  • #: /sbin/lilo
  • Alter /usr/src/linux/Makefile to export to /boot/2.6.x
  • Configure new kernel
  • #: make install && make modules_install
  • Reboot and face the music.

Unmodified, "make install" will export your new vmlinuz and System.Map files to /boot. This way you don't need to copy files if you don't want to.
 
Old 09-08-2005, 03:41 PM   #5
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Original Poster
Rep: Reputation: Disabled
Appreciate your reply too, Charred. That's cool, I can copy the files manually.

Edit: heh, I did it and there was no kernel panic, or kernel oops. So, nothing has gone wrong so far and it boots fine . Yay!

Last edited by Nylex; 09-08-2005 at 04:41 PM.
 
Old 09-08-2005, 04:48 PM   #6
Charred
Member
 
Registered: Mar 2005
Location: Utah, USA
Distribution: Slackware 11
Posts: 816
Blog Entries: 2

Rep: Reputation: 30
Glad to help in any way.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
recompiling kernel wooot SUSE / openSUSE 11 06-15-2005 03:55 PM
recompiling kernel DaveyB Linux - Newbie 3 08-10-2004 09:45 AM
can i compile just one kernel module whithout recompiling the whole kernel? edman007 Linux - Software 3 02-17-2004 03:05 PM
recompiling the kernel help SonKun Linux - General 3 09-01-2003 04:40 PM
Recompiling Kernel dai Linux - General 3 08-05-2002 04:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:07 AM.

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