LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   What are the defaults when recompiling the kernel (https://www.linuxquestions.org/questions/slackware-14/what-are-the-defaults-when-recompiling-the-kernel-4175415493/)

dualarrow 07-07-2012 10:57 PM

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

zakame 07-07-2012 11:32 PM

Look at /boot/config-generic-2.6.37.6 (which you can copy to /path/to/your/kernel/source/.config)

dualarrow 07-07-2012 11:34 PM

Thanks zakame

ponce 07-08-2012 01:54 AM

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.

NightSky 07-09-2012 07:08 PM

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?

ChrisAbela 07-10-2012 04:27 AM

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.

Didier Spaier 07-10-2012 08:08 AM

Quote:

Originally Posted by NightSky (Post 4723393)
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.

mrascii 07-10-2012 09:19 AM

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

Didier Spaier 07-10-2012 09:47 AM

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


zordrak 07-10-2012 10:21 AM

Quote:

Originally Posted by Didier Spaier (Post 4723886)
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.

Didier Spaier 07-10-2012 10:51 AM

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

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.

NightSky 07-10-2012 05:39 PM

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.

NightSky 07-11-2012 04:25 PM

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

Didier Spaier 07-11-2012 04:33 PM

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.

NightSky 07-11-2012 05:25 PM

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?


All times are GMT -5. The time now is 07:49 PM.