LinuxQuestions.org
Review your favorite Linux distribution.
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 07-07-2012, 10:57 PM   #1
dualarrow
LQ Newbie
 
Registered: Jul 2012
Posts: 5

Rep: Reputation: Disabled
What are the defaults when recompiling the kernel


I have read the online docs at slackware.com for recompiling the kernel, and I have a question on the following 2 commands

make mrproper
make menuconfig

The docs say for "make mrproper" the following

Quote:
The first step is to bring the kernel source into its base state. We issue this command to do that (note, you may wish to back-up the .config file as this command will delete it without warning):
If I want to retain the current defaults (which I'm assuming will be the ones the distributed kernel was compiled with, correct me if I'm wrong) would I skip the "make mrproper" command begin with "make menuconfig"

What I'm trying to achieve is to recompile the kernel for my architecture and possibly change some configuration options, but I would want to start with the options the currently distributed kernel (13.37) was compiled with.

TIA,
Andrew

Last edited by unSpawn; 07-08-2012 at 05:57 AM. Reason: //s|.org|.com|g
 
Old 07-07-2012, 11:32 PM   #2
zakame
Member
 
Registered: Apr 2012
Location: Philippines
Distribution: Debian, Ubuntu, Slackware
Posts: 295

Rep: Reputation: 181Reputation: 181
Look at /boot/config-generic-2.6.37.6 (which you can copy to /path/to/your/kernel/source/.config)
 
Old 07-07-2012, 11:34 PM   #3
dualarrow
LQ Newbie
 
Registered: Jul 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thanks zakame
 
Old 07-08-2012, 01:54 AM   #4
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,095

Rep: Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173
if you need a more detailed description of the necessary steps to follow for building a custom kernel, you can also have a look at the very detailed Alien BOB's kernel building wiki page.
 
Old 07-09-2012, 07:08 PM   #5
NightSky
Member
 
