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.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
|
07-07-2012, 10:57 PM
|
#1
|
|
LQ Newbie
Registered: Jul 2012
Posts: 5
Rep: 
|
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
|
|
|
|
07-07-2012, 11:32 PM
|
#2
|
|
Member
Registered: Apr 2012
Distribution: Debian, Ubuntu, Slackware
Posts: 78
Rep:
|
Look at /boot/config-generic-2.6.37.6 (which you can copy to /path/to/your/kernel/source/.config)
|
|
|
|
07-07-2012, 11:34 PM
|
#3
|
|
LQ Newbie
Registered: Jul 2012
Posts: 5
Original Poster
Rep: 
|
Thanks zakame
|
|
|
|
07-08-2012, 01:54 AM
|
#4
|
|
Senior Member
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 1,933
|
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.
|
|
|
|
07-09-2012, 07:08 PM
|
#5
|
|
Member
Registered: Sep 2001
Distribution: Slackware64-13.17 current
Posts: 676
Rep:
|
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.
|
|
|
|
07-10-2012, 04:27 AM
|
#6
|
|
Member
Registered: Mar 2008
Location: Malta
Distribution: Slackware 14.0
Posts: 434
Rep:
|
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.
|
07-10-2012, 08:08 AM
|
#7
|
|
Senior Member
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware-14.0 on a Lenovo T61 6457-4XG
Posts: 2,782
|
Quote:
Originally Posted by NightSky
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/
|
|
|
|
07-10-2012, 09:19 AM
|
#8
|
|
Member
Registered: Jun 2012
Location: on the Net
Distribution: Slackware
Posts: 100
Rep: 
|
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
|
|
|
|
07-10-2012, 09:47 AM
|
#9
|
|
Senior Member
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware-14.0 on a Lenovo T61 6457-4XG
Posts: 2,782
|
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.
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.
|
07-10-2012, 10:21 AM
|
#10
|
|
Member
Registered: Feb 2008
Distribution: Slackware
Posts: 570
Rep: 
|
Quote:
Originally Posted by Didier Spaier
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.
|
|
|
|
07-10-2012, 10:51 AM
|
#11
|
|
Senior Member
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware-14.0 on a Lenovo T61 6457-4XG
Posts: 2,782
|
@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:
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.
|
07-10-2012, 05:39 PM
|
#12
|
|
Member
Registered: Sep 2001
Distribution: Slackware64-13.17 current
Posts: 676
Rep:
|
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.
|
|
|
|
07-11-2012, 04:25 PM
|
#13
|
|
Member
Registered: Sep 2001
Distribution: Slackware64-13.17 current
Posts: 676
Rep:
|
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
|
|
|
|
07-11-2012, 04:33 PM
|
#14
|
|
Senior Member
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware-14.0 on a Lenovo T61 6457-4XG
Posts: 2,782
|
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.
|
|
|
|
07-11-2012, 05:25 PM
|
#15
|
|
Member
Registered: Sep 2001
Distribution: Slackware64-13.17 current
Posts: 676
Rep:
|
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.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 01:20 PM.
|
|
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
|
|