LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 11-30-2004, 10:08 PM   #1
sdat1333
Member
 
Registered: Nov 2004
Location: North Carolina, USA
Distribution: None right now :(
Posts: 149

Rep: Reputation: 15
More info on recompiling my kernel pls.


When I asked in another thread how to make my computer load faster, one person told me to recompile my kernel. Could somebody please tell me what this is, and how do I do it. I apologize, I am still a
I know I can try google, but I couldn't find anything easy to understand geared towards users of FC3
Thanks in advance,

-Sean
SC, USA
 
Old 12-01-2004, 02:37 AM   #2
DaneM
Member
 
Registered: Oct 2003
Location: Chico, CA, USA
Distribution: Linux Mint
Posts: 881

Rep: Reputation: 130Reputation: 130
Hello, Sdat1333.

The first thing you need to do is to make sure that you have the kernel source RPMs installed. Once you've done this, open a command prompt and type:

Code:
cd /usr/src/linux
cp .config .config.bakup
make xconfig
Now take your time and determine what stuff is necessary and what isn't. If you're not sure about something just leave it alone. You have three options for most of the choices: load it as a module ("--"), compile it into the kernel (checkmark) and don't use it (N or blank). The first two will allow you to use whatever it is. Compiling an option as a module lets you load and unload it on the fly. It allows you the most flexability but is a bit slower. Compiling it in is faster but can get confusing if something's not working right. Leaving it out is the fastest but isn't always a good idea. Remove everything that you don't think you need and leave what you do need.

Next you need to edit your grub or lilo configuration file. I use lilo, so I can't help you much with grub other than to say that you should make a duplicate entry for your current boot-up image and give the entry and the image a different name. Here's an example of my own lilo.conf file:

Code:
boot = /dev/hda
prompt
timeout = 300
 vga=790
default = Linux-2.6.7
# End LILO global section

# Linux bootable partition config begins
image = /boot/vmlinuz-2.6.9
  root = /dev/hda3
  label = Linux-2.6.9
  read-only
  append=" hdb=ide-scsi hdc=ide-scsi"

image = /boot/vmlinuz-2.6.8
  root = /dev/hda3
  label = Linux-2.6.8
  read-only
  append=" hdb=ide-scsi hdc=ide-scsi"

image = /boot/vmlinuz-2.6.7
  root = /dev/hda3
  label = Linux-2.6.7
  read-only
  append=" hdb=ide-scsi hdc=ide-scsi"

image = /boot/vmlinuz-2.4.26
  root = /dev/hda3
  label = Linux-2.4.26
  read-only # Non-UMSDOS filesystems should be mounted read-only for checking
# Linux bootable partition config ends

# Windows bootable partition config begins
other = /dev/hde1
  label = WindowsXP
  map-drive = 0x80
   to = 0x81
#  map-drive = 0x81
#   to = 0x80
  table = /dev/hde
# Windows bootable partition config ends
Each line starting with "image = /boot/vmlinuz-2.x.x" is a reference to a kernel image stored in the /boot directory. Look in your configuration file and find out what your kernel image is called and then go into that directory and rename it. Now rename it accordingly in your lilo/grub configuration file. (either /etc/lilo.conf or /etc/grub.conf (I think))

If anybody can explain this part more clearly for grub users, please do!

Now go back to /usr/src/linux and type the following:

Code:
make
make modules
make modules_install
make bzImage
make install
This should get everything compiled and put into the right places. Now go back into your lilo/grub configuration file and make sure that you've got an extra entry in there. (This should have been created by "make install".) If all looks well cross your fingers and reboot. If not, you'll have to edit your grub/lilo configuration file manually and make sure you've got a new file (bzImage or vmlinuz or some such) in /boot and that it's referenced in your configuration file. Now just reboot and hope it works!

--Dane
 
Old 12-01-2004, 02:54 AM   #3
abcdefghij
LQ Newbie
 
Registered: Nov 2003
Location: Germany
Distribution: Debian
Posts: 26

Rep: Reputation: 15
Have a look at this "Kernel Rebuild Guide":
http://www.digitalhermit.com/linux/K...ild-HOWTO.html

It's very detailed, and I found it quite helpful.

Oliver
 
Old 12-01-2004, 07:01 AM   #4
sonic
Member
 
Registered: Jan 2002
Location: PA
Distribution: Mint
Posts: 58

Rep: Reputation: 16
The FC distros make it easier to compile the kernel.

As root under your source directory, you will need to do the following.

make xconfig
make
make modules_install
make install

The initrd and the bzimage are done for you. If you are using grub it will also be automatically updated for you. You will need to edit it to make your new kernel the default boot kernel.

The build config from the distro is stored in the boot directory. You can load that into xconfig if want to start out.

The most important thing is you need the source code for your kernel version. FC does automatic kernel updates, but it does not update the source code. I did this with "yum install kernel-sourcecode". The weird thing about that is it deleted the previous source code that came with the cd.

You can also get the vanilla source code from
http://www.kernel.org
 
Old 12-01-2004, 07:04 AM   #5
Maqo
LQ Newbie
 
Registered: Jan 2003
Location: NY
Distribution: Mandrake 10.0 Official
Posts: 21

Rep: Reputation: 15
Sean, if you'd really like to get your hands dirty and try recompiling the latest kernel source, take a look at http://www.kernel.org/. It contains the latest kernel source code maintained by Linus Torvalds' team, including instructions. As long as you don't take any entries out of your lilo.conf file (or whatever bootloader you use) you'll be able to revert back to your previous known working version in the event things go awry. Good luck!
 
Old 12-01-2004, 08:50 AM   #6
dsegel
Member
 
Registered: Aug 2004
Location: Davis, California
Distribution: Gentoo, always Gentoo.
Posts: 159

Rep: Reputation: 30
Recompiling your kernel probably won't make your computer start up any faster. Most of the delay is in hardware detection and driver and module loading, and all of that goes on after the kernel is loaded.

Doesn't FC do some kind of "new hardware detection" process during the boot process? Or am I thinking of SuSE? in any case, if it's doing that every time it boots you'll lose several seconds while it's searching for new hardware. Turn off that function and you should save quite a bit of time.

You could save some memory by taking out all the junk that is standard in the FC kernel that you don't need, however.
 
Old 12-01-2004, 09:42 AM   #7
neilman
Member
 
Registered: Oct 2004
Location: Northville, MI
Distribution: Slackware
Posts: 65

Rep: Reputation: 15
Just FYI, there's also the make menuconfig (as opposed to xconfig), just in case you'd like a text (ncurses) based method to configure your kernel settings.
 
Old 12-01-2004, 11:16 AM   #8
vanBuskirk
LQ Newbie
 
Registered: May 2004
Posts: 4

Rep: Reputation: 0
Note that FC3 does not include a kernel-source package. You have to install the srpm, which has the side effect of changing the directory locations discussed above, and the procedure for changing/compiling the kernel. Refer to file:/usr/share/doc/HTML/index.html on your FC3 system, and this thread:
Core 3 Kernel Sources
 
  


Reply



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
Determining IP info for eth0 failed, PLS HELP robalo Linux - Newbie 4 03-27-2008 07:55 PM
pls help. wireless card can't determine IP info hushhush Linux - Laptop and Netbook 4 05-22-2005 11:35 AM
Can someone pls take a look at my Squid Cache Manager info and tell me whats wrong!!! debloxie Linux - Networking 1 02-05-2004 03:32 AM
Can someone pls take a look at my Squid Cache Manager info and tell me whats wrong!!! debloxie Linux - Networking 0 02-04-2004 05:10 AM
SAMBA ERRORS and TOTAL INFO PLS HELP AnselmoMH Linux - Networking 2 06-25-2003 05:21 PM

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

All times are GMT -5. The time now is 02:08 PM.

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