LinuxQuestions.org
Review your favorite Linux distribution.
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 09-19-2007, 05:51 AM   #1
dikamba
LQ Newbie
 
Registered: Sep 2007
Posts: 12

Rep: Reputation: 0
Unhappy Problem compilling linux kernel 2.6.9-34.El-smp


Hi all ,
I'm a new user of this fantastic forum.
First of all ... Sorry for my english , but I'm portuguese.

I'm trying to compile linux kernel 2.6.9-34.EL-smp and an error appears during this proccess.
Procedures step by step:
1) Change to directory /usr/src/Kernels/2.6.9.-34.EL
2) Run make menuconfig ( and save file .config on end)
3) Run make dep
4) Run make bzImage
And after this command , errors occurs.


Code:
CHK include/linux/version.h
CHK include/asm-i386/asm_offsets.j
/bin/sh: arch/i386/kernel/asm-offsets.s:no such file or directory
UPD: include/asm-i386/asm_offsets.h
mv: cannot stat ´include/asm-i386/asm_offsets.h.tmp´:no such file or directory
make:***[include/asm-i386/asm_offsets.h] Error 1
Can You Help me ?

Best regards
 
Old 09-19-2007, 10:15 AM   #2
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 58
You need to first actually have the kernel source installed and prepped, you seem to only have the kernel-devel and kernel-headers packages installed. These are not the full source code and are only useful for building kernel modules and such not a new kernel.

Next you using old 2.4 kernel series commands in your attempt to build a working kernel.

You are building a kernel which has been updated a number of times the current version is;
kernel-2.6.9-55.0.6.EL.src.rpm 48373 KB 08/31/2007 03:56:00 AM

But to help you out you want to download this;
ftp://ftp.redhat.com/pub/redhat/linu...-34.EL.src.rpm

Then do;

rpm -ivh kernel-2.6.9-34.EL.src.rpm
cd /usr/src/redhat/SPECS
rpmbuild -bp --target $(uname -m) kernel-2.6.spec
cd /usr/src/redhat/BUILD/kernel-2.6.9/linux-2.6.9

The steps to build a kernel are in order;
make mrproper
make oldconfig
make menuconfig
make
make modules_install
make install

The use of 'make oldconfig' should give you a working .config file to start with. Please spend the time while using 'make menuconfig' to insure your hardware has been configured, if not the spend the time required adding the support you need.
 
Old 09-20-2007, 12:54 PM   #3
dikamba
LQ Newbie
 
Registered: Sep 2007
Posts: 12

Original Poster
Rep: Reputation: 0
Talking Problem Resolved

Hi Lenard,

Thks for your help.
I applied your instructions ( step by step ) and the new kernel is done.

Best regards
 
Old 09-20-2007, 06:20 PM   #4
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 58
You are welcome, glad to help.............

You might be interested in reading (or having for reference);

http://www.kernel.org/pub/linux/kern...kn_pdf.tar.bz2
 
Old 09-27-2007, 08:31 AM   #5
Janneman
Member
 
Registered: May 2004
Distribution: Fedora Core 6
Posts: 36

Rep: Reputation: 15
Hi,

The command rpmbuild is not known on my Fedora Core 6 system.
'yum install rpmbuild' says:

No Match for argument: rpmbuild
Nothing to do

How can I build a new kernel?

Janneman.
 
Old 09-27-2007, 09:24 AM   #6
TheDirtyScreech
Member
 
Registered: Jul 2007
Distribution: Gentoo, LFS
Posts: 42

Rep: Reputation: 15
Quote:
Originally Posted by Janneman View Post
The command rpmbuild is not known on my Fedora Core 6 system.
...
How can I build a new kernel?
You just need to download the kernel source (http://www.kernel.org/ is a good start) to the directory /usr/src, symlink /usr/src/linux to point to what you just downloaded (/usr/src-linux-2.6.22, for example), then cd into /usr/src/linux and run the following:

Code:
make mrproper
make menuconfig
make && make modules_install
make install
"make mrproper" probably isn't necessary since it's your first time compiling from that source on that machine, but it's good habit. "make menuconfig" brings up a configuration menu for configuring your kernel options. "make" actually compiles the kernel and modules while "make modules_install" installs the modules. Finally, "make install" installs the kernel to /boot (probably calls it /boot/vmlinuz by default).


Note about /usr/src/linux: Linus hates that people still use /usr/src/linux symlink when compiling their kernels. There is plenty of discussion about this issue on the net. I understand the reasons he gives, but when it comes down to it, some code looks specifically for /usr/src/linux when compiling and errors out if it's not there. I haven't had it often, but I have had it happen. Therefore, I don't heed Linus's advice on this one.

-TDS-
 
Old 09-27-2007, 02:19 PM   #7
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 58
To: Janneman

The correct command is; yum install rpm-build
 
Old 11-14-2007, 04:28 AM   #8
Misbah Naveed
Member
 
Registered: Oct 2007
Posts: 41

Rep: Reputation: 15
Hi
I Need The Steps For Compiling Kernel 2.6.9-42.el For Redhat Enterprise When New Module Is Installed.can Someone Help Me Please........
 
Old 11-14-2007, 05:08 AM   #9
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 58
The same steps apply, one has to add the new module as a kernel patch first then rebuild the kernel or edit the kernel config file and build the new module/kernel. If you are just adding a new module from the source then one does not have to rebuild the kernel.

See my post # 4 in this thread and; http://wiki.centos.org/HowTos ;

Kernel:

* I need the Kernel Source
* I need to build a custom kernel
* Build your own kernel modules
 
  


Reply

Tags
compile error



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
Hyperthread server goes to kernel panic with SMP kernic, boots ok with non SMP kernel abefroman Linux - Kernel 1 09-15-2006 05:43 PM
Kernel re-installing/compilling Panagiotis_IOA Slackware 6 02-09-2006 10:27 AM
compilling 2.6.7 kernel Help props666999 Linux - General 2 11-12-2004 08:15 PM
error after compilling kernel greklas Slackware 2 09-06-2004 01:53 PM
compilling kernel 2.4.18 gusgorman Linux - General 2 06-18-2002 03:54 AM

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

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