LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 08-22-2005, 11:33 PM   #1
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Rep: Reputation: 56
To recompile kernel


Hi folks,

LFS 6.1
FC3 Host

I'm prepared to recompile kernel on chroot environment to select some modules/options.

@localhost.localdomain : /root@localhost:/sources/wvstreams-4.0.1# find / -name linux -type d
Code:
...
...
/tools/include/linux
/usr/include/linux
...
I suppose /usr/include/linux is the kernel source.

@localhost.localdomain : /root@localhost:/sources/wvstreams-4.0.1# ls /usr/include/linux/
Code:
8250_pci.h         cyclades.h              icmp.h               keyboard.h          parport_pc.h       smb_mount.h
acct.h             cycx_cfm.h              icmpv6.h             keyctl.h            parser.h           smbno.h
After "cd /usr/include/linux/" I suppose to run following commands

-make menuconfig
-make
-make modules_install

"make mrproper" can be left out. Is it "make menuconfig" bringing up the small window for selecting modules/options???

Please advise if I'm wrong. TIA

B.R.
satimis
 
Old 08-23-2005, 02:28 AM   #2
evgrinsven
LQ Newbie
 
Registered: Jul 2005
Distribution: slackware
Posts: 3

Rep: Reputation: 0
Hi Satimis,

/usr/include/linux is NOT the place for the kernel source.
It's the place where only the headers are.

If you have not already done so, you have to download the kernel-sources

http://www.kernel.org/pub/linux/kern....11.12.tar.bz2

, and unpack them (usually at /usr/src)

Then you can cd into this directory /usr/src/linux-2.6.11.12 and proceed with making your config.


Hope this has been a little help to you.

Greetings Eric
 
Old 08-23-2005, 03:14 AM   #3
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Hi evgrinsven,

Tks for your advice and link. For only selecting some modules and options, not upgrade the kernel, whether following steps are appropriate;

Remark: I'm now building LFS 6.1 having the tarball linux-2.6.11.12.tar.bz2 on /sources.

1) untar the tarball to /usr/src/
2) cd /usr/src/linux
3) make clean
4) make menuconfig
(selecting the necessary items here)
5) make dep
6) make vmlinux
(Is this step necessary because I'm not upgrade the kernel. Using Grub ???)
7) make modules
8) make modules_install
9) copy new System.map and vmlinux files to boot
(I think this step can be omitted ???)
10) reboot

Please advise. TIA

B.R.
satimis
 
Old 08-23-2005, 03:23 AM   #4
tp11235
Member
 
Registered: Feb 2005
Posts: 106
Blog Entries: 1

Rep: Reputation: 15
I run SuSE 9.1 but the basics will be the same. As you suggest Make Menuconfig will bring up a menu based program that creates the makefile that you then use in the second make command.

The sources tarball will have a very good README that is essential reading. I would also recommend: Welsh, Dalheimer & Kaufman (1999) Running Linux Sebastopol CA: O'Reilly. It has plenty of good advice.

My advice is to make the choices carefully, unfortunately you cannot always accept the default. I made some bad choices on one upgrade and ended up with a system that would not boot. I had not got a back up system in place at that point and I had to reinstall from scratch.

On the other hand you will know your system inside out when you have done it. Good Luck.
 
Old 08-23-2005, 04:31 AM   #5
evgrinsven
LQ Newbie
 
Registered: Jul 2005
Distribution: slackware
Posts: 3

Rep: Reputation: 0
Hi Satimis,


1) untar the tarball to /usr/src/
2) cd /usr/src/linux-2.6.11.12


You can basically follow
http://www.linuxfromscratch.org/lfs/...08/kernel.html (you should read this)


1) make mrproper
2) make menuconfig
3) make (makes also the modules,
4) make modules_install
5) cp arch/i386/boot/bzImage /boot/lfskernel-2.6.11.12
6) cp System.map /boot/System.map-2.6.11.12
7) cp .config /boot/config-2.6.11.12


I don't get where you ask "6) make vmlinux
(Is this step necessary because I'm not upgrade the kernel. Using Grub ???)"

Following the book is not a bad advice I can give.
http://www.linuxfromscratch.org/lfs/...er08/grub.html

You could use the grub and grub.conf of your Fedora-installation. But then you should point that also to (partition where your LFS is)/boot/lfskernel-2.6.11.12.

As for configuring your kernel. You could use the FC3-kernel-config (maybe it is in /boot?)
Copy it to /usr/src/linux-2.6.11.12
and after
1) make mrproper
you copy this "name-of-FC3-kernel-config" to .config (mind the little dot!)

then do
make oldconfig (maybe you have to answer some questions)
and go further by

2) make menuconfig (here you can make your adjustments)



Hope this has been a little help to you.

Greetings Eric
 
Old 08-23-2005, 04:54 AM   #6
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Hi evgrinsven,

Tks for your advice.

Sorry for not having mentioned on my first posting that I have finished building LFS 6.1 and am now moving to BLFS. LFS 6.1 is now working without problem already with X-window and Firefox running on it. Becausing making ADSL to work on this box I need to tunn on "PPP support for async serial ports", "PPP support for sync tty ports, etc. I haven't recompiled kernel for sometimes and am not sure of its recent procedure whether there are new steps added. Therefore I started to search avoiding making a mistake.

It is for building kernel. I did it previously to build the kernel on LFS 6.1. I hesitate whether recompiling kernel will follow this proceduce.

The steps posted on my previous posting merely came from my recollection what I did previously in upgrade/recompile kernel. I'll go through the documentation on /usr/src//linux-2.6.11.12/Documentation. Tks.

B.R.
satimis
 
  


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
how to recompile kernel 2.4.21-15.EL zameer_india Linux - Newbie 2 12-24-2004 01:02 AM
kernel recompile error (kernel panic) tombaaaaa Linux - Newbie 4 08-04-2004 04:32 PM
Should I recompile my kernel? Guitarist88 Linux - Newbie 3 05-31-2004 04:28 PM
recompile the kernel!!! :O HELP! gangster_god Mandriva 3 04-06-2004 03:42 PM
what is recompile kernel? len Linux - Newbie 1 06-22-2003 10:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

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