Registered: Sep 2001
Location: Texas :(
Distribution: Slackware64- 5.15.2
Posts: 909

Rep: Reputation: 55
Well illustrated Recompiling same kernel or compiling a new one process:
http://www.bitbenderforums.com/forum...&postid=296303

http://blog.tpa.me.uk/slackware-kernel-compile-guide/

command make mrproper restores your source code to its original or clean state
command make menuconfig will bring up the text based interface for you to configure you kernel

Which brings us to the question of how to preserve the running kernel as a fail safe? I've seen the answer in posts & tuts, maybe someone can explain the output process used to achieve this?

Last edited by NightSky; 07-09-2012 at 07:28 PM.
 
Old 07-10-2012, 04:27 AM   #6
ChrisAbela
Member
 
Registered: Mar 2008
Location: Malta
Distribution: Slackware
Posts: 572

Rep: Reputation: 154Reputation: 154
Quote:
Which brings us to the question of how to preserve the running kernel as a fail safe? I've seen the answer in posts & tuts, maybe someone can explain the output process used to achieve this?
Simply do not overwrite your kernel, modules, initrd (if you use it) and your firmware. Also keep the option to boot from your old kernel in lilo.conf.

Start with /etc/lilo.conf, it includes references to your current set-up. This should show where is your kernel and initrd. Your modules should not be touched unless you are recompiling exactly the same kernel with the same LOCALVERSION. The firmware is tricky. I move it before I install the new one:

mv /lib/firmware /lib/firmware-2.6.36

then

make modules_install

You may need to proprietary firmware from your old firmware directory (for example for wireless LAN) at a later stage.

If it goes wrong, your system should still boot without the firmware, but it would lack some functionality until you restore it and reboot.

Last edited by ChrisAbela; 07-10-2012 at 04:28 AM.
 
1 members found this post helpful.
Old 07-10-2012, 08:08 AM   #7
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,055

Rep: Reputation: Disabled
Quote:
Originally Posted by NightSky View Post
Well illustrated Recompiling same kernel or compiling a new one process:
http://www.bitbenderforums.com/forum...&postid=296303

http://blog.tpa.me.uk/slackware-kernel-compile-guide/

command make mrproper restores your source code to its original or clean state
command make menuconfig will bring up the text based interface for you to configure you kernel

Which brings us to the question of how to preserve the running kernel as a fail safe? I've seen the answer in posts & tuts, maybe someone can explain the output process used to achieve this?
The first link is about kernel 2.4 and is pretty old, do not follow these instructions for kernels shipped with Slackware 13.37.

Your last question is answered as well in the wiki page pointed out by Ponce.

Better learn the basics of lilo before trying to recompile your kernel.

Last edited by Didier Spaier; 07-10-2012 at 10:49 AM. Reason: s/second link/first link/
 
Old 07-10-2012, 09:19 AM   #8
mrascii
Member
 
Registered: Jun 2012
Location: on the Net
Distribution: Slackware
Posts: 100

Rep: Reputation: Disabled
A good kernel building reference is Greg Kroah-Hartman's Linux Kernel in a Nutshell. The book is also available on Greg's website. Greg is a well known kernel developer.

Also, if you built a driver/module for your wifi card, for example. Keep the source code on your system in, say, /usr/local/src since you may need to rebuild the module for the new kernel.

DNA
AKA mrascii
 
Old 07-10-2012, 09:47 AM   #9
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,055

Rep: Reputation: Disabled
Hello mrascii, welcome to LQ.

Though Linux Kernel in a Nutshell be a interesting book, its reading is not necessary here; it could be even confusing for a beginner.

@dualarrow & NightSky: again, just read carefully what Alien BOB wrote and if you don't understand the purpose or effect of a specific command, first read the manual for it, i.e.
Code:
man <command_name>
then if this is still not clear just ask for explanations here, we will be eager to answer your questions.

To know the commands available to configure and make the kernel, just launch an xterm and type:
Code:
cd /usr/src/linux-<version>
su
make help|less

Last edited by Didier Spaier; 07-10-2012 at 10:03 AM.
 
1 members found this post helpful.
Old 07-10-2012, 10:21 AM   #10
zordrak
Member
 
Registered: Feb 2008
Distribution: Slackware
Posts: 595

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by Didier Spaier View Post
The second link is about kernel 2.4 and is pretty old, do not follow these instructions for kernels shipped with Slackware 13.37.
FWIW it's a 2.6 base not a 2.4 and most of it is still completely relevant so long as you have the vaguest sense of what you're doing. Having said that I will try to find time to update specifically for 3.x when I can.
 
Old 07-10-2012, 10:51 AM   #11
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,055

Rep: Reputation: Disabled
@Zordrak: I meant the first link, sorry about that. The quoted post is now corrected

EDIT About "the vaguest sense of what you're doing", let me quote Shakespeare:
Quote:
ay there's the rub
No offense intended to anybody, sorry I couldn't resist.

Last edited by Didier Spaier; 07-10-2012 at 11:37 AM.
 
1 members found this post helpful.
Old 07-10-2012, 05:39 PM   #12
NightSky
Member
 
Registered: Sep 2001
Location: Texas :(
Distribution: Slackware64- 5.15.2
Posts: 909

Rep: Reputation: 55
Thank you each and every one. First link I knew is outdated..just found all the detailed explanations of profiling your system's hardware + stat files & options in MenuConfig very clarifying, easy to read, it actually helped me understand the more current documentation. I Apologize if I've misinformed anyone.

Last edited by NightSky; 07-10-2012 at 05:44 PM.
 
Old 07-11-2012, 04:25 PM   #13
NightSky
Member
 
Registered: Sep 2001
Location: Texas :(
Distribution: Slackware64- 5.15.2
Posts: 909

Rep: Reputation: 55
zordak, thank for your tutorial, its one of the best an is printed. Specifying kernel version is not required. More important is clarifying:
Quote:
DO NOT compile a pre-release kernel as root
- the only sticky point in the tut.
Your tutorialspecifies:
Quote:
This guide assumes you are logged in as root.
So how does one proceed as non-root with a pre-compiled kernel?
Here is what I have:
Code:
:~$ ls -l /var/log/packages/ | grep kernel
21825 Jul  1 02:42 kernel-firmware-20120622git-noarch-1
973 Jul  1 02:43 kernel-generic-3.2.21-x86_64-1
22078 Jul  1 02:43 kernel-headers-3.2.21-x86-1
970 Jul  1 02:45 kernel-huge-3.2.21-x86_64-1
190495 Jul  1 02:51 kernel-modules-3.2.21-x86_64-1
2386954 Jul  1 03:08 kernel-source-3.2.21-noarch-1
Thank you again

Last edited by NightSky; 07-11-2012 at 04:49 PM. Reason: Here is my #post4723373
 
Old 07-11-2012, 04:33 PM   #14
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,055

Rep: Reputation: Disabled
My advise is simpler than that: do not compile a pre-release kernel at all. The only people who really need to do that are the kernel or driver developers or maintainers.

Granted, nobody may forbid you to try. But bear in mind that as long as a kernel is not officially released there are possibilities that it breaks something in your system that you would have to fix yourself, if you can.

Last edited by Didier Spaier; 07-11-2012 at 04:37 PM.
 
Old 07-11-2012, 05:25 PM   #15
NightSky
Member
 
Registered: Sep 2001
Location: Texas :(
Distribution: Slackware64- 5.15.2
Posts: 909

Rep: Reputation: 55
Didier, Good to understand that. What about your post: Easier kernel configuration with 2.6.32? Went to kernel newbies, looking for current information for 3.2.21? Yes reading kernel release notes.
Thanks Didier.
All i want to do is set the running kernel to the current hardware? Keeping kernel 3.2.21 is not a problem, because then i can keep running current upgrades without running slackpkg install new. Chris have you done this?

Last edited by NightSky; 07-14-2012 at 03:29 AM.
 
  


Reply

Tags
kernel rebuild, safe, slackare


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
recompiling a kernel module without rebuiling the kernel? MrUmunhum Linux - General 1 07-24-2011 04:43 PM
difference between kernel recompiling and kernel rebuilding vineet7kumar Linux - General 1 09-27-2007 01:35 AM
Increasing Kernel stack size to 8k without recompiling the Kernel deathman Linux - Software 2 04-08-2006 04:39 AM
Booting kernel defaults Barserk Fedora 3 10-04-2005 05:47 PM
can i compile just one kernel module whithout recompiling the whole kernel? edman007 Linux - Software 3 02-17-2004 03:05 PM

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

All times are GMT -5. The time now is 02:26 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