LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-10-2007, 12:56 AM   #1
Ammad
Member
 
Registered: Apr 2004
Distribution: redhat 9.0, fc4, redhat as 4
Posts: 522

Rep: Reputation: 31
Kernel Compilation


Dear all,

i am running FC6, and want to compile kernel, that is available in

/usr/src/kernels/2.6.18-1.2798.fc6-i586

#make menuconfig

#make bzImage

after this i am getting error,

scripts/kconfig/conf -s arch/i386/Kconfig
CHK include/linux/version.h
CHK include/linux/utsrelease.h
make[1]: *** No rule to make target `init/main.o', needed by `init/built-in.o'. Stop.
make: *** [init] Error 2

i also downloaded kernel from www.kernel.org 2.6.8

and moved it to /usr/src/linux-2.6.8.tar.gz

# tar xzvf linux-2.6.8.tar.gz
# cd linux-2.6.8
# make menuconfig

After that i am getting error

HOSTCC scripts/basic/fixdep
HOSTCC scripts/basic/split-include
HOSTCC scripts/basic/docproc
SHIPPED scripts/kconfig/zconf.tab.h
HOSTCC scripts/kconfig/conf.o
HOSTCC scripts/kconfig/mconf.o
scripts/kconfig/mconf.c:91: error: static declaration of ‘current_menu’ follows non-static declaration
scripts/kconfig/lkc.h:63: error: previous declaration of ‘current_menu’ was here
make[1]: *** [scripts/kconfig/mconf.o] Error 1
make: *** [menuconfig] Error 2



Can any one help ?
 
Old 04-10-2007, 03:04 AM   #2
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Quote:
I am running FC6, and want to compile kernel, that is available in

/usr/src/kernels/2.6.18-1.2798.fc6-i586
... why? http://fedoraproject.org/wiki/Bugs/FC6Common

Quote:
make[1]: *** No rule to make target `init/main.o', needed by `init/built-in.o'. Stop.
make: *** [init] Error 2
The problem is that Red Hat Enterprise Linux 4 (RHEL 4), and therefore, Fedora, ships with a fake kernel source that's more than kernel header files, and less than a full kernel.
You can make menuconfig
You can make modules
You cannot make
You cannot make bzImage

If you want to build a real kernel, you have to use yum to install the actual source code.

See documents like
http://kbase.redhat.com/faq/FAQ_85_5109.shtm
Quote:
also downloaded kernel from www.kernel.org 2.6.8

and moved it to /usr/src/linux-2.6.8.tar.gz

# tar xzvf linux-2.6.8.tar.gz
# cd linux-2.6.8
# make menuconfig
... did you remember to make clean (after the last build attempt) before doing this?

However, I think your error may be related to building an older kernel with the very latest tools. Why not try compiling the latest one?

Last edited by Simon Bridge; 04-10-2007 at 03:05 AM.
 
Old 04-25-2007, 01:28 PM   #3
dmangal
LQ Newbie
 
Registered: Apr 2007
Posts: 12

Rep: Reputation: 0
Alas I found a thread that came closest to explaining why i keep having problems compiling a new kernel.

My Problem's Background
- I am using RHEL5 (kernel 2.6.18-8.el5)
- The currently installed kernel enables SMP, however, i would like to build a new non-smp kernel to boot into
- I downloaded kernel-2.6.18-8.1.1.el5.src.rpm and followed instructions from http://kbase.redhat.com/faq/FAQ_85_5109.shtm (correctly...I think??)
- Next I copy .src.rpm file to my /usr/src/kernels/ directory
- I do the following:
# rpm -ivh kernel-2.6.18-8.1.1.el5.src.rpm
# cd /usr/src/redhat/SPECS
# rpmbuild -bp --target=i686 kernel-2.6.spec
# cp -a /usr/src/redhat/BUILD/kernel-2.6.18 /usr/src/kernels/
# cd /usr/src/kernels/kernel-2.6.18
# make menuconfig <---Here i changed CONFIG_SMP from y to n
# make bzImage
# make modules
# make modules_install
# make install
# reboot


I am able to select my kernel i want to boot into from the grub loader. However, during the process of setting up 'stuff', the system hangs at the point where it is:
Setting up Logical Volume Management:

Not sure why...are there config parameters i need to change as well???

Last edited by dmangal; 04-25-2007 at 01:57 PM.
 
Old 04-25-2007, 07:01 PM   #4
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
You need to read around the config concerning LVM ... if you do not use LVM, then it is likely safe to disable this anyway.
 
Old 04-27-2007, 07:50 AM   #5
dmangal
LQ Newbie
 
Registered: Apr 2007
Posts: 12

Rep: Reputation: 0
Although not sure whether I need this, I'm gonna assume that I do because I can install an additional SMP kernel without having to change anything relating to LVM...

One additional note is that I installed a standard kernel (2.6.18.8) from the kernel.org site in the same exact way, disabling just the CONFIG_SMP and I was able to boot into this new kernel. However, i can't go with this approach and need to get a Red Hat supported kernel working.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
kernel compilation-From where it should be started for already compiled kernel b0nd Linux - Newbie 11 08-17-2005 01:08 PM
kernel compilation : to remove a kernel which files should be deleted b0nd Linux - Newbie 2 08-17-2005 11:35 AM
Kernel compilation problems, distorted video and kernel panic shamrock_uk Linux - Laptop and Netbook 5 08-12-2005 10:53 PM
does kernel-source installs with the compilation cum installtion of a new kernel? luqman Linux - General 18 03-04-2005 07:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:32 AM.

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