LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 11-09-2006, 01:30 AM   #1
Nishant Desai
Member
 
Registered: Jul 2006
Posts: 100
Blog Entries: 1

Rep: Reputation: 15
How to build the kernel tree on the system?


Dear All,

I want to know that how to build the kernel tree on the system? as i rad that to compile and install the kernel, it requires configure and built the kernel tree on the system.

Pls help me to understand this.

Thanks in Advance,
Nishant Desai
 
Old 11-09-2006, 03:21 AM   #2
kstan
Member
 
Registered: Sep 2004
Location: Malaysia, Johor
Distribution: Dual boot MacOS X/Ubuntu 9.10
Posts: 851

Rep: Reputation: 31
1. download kernel you want at www.kernel.org.
2. extract to /usr/src
3. ln -s linux-xxxxx linux
4. cd linux
5. make xconfig then tunning.
6. make bzImage
7. make modules
8. make modules_install (or make modules-install, i forget)
9. make install
10. reboot
11. boot into your new kernel, if have much problem, go back to previous kernel
12. remember after you boot into new kernel, all additional driver like ati or nvidia need to redo.
13. Thats why I don't like recompile kernel, however this is necessary for many computer.

ks
 
Old 11-24-2006, 04:38 AM   #3
Nishant Desai
Member
 
Registered: Jul 2006
Posts: 100

Original Poster
Blog Entries: 1

Rep: Reputation: 15
Hiii,

If i update my kernel version from 2.4 to 2.6, what are the other functionalities i should upgrade with that? so that i can run my kernel successfully.

Thanks,
Nishant
 
Old 11-24-2006, 05:03 AM   #4
kstan
Member
 
Registered: Sep 2004
Location: Malaysia, Johor
Distribution: Dual boot MacOS X/Ubuntu 9.10
Posts: 851

Rep: Reputation: 31
if you didn't install/update any application which is depend on kernel version, then nothing. Normally application always need to take care after upgrade kernel is:-
hardware driver, like ati driver, acer laptop shortcut key driver, webcam driver and etc
software using something similar like hardware driver, like vmware using virtual network adapter
software so close to kernel, like cisco vpn client.

Is it clean?
Ks
 
Old 11-24-2006, 07:39 AM   #5
Nishant Desai
Member
 
Registered: Jul 2006
Posts: 100

Original Poster
Blog Entries: 1

Rep: Reputation: 15
Dear Sir,

I firstly followed ur steps for configuring the Kernel 2.4 and now i got the document to upgrade from 2.4 to 2.6... but in both i m getting the error when i m trying to make the bzImage (when running the bzImage command).

This time i m getting the error:
/usr/src/linux-2.6.18.3/scripts/gen_initramfs_list.sh: Cannot open 'y'
make[1]: *** [usr/initramfs_data.cpio.gz] Error 1
make: *** [usr] Error 2

I couldnt undrstand why this error is coming? and because of this my whole process has stuck up... can you please help me for this?

Can anybody please give me suggetions on this? so that i can make the bzImage... and go ahead.

Pls help me, my whole process has stuck up.

Thanks,
Nishant
 
Old 11-24-2006, 08:59 AM   #6
hiren_bhatt
Member
 
Registered: Oct 2005
Distribution: FC3,Debian
Posts: 127

Rep: Reputation: 15
If you are compiling 2.6 kernel your do not need to make a bzImage,you also need not to do make modules or make module_install.

just xconfig or menuconfig and make.
 
Old 11-24-2006, 09:16 AM   #7
Nishant Desai
Member
 
Registered: Jul 2006
Posts: 100

Original Poster
Blog Entries: 1

Rep: Reputation: 15
Quote:
Originally Posted by hiren_bhatt
If you are compiling 2.6 kernel your do not need to make a bzImage,you also need not to do make modules or make module_install.

just xconfig or menuconfig and make.
Dear Hiren,

Thanks for the info, i have gone through that step successfully now, so that is not a problem, but now i have come to another problem and that is while i am running the command make install.

It is giving me an error like this...

[root@localhost linux-2.6.18.3]# make install
sh /usr/src/linux-2.6.18.3/arch/i386/boot/install.sh 2.6.18.3y arch/i386/boot/bzImage System.map "/boot"

Whats this error? is it because of the make oldconfig and other options? please tell me?

I think this is something in the /boot dir., should i need to change something?

There is a file called... vmlinuz and it is a shortcut to something, so could it be a problem?

Pls give me the suggetions...hoping for the soon reply.

Thanks,
Nishant
 
Old 11-24-2006, 11:44 AM   #8
hiren_bhatt
Member
 
Registered: Oct 2005
Distribution: FC3,Debian
Posts: 127

Rep: Reputation: 15
If compilation is successful, you will see bzImage in arch/i386/boot. Copy this file to /boot and give a name like vmlinux-kernel version. Also edit /boot/grub/grub.conf.

After rebooting into new kernel you may need to do make modules_install.
 
Old 11-24-2006, 10:23 PM   #9
Nishant Desai
Member
 
Registered: Jul 2006
Posts: 100

Original Poster
Blog Entries: 1

Rep: Reputation: 15
Quote:
Originally Posted by hiren_bhatt
If compilation is successful, you will see bzImage in arch/i386/boot. Copy this file to /boot and give a name like vmlinux-kernel version. Also edit /boot/grub/grub.conf.

After rebooting into new kernel you may need to do make modules_install.
Dear Hiren,

What entry in my grub.conf i should change?

My grub.conf looks like below:

___________________________________________________________________________

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/hdb2
# initrd /initrd-version.img
#boot=/dev/hdb
default=1
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Red Hat Linux (2.6.18.3y)
root (hd0,0)
kernel /vmlinuz-2.6.18.3y ro root=LABEL=/ hdc=ide-scsi ramdisk_size=16000
initrd /initrd-2.6.18.3y.img
title Red Hat Linux (2.4.20-8)
root (hd0,0)
kernel /vmlinuz-2.4.20-8 ro root=LABEL=/ hdc=ide-scsi ramdisk_size=16000
initrd /initrd-2.4.20-8.img
_____________________________________________________

Pls tell me what to change after copying the bzImage and giving it another name say foe e.g, vmlinux-kernel as you told, then wat entry will be changed?

Thanks,
Nishant
 
Old 11-24-2006, 11:26 PM   #10
hiren_bhatt
Member
 
Registered: Oct 2005
Distribution: FC3,Debian
Posts: 127

Rep: Reputation: 15
It seems the you all ready have a 2.6.18 kernel. Anyways

you can do it like this

title My Linux (kernel-version)
root (hd0,0)
kernel /vmlinuz-kernel-version

Replace kernel-version by the version you compiled, this should be same as in /boot directory. My Linux is just for example you can keep anything you like

Last edited by hiren_bhatt; 11-24-2006 at 11:27 PM.
 
Old 11-25-2006, 12:34 AM   #11
Nishant Desai
Member
 
Registered: Jul 2006
Posts: 100

Original Poster
Blog Entries: 1

Rep: Reputation: 15
Quote:
Originally Posted by hiren_bhatt
It seems the you all ready have a 2.6.18 kernel. Anyways

you can do it like this

title My Linux (kernel-version)
root (hd0,0)
kernel /vmlinuz-kernel-version

Replace kernel-version by the version you compiled, this should be same as in /boot directory. My Linux is just for example you can keep anything you like
Hiii,Hiren
Thanks, ya thats wat i also thinks wen i had a look ata it and it also shows me two kernels at startup, but wen trying to start up the 2.6.18.3y, it shows me error like this.

"Kernel panic - not syncing : No init found, Try passing init = option to kernel."

I think something should be done for the initrd file, that is what this error is showing, but i dont know in which folder i will find the initrd and what change i should do for initrd?

Pls tell me.

I am sorry for asking to many questions to you, but i m still a newbie and doing this first time... so pls understand my condition.

Thanks,
Nishant
 
Old 11-25-2006, 06:33 AM   #12
hiren_bhatt
Member
 
Registered: Oct 2005
Distribution: FC3,Debian
Posts: 127

Rep: Reputation: 15
The best way of learning is to try again and again without being worried about failing.


When grub screen comes up, press 'e', again press 'e'. Here you can pass parameters to kernel.

For init not found your can do some thing like this, type
init = /sbin/init if this doesnt work then try /bin/bash (make sure you type this for kernel 2.6).

press enter and then press 'b'. If this does not work, there might be some error in kernel compilation.
 
Old 11-25-2006, 02:31 PM   #13
Nishant Desai
Member
 
Registered: Jul 2006
Posts: 100

Original Poster
Blog Entries: 1

Rep: Reputation: 15
Quote:
Originally Posted by hiren_bhatt
The best way of learning is to try again and again without being worried about failing.


When grub screen comes up, press 'e', again press 'e'. Here you can pass parameters to kernel.

For init not found your can do some thing like this, type
init = /sbin/init if this doesnt work then try /bin/bash (make sure you type this for kernel 2.6).

press enter and then press 'b'. If this does not work, there might be some error in kernel compilation.
Hiiii,
i got the error and running the kernel successfully, but now in new kernel new modules are yet to cnfgr... so sm hardwares are not wrkin like sound card, ethernet etc... do u hv any idea abt that??? they are dtected in the lsmod command but i cant activate them.

Pls give me solution if u know.

Thanks,
Nishant
 
Old 11-25-2006, 09:30 PM   #14
hiren_bhatt
Member
 
Registered: Oct 2005
Distribution: FC3,Debian
Posts: 127

Rep: Reputation: 15
Quote:
Originally Posted by Nishant Desai
Hiiii,
i got the error and running the kernel successfully
What was the error and how it was solved?

Last edited by hiren_bhatt; 11-25-2006 at 09:44 PM.
 
Old 11-26-2006, 09:58 PM   #15
Nishant Desai
Member
 
Registered: Jul 2006
Posts: 100

Original Poster
Blog Entries: 1

Rep: Reputation: 15
Quote:
Originally Posted by hiren_bhatt
What was the error and how it was solved?
Hiii,

Actually it was an error while i was configuring the kernel actually, in the document frm which i was taking the help it was clearly written that ext3 config must be done, otherwise you will face this error and exact error i was facing with and thats why i came to know that error and then i again configure my whole kernel, and had done the things successfully.

But as of now i am facing the problems of hardwares detected bu still not working, like Ethernet, Sound card etc.

Thanks,
Nishant
 
  


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
system-config-packages --tree=/mnt/nfs Problem Stang_Man Linux - Enterprise 5 04-25-2007 12:17 AM
LXer: Howto: build Linux kernel module against installed kernel w/o full kernel source tree LXer Syndicated Linux News 0 09-03-2006 08:21 PM
where is linux source build directory/kernel source tree? webazoid Linux - Software 2 07-01-2004 08:37 PM
kernel-tree-2.6.5 The Seeker 11 Debian 2 04-26-2004 02:33 AM
the bible = the tree of the knowledge of good and evil () Jesus = the tree of life Michael111 General 2 04-14-2004 04:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 03:25 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