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 |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
09-08-2005, 02:48 PM
|
#1
|
LQ Addict
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464
Rep: 
|
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.
|
|
|
09-08-2005, 03:18 PM
|
#2
|
Senior Member
Registered: Jul 2005
Distribution: Slackware
Posts: 1,280
Rep:
|
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.
|
|
|
09-08-2005, 03:27 PM
|
#3
|
LQ Addict
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464
Original Poster
Rep: 
|
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! 
|
|
|
09-08-2005, 03:35 PM
|
#4
|
Member
Registered: Mar 2005
Location: Utah, USA
Distribution: Slackware 11
Posts: 816
Rep:
|
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.
|
|
|
09-08-2005, 03:41 PM
|
#5
|
LQ Addict
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464
Original Poster
Rep: 
|
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.
|
|
|
09-08-2005, 04:48 PM
|
#6
|
Member
Registered: Mar 2005
Location: Utah, USA
Distribution: Slackware 11
Posts: 816
Rep:
|
Glad to help in any way.
|
|
|
All times are GMT -5. The time now is 03:07 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|