LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-19-2009, 07:35 AM   #1
av.dubey
Member
 
Registered: Nov 2007
Posts: 148

Rep: Reputation: 15
how to compile and install new kernel


i want to download latest kernel release and compile and download it in my fedora 8..

can anyone tell me what are the commands and steps needed for the same..
i do not want to use yum or rpm..i want to download the full kernel and compile it from scratch
 
Old 07-19-2009, 08:06 AM   #2
vonbiber
Member
 
Registered: Apr 2009
Distribution: slackware 14.1 64-bit, slackware 14.2 64-bit, SystemRescueCD
Posts: 420

Rep: Reputation: 86
Quote:
Originally Posted by av.dubey View Post
i want to download latest kernel release and compile and download it in my fedora 8..

can anyone tell me what are the commands and steps needed for the same..
i do not want to use yum or rpm..i want to download the full kernel and compile it from scratch
I use slackware. Here's what I do to build new kernels
After I downloaded the source (linux-2.6.*.tar.bz2) I unpack it in
/usr/src:
# cd /usr/src
# tar jxf /path/where/the/archive/is/located/linux-2.6...tar.bz2

Then I cd to the new directory and I copy there the
current config file as .config, then I run make oldconfig

# cd linux-2.6-...
# cp /boot/config-$(uname -r) .config
# make oldconfig

I then run make menuconfig

# make menuconfig

After going selecting/deselecting the different options I click on
ok and I proceed with the building:

# make bzImage modules

I store the version in a variable (that'll be convenient later on):

# version=${PWD##*/linux-}

Now is the time to backup the current kernel and its modules
in case something goes wrong after I booted with the new kernel

# cd /boot
save a copy of the current kernel, the config file System.map ...
somewhere
# cd /lib/modules
save the directory $(uname -r) and its contents somewhere

then go back to the source tree, and start copying some files

# cd /usr/src/linux-$version
# cp System.map /boot/System.map-$version
# cp arch/x86/boot/bzImage /boot/vmlinuz-$version
# cp .config /boot/config-$version

now cd to /boot to create symbolic links

# cd /boot
# for f in System.map-$version config-$version vmlinuz-$version
do
l=${f%-*}
ln -sf $f $l
done

go back to the source tree to install the modules

# cd /usr/src/linux-$version
# make modules_install

I don't use lilo.
I use grub and in my grub entry I prefer to have a line like

kernel /boot/vmlinuz

rather than
kernel /boot/vmlinuz-some_version

that's the purpose of renewing the soft link vmlinuz in /boot
and I don't have to edit the grub config file each time the
kernel changes

Whenever something goes wrong after I rebooted, I use
either a linux on another partition if there's one available
or a linux live system on a cd or usb stick to put back
the previous kernel and its modules and the soft links
 
  


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
cant compile/install the kernel in the LiveCD i686 install tonye Gentoo 9 09-15-2009 06:33 PM
[Compile kernel] How to compile/install the modules ? frenchn00b Linux - General 1 09-06-2009 04:18 PM
how to compile/install a kernel module? Valkyrie_of_valhalla Linux - Newbie 4 07-11-2007 10:09 AM
compile & install new kernel beeblequix Linux - General 1 02-02-2007 06:09 AM
Compile/install kernel 2.6.17.4- Kubuntu 6.06 tidiman07 Linux - Newbie 5 07-10-2006 12:51 PM


All times are GMT -5. The time now is 03:07 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration