Slackware This 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.
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.
|
 |
04-17-2006, 08:40 PM
|
#1
|
Member
Registered: Apr 2006
Distribution: Slackware 14.2
Posts: 48
Rep:
|
How to restore out-of-box kernel settings if my kernel compile fails?
In the SlackBook, chapter 4, it covers compiling a new kernel, something I've never been able to do before and still be able to boot my system -- this time, I'm determined to get it right.
The first step it tells me is to backup /usr/src/linux/.config, then these steps:
1. make mrproper
2. make config
3. make dep
4. make clean
5. make bzImage
6. make modules
7. (some cp/mv commands)
8. make modules_install
My question is, if I screw up a kernel compile with these instructions, can I just restore the backed up copy of .config and then redo those steps starting at #3 to put me back where I started from, which is basically Slackware out-of-the-box?
I'm asssuming that steps 1 & 2 clear out the .config file and make a new one, so that if I skip them and restore the out-of-box copy of .config, I'll be able to proceed with #3 to restore all the modules back to the way they were? After that I'll go back to try & figure out what went wrong...
Thanks!
|
|
|
04-17-2006, 09:10 PM
|
#2
|
Member
Registered: Jan 2005
Location: Boston
Distribution: slackware
Posts: 502
Rep:
|
You may find this guide helpful for compiling the kernel. This is the one I followed.
Always keep at least one backup kernel in case you can't boot into the one you're compiling. This is explained in the guide in the section about editing lilo.conf. That way you can play around with kernel compiling and be sure of being able to reboot onto your backup kernel if not the new one.
Good luck
Last edited by dcdbutler; 04-17-2006 at 09:11 PM.
|
|
|
04-17-2006, 09:13 PM
|
#3
|
Senior Member
Registered: Mar 2003
Location: Following the white rabbit
Distribution: Slackware64 -current
Posts: 2,300
Rep:
|
Always keep a backup copy of your working kernel. If the new one fails you can boot to the working one.
|
|
|
04-17-2006, 09:30 PM
|
#4
|
Member
Registered: Apr 2006
Distribution: Slackware 14.2
Posts: 48
Original Poster
Rep:
|
dcdbutler & masonm, thanks for the advice; however, I'm not necessarily trying to upgrade, but just know how to get everything back to the way it was and I'm thinking that restoring the original .config and re-compiling from there would do it. That's basically what I'm curious about.
|
|
|
04-17-2006, 09:49 PM
|
#5
|
Member
Registered: Mar 2004
Location: PA
Distribution: Slackware 12.0
Posts: 315
Rep:
|
You can perfectly well have 2 or 3 or more kernels on your system at once. Just configure lilo to offer you a choice, as per the instructions referenced by the others who responded. That way if you try to boot into the new kernel, and it fails, you can reboot into the working kernel without needing to recompile it. It stays built as long as you do not overwrite it. If you just give it another name and then add a new entry into lilo.conf and enable the boot prompt, you can choose which kernel to boot. And save the .config file somewhere else in case you want to retweak from the original starting point. You can also always access the current configuration by running "zcat /proc/config.gz"
-geo
Last edited by geomatt; 04-17-2006 at 09:52 PM.
|
|
|
04-18-2006, 12:14 AM
|
#6
|
Member
Registered: May 2004
Location: Southwestern USA
Distribution: CentOS
Posts: 279
Rep:
|
Either way you want a known good kernel to boot to, just in case something goes wrong. See the sticky "This is how I do it all" for details on doing this.
Dennisk
|
|
|
04-18-2006, 02:15 AM
|
#7
|
Senior Member
Registered: Dec 2005
Location: United Kingdom
Distribution: Fedora , Ubuntu, Slackware-Current
Posts: 1,526
Rep:
|
Hi, I just went through the same routine and I just wanted to emphasize one point that geomatt has already told you (the instructions in some place are not totally clear on this.) When you get to the step that you cp/mv arch/i386/boot/bzImage /boot/?, make sure you are naming your new kernel something different than the working kernel you want to keep in reserve. Some instructions tell you to copy to /boot/vmlinuz and if that is the name of the current working kernel, it is going to be overwritten.
Hope that helps,
Bob
|
|
|
04-18-2006, 07:01 AM
|
#8
|
Senior Member
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247
Rep:
|
brgr88, yes, you are right, except if you compile 2.6 kernel, you shouldn't run make dep.
|
|
|
04-18-2006, 07:51 AM
|
#9
|
Member
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536
Rep:
|
Quote:
cp/mv arch/i386/boot/bzImage /boot/?
|
There's no need to do this manually anymore, 2.6 has the kernelinstall script feature through which you can automatically add the version onto the name while installing (I use this to create a package rather than installing the kernel manually).
Also, you shouldn't really use /usr/src/linux, but rather /usr/src/linux-<version>. The source dir will be symlinked via /lib/modules/<version>/build anyway, so third party modules etc can always find the src.
|
|
|
All times are GMT -5. The time now is 04:26 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
|
|