LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 08-05-2004, 03:48 PM   #1
marlor
Member
 
Registered: May 2004
Distribution: Slackware C
Posts: 274

Rep: Reputation: 30
Kernel re-compile guide (simple)


Hi people,

as a lot of people end up having to recompile their kernel because they forgot to add something like ACPI support or they want to customize their current kernel, i decided to write this quick guide!

it works for my kernel 2.4.26 and should have not much problem with other kernels.

here we go the 5 magic steps:

STEP1: find your config
*********************************
locate your original config file
it should be /boot/config or something similar like /boot/config-2.4.26

STEP2: prepare for configuration
*********************************
Code:
cd /usr/src/linux
Code:
make mrproper
Code:
cp /boot/config-x.x.xx .config
replace the x.x.xx with whatever your config file in your /boot directory is called. it might be also just called config. and yes there is a space before .config

STEP3: configuring kernel
********************************
the next code will pop up the kernel configuration, there you can adjust the kernel to your needs. a tip is, do not add or remove too many things at once because IF something doesn't work later on, you will know what caused it.
Code:
make menuconfig
now when you are done don't forget to save the changes

STEP4: getting the new modules on your machine
*********************************
the next few codes will basically make your new files/modules ready for you. each of these 4 commands will take some time to finish its proccess so lay back and have some tea
(for kernel 2.6.xx you don't need this first step "make dep") thx mm3000
Code:
make dep
Code:
make bzImage
Code:
make modules
Code:
make modules_install
STEP5: final touch'z
*********************************
now make sure that lilo boots your newly configured kernel with the new settings.
Code:
mv /boot/System.map /boot/System.map.OLD
your System.map might also be called something like System.map-2.4.26 so check it out in your /boot directory first.

Code:
cp System.map /boot
still in the /usr/src/linux dir, the above command will copy the System.map from the /usr/src/linux dir to your /boot dir.

Code:
mv /boot/vmlinuz /boot/vmlinuz.OLD
Code:
cp arch/i386/boot/bzImage /boot/vmlinuz
vmlinux is the file that your lilo call's up. so check your etc/lilo.conf and find the following line:
image = /boot/vmlinuz

it could be also something like /boot/vmlinux-2.4.26
in this case make sure that the vmlinuz in your /boot directory and the vmlinuz in your lilo.conf match. if you do edit lilo don't forget to save it first and then run lilo.


i hope this will help someone


good luck

Last edited by marlor; 08-08-2004 at 06:15 AM.
 
Old 08-06-2004, 01:49 AM   #2
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 242Reputation: 242Reputation: 242
Quote:
cp arch/i386/bzImage /boot/vmlinuz
should be :
Code:
cp arch/i386/boot/bzImage /boot/vmlinuz
But great tutorial tough, you kept it simple
 
Old 08-06-2004, 02:11 AM   #3
marlor
Member
 
Registered: May 2004
Distribution: Slackware C
Posts: 274

Original Poster
Rep: Reputation: 30
oops

fixed it, thanks
 
Old 08-06-2004, 02:56 AM   #4
rgiggs
Member
 
Registered: Apr 2004
Location: berkeley, ca
Distribution: slk10, winxp
Posts: 313

Rep: Reputation: 30
Re: Kernel re-compile guide (simple)

Quote:
Originally posted by marlor
Code:
cp /System.map /boot
still in the /usr/src/linux dir, the above command will copy the System.map from the /usr/src/linux dir to your /boot dir.
it should be
Code:
cp System.map /boot
 
Old 08-06-2004, 03:36 AM   #5
marlor
Member
 
Registered: May 2004
Distribution: Slackware C
Posts: 274

Original Poster
Rep: Reputation: 30
thx

sh*t happens if you write a guide at 3-4 am

doesn't matter much though, moderator said the 2 guides in slack forum are enough, so this will fade away in 1 or 2 days

Last edited by marlor; 08-06-2004 at 03:37 AM.
 
Old 08-08-2004, 01:47 AM   #6
mm3000
Member
 
Registered: Jul 2004
Location: Victoria, OZ
Distribution: Slackware x64_Current
Posts: 82

Rep: Reputation: 15
Great guide, easy to follow.
Just one thing 'make dep' in 2.6.7 gives this output.
Code:
:make dep is unnecessary now
cheers
 
Old 08-08-2004, 03:57 AM   #7
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 242Reputation: 242Reputation: 242
In fact to build 2.6 kernel and modules you just have to type : make
To install modules, it is as usual : make modules_install
At least to install kernel you can : make install, but I prefer and recommend to install kernel and System.map by hand

This is a four-step procedure now (taking in account make *config)
 
  


Reply


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
Kernel Compile Guide for 2.6.0 DaOne Slackware 581 04-11-2009 06:31 AM
Help - Need guide on how to (re)compile kernel in 9.2 timko Suse/Novell 1 02-17-2005 08:17 AM
re :kernel compile guide sh4d0w331 Slackware 1 10-02-2004 05:38 PM
What happened to the Newbie Compile Guide? boutrosboutros Slackware 6 07-14-2004 12:37 AM
mandrake specific kernel compile guide? e1000 Mandriva 4 01-09-2004 12:27 PM


All times are GMT -5. The time now is 01:16 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration