nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

mini HOWTO - Linux Kernel Compilation

This is a discussion on mini HOWTO - Linux Kernel Compilation within the Getting started tutorials forums, part of the Linux Getting Started category; Ok monk thanx for updating my info repos The thread has been updated...


Go Back   nixCraft Linux Forum > Linux Getting Started > Getting started tutorials

Linux answers from nixCraft.


Getting started tutorials So much to read, so little time! If that is your problem, we have solution. Read our FAQ and tutorials to help you cut through the clutter of information overload. Only members of "contributors" group can post new tutorials. Other members can just reply to thread.

Reply

 

LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 17-12-2006, 03:18 AM
B!n@ry's Avatar
Senior Member
User
 
Join Date: Dec 2006
Location: B!n@ry-z0ne
OS: Ojuba 3
Posts: 129
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
B!n@ry
Send a message via MSN to B!n@ry
Default

Ok monk thanx for updating my info repos
The thread has been updated
__________________
LivE Free 0r DiE
L!nux rul3z aLL
Reply With Quote
  #12 (permalink)  
Old 19-12-2006, 12:03 AM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,710
Thanks: 11
Thanked 245 Times in 184 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Monk,

Good point. Topic is moved to Linux tutorial section
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #13 (permalink)  
Old 19-12-2006, 11:49 PM
Junior Member
User
 
Join Date: Dec 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
SoFy
Default

gr8 tutorial . but there's no need to do the point N6.

y0 can just type :

Code:
make install
Reply With Quote
  #14 (permalink)  
Old 19-12-2006, 11:59 PM
B!n@ry's Avatar
Senior Member
User
 
Join Date: Dec 2006
Location: B!n@ry-z0ne
OS: Ojuba 3
Posts: 129
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
B!n@ry
Send a message via MSN to B!n@ry
Default

Quote:
Originally Posted by SoFy
gr8 tutorial . but there's no need to do the point N6.

y0 can just type :

Code:
make install
Yep, but I think a copy is much faster than an INSTALL
Thanx for joining Sofy ... I really appreciate it
__________________
LivE Free 0r DiE
L!nux rul3z aLL
Reply With Quote
  #15 (permalink)  
Old 20-12-2006, 12:02 AM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,710
Thanks: 11
Thanked 245 Times in 184 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Hi Welcome to nixCraft forum!

Yup you can run make install; few distro such as Debian or Fedora can make changes to grub.conf file as well. However some distro cannot make all modification. In such case this last 3 steps will do the job
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #16 (permalink)  
Old 15-06-2007, 12:07 PM
diptanjan's Avatar
Junior Member
User
 
Join Date: May 2007
Location: Hyderabad
OS: Redhat, Suse
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
diptanjan is on a distinguished road
Send a message via MSN to diptanjan Send a message via Yahoo to diptanjan Send a message via Skype™ to diptanjan
Default

Hi B!n@ry,

I am very new to Linux world. I am trying to learn by experimenting and trying to follow all tutorials that I come accross with. As the best way to learn is by practicing.

I am trying to Upgrade my kernel from 2.6.16.X to 2.6.21.X in Suse Linux 10 desktop version.

I have followed the steps you have mentioned here.

Now I am little confused about the boot loader :

Configuration on /etc/grub.conf file here is not what I am used to with Redhat Linux grub.conf file.

Here is my grub.conf file details :

Quote:
root (hd0,1)
install --stage2=/boot/grub/stage2 /grub/stage1 (hd0,1) /grub/stage2 0x8000 (hd0,1)/grub/menu.lst
quit
Now please suggest where should I put those lines that you mentioned. should I comment out the above lines?

TIA.

Diptanjan
Reply With Quote
  #17 (permalink)  
Old 15-06-2007, 03:22 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,710
Thanks: 11
Thanked 245 Times in 184 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

I'm not sure but try following

SuSELinuxSupport: HowToBuildingacustomKernel

SuSELinuxSupport: How To: Safe Kernel Upgrade For SuSE
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #18 (permalink)  
Old 12-09-2007, 12:27 PM
Junior Member
User
 
Join Date: Sep 2007
OS: Debian and FC &RHEL
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
khadar is on a distinguished road
Default Problem in my Kernel-2.6.12 after rebooting......Please Help me.

Hello!
I am new to Linux kernel compilation. you miniHOW to is very helpful to me. I followed all the steps you given.And also built the "initrd".I compiled linux kernel and initrd in DEBIAN system.I also edited the /grub/menulist also.


After rebooting it is displaying existing kernels in the system.After selecting my newly compiled kernel,it is not booting and displaying following messages

The messages are given below:
**************************************************
Booting 'Debia GNU/Linux, Kernel 2.6.12'

root (hd0,0)
Filesystem type is ext2fs,partition type 0x83
Kernel /boot/vmlinuz-2.6.12 root=/dev/hd1 ro single
[Linux-bzImage , setup=0x1400 , size=0x121673]
initrd /boot/initrd.img-2.6.12
[Linux-initrd@0x13ce3000,0x30a000 bytes]
save default
boot
Un compressing Linux...OK , booting the Kernel

************************************************** **
After that is displaying blank screen...

What is the problem in my kernel ? Please help me!

Thanks in advance !.







Quote:
Originally Posted by B!n@ry View Post
Hello All,

I told you I shall be back with a new idea Today this article came to my mind to write about because when ever I go to a forum I see the same question: How can I compile a Kernel ?

Really this questions is asked by lots of people not just newbie's but even intermediate users. So I decided to write this short article to help out.

Important Note:
Do not run a command as root until I say so.

1st: you download the latest Kernel version from here: The Linux Kernel Archives

2nd: Move the file you downloaded into a directory change to it and if the kernel is downloaded in a gz file type ? you extract it like this:
Code:
tar xvfz kernel-package.gz
if its a bz2 type you extract it like this:
Code:
tar xvfj kernel-package.bz2
3rd: Enter the directory you just extracted and run any of the following kernel configuration types:
1. make config
2. make oldconfig
3. make menuconfig
4. make gconfig
5. make xconfig
Note:- Not all of them exist by default on a Linux System, you need to install them.

the "make config" is a Q&A configurator. "make oldconfig" is used when you have a pre-config file and want to reuse it in compiling the new Kernel. "make menuconfig" is just like the netconfig that runs under CLI and you choose the needed options by marking them with a correct sign. "make gconfig" is a configurator running under GTK+. "make xconfig" is also a configurator run under QT.

4th: Now run
Code:
make
inside the directory of the kernel. This shall build the bzImage.

Important Note:
Now continue to run the commands as root.

5th: Install the needed modules for the kernel. Run this:
Code:
make modules_install
6th: Install the new Kernel, by doing the following:
Code:
cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.0
Code:
cp System.map /boot/System.map-2.6.0
7th: All you have to do now is edit the boot loader used, here I use GRUB. Add the following lines to the end of the file:
Code:
title SUSE Linux 10.1 using Kernel vmlinuz-2.6.0
    root (hd0,0)
    kernel /vmlinuz root=/dev/hda3 vga=0x317 splash=silent showopts
    initrd /initrd
Finally: Reboot your machine you shall have a new running Kernel.

I hope you like this mini HOWTO - Linux Kernel Compilation

Regards 2 all,
B!n@ry
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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 On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Is Linux kernel is monolithic or modular kernel? chiku Linux software 3 27-08-2009 02:56 AM
Mini How to :: How to configure ssh keys on Linux Ashish Pathak Getting started tutorials 3 31-08-2008 02:18 PM
Linux kernel deleted from /boot - how do I resinstall the kernel vaibhav.kanchan Getting started tutorials 2 25-03-2008 12:31 AM
Display Linux kernel information sweta Getting started tutorials 0 27-07-2007 07:00 AM
Smart mini HowTo B!n@ry Getting started tutorials 4 17-12-2006 03:23 AM


All times are GMT +5.5. The time now is 09:23 AM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38