LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-07-2009, 07:07 PM   #1
zogthegreat
Member
 
Registered: Apr 2009
Location: Montreal, Canada
Distribution: Fedora, CentOS, Ubuntu
Posts: 63

Rep: Reputation: 16
need help compiling my kernel


Hi everyone,

I need some help with compiling my kernel under Fedora 11. Why am I trying to compile my kernel, you may ask? Because it is there!! ; ) (Actually, I am trying to learn more about what I am using and doing in Linux).

I am following the direction I found here: http://fedoraproject.org/wiki/Docs/CustomKernel , and I am having a problem.

Everything goes fine for this part:

rpmdev-setuptree
yumdownloader --source kernel
su -c 'yum-builddep kernel-2.6.29.6-217.2.3.fc11.src.rpm'
rpm -Uvh kernel-2.6.29.6-217.2.3.fc11.src.rpm
cd ~/rpmbuild/SPECS
rpmbuild -bp --target=x86_64 kernel.spec

but when I enter this part:

[bill@gryphon SPECS]$ cp -r ~/rpmbuild/BUILD/kernel-2.6.$ver/linux-2.6.$ver.$arch ~/rpmbuild/BUILD/kernel-2.6.$ver.orig
cp: cannot stat `/home/bill/rpmbuild/BUILD/kernel-2.6./linux-2.6..': No such file or directory
[bill@gryphon SPECS]$

I have tried to be logical about it and tried this:

cp -r /home/bill/rpmbuild/BUILD/kernel-2.6.29/linux-2.6.29.x86_64/arch /home/bill/rpmbuild/BUILD/kernel-2.6.29/vanilla-2.6.29

and this:

cp -r /home/bill/rpmbuild/BUILD/kernel-2.6.$ver/linux-2.6.29.x86_64$ver.$arch /home/bill/rpmbuild/BUILD/kernel-2.6.$ver.vanilla-2.6.29

But nothing has worked.

Does anyone have any suggestions?

Thanks

zog
 
Old 08-07-2009, 09:28 PM   #2
mcolangelo
LQ Newbie
 
Registered: Jun 2009
Location: USA, WI
Distribution: Gentoo
Posts: 25

Rep: Reputation: 17
Quote:
but when I enter this part:

[bill@gryphon SPECS]$ cp -r ~/rpmbuild/BUILD/kernel-2.6.$ver/linux-2.6.$ver.$arch ~/rpmbuild/BUILD/kernel-2.6.$ver.orig
cp: cannot stat `/home/bill/rpmbuild/BUILD/kernel-2.6./linux-2.6..': No such file or directory
[bill@gryphon SPECS]$
According to the guide that you are following that step is only needed if you are patching your kernel source. I'm guessing you don't need to patch your new kernel sources. You can skip that step and continue on with the guide.

From http://fedoraproject.org/wiki/Docs/CustomKernel
Quote:
Copy the Source Tree and Generate a Patch

This step is for applying a patch to the kernel source. If a patch is not needed, proceed to "Configure Kernel Options".
 
Old 08-07-2009, 11:19 PM   #3
voyciz
Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 425

Rep: Reputation: 40
Probably need to add some brackets around those variables when referencing them. For instance rather than
frank="fat"
$frankboy

I would instead use
${frank}boy

This makes your commands much more clear to the shell

Last edited by voyciz; 08-07-2009 at 11:23 PM.
 
Old 08-08-2009, 12:35 PM   #4
zogthegreat
Member
 
Registered: Apr 2009
Location: Montreal, Canada
Distribution: Fedora, CentOS, Ubuntu
Posts: 63

Original Poster
Rep: Reputation: 16
Thanks,

I did what both of you suggested, I feel somewhat foolish not catching the patch part, - thanks mcolangelo for pointing this out to me. After running make menuconfig, I compiled the kernel. Everything seemed to go smoothly, until I tried to install the kernel rpm. Then I received this error:

[bill@gryphon SPECS]$ rpm -ivh /home/bill/rpmbuild/RPMS/x86_64/kernel-2.6.29.6-217.2.3.test.fc11.x86_64.rpm
error: Failed dependencies:
kernel-firmware >= 2.6.29.6-217.2.3.test.fc11 is needed by kernel-2.6.29.6-217.2.3.test.fc11.x86_64

I looked in the /rpmbuild/RPMS/x86_64 directory and this is all that is there:

[bill@gryphon x86_64]$ pwd
/home/bill/rpmbuild/RPMS/x86_64
[bill@gryphon x86_64]$ ls
kernel-2.6.29.6-217.2.3.test.fc11.x86_64.rpm kernel-debuginfo-2.6.29.6-217.2.3.test.fc11.x86_64.rpm
kernel-debug-2.6.29.6-217.2.3.test.fc11.x86_64.rpm kernel-debuginfo-common-2.6.29.6-217.2.3.test.fc11.x86_64.rpm
kernel-debug-debuginfo-2.6.29.6-217.2.3.test.fc11.x86_64.rpm kernel-devel-2.6.29.6-217.2.3.test.fc11.x86_64.rpm
kernel-debug-devel-2.6.29.6-217.2.3.test.fc11.x86_64.rpm kernel-headers-2.6.29.6-217.2.3.test.fc11.x86_64.rpm

Any suggestions where I went wrong?

Thanks

zog

Last edited by zogthegreat; 08-08-2009 at 12:43 PM.
 
Old 08-08-2009, 02:02 PM   #5
mcolangelo
LQ Newbie
 
Registered: Jun 2009
Location: USA, WI
Distribution: Gentoo
Posts: 25

Rep: Reputation: 17
What command did you use to build the kernel??

I'm not 100% familiar with the way that Fedora does things but looking at the guide I see that there are a few different options for performing your build. Maybe you need to build your kernel differently?

Based off the error message you are receiving it looks like you needed to build your kernel with the firmware included.

Quote:
[bill@gryphon SPECS]$ rpm -ivh /home/bill/rpmbuild/RPMS/x86_64/kernel-2.6.29.6-217.2.3.test.fc11.x86_64.rpm
error: Failed dependencies:
kernel-firmware >= 2.6.29.6-217.2.3.test.fc11 is needed by kernel-2.6.29.6-217.2.3.test.fc11.x86_64
I know it's a time consuming process, but maybe try rebuilding your kernel with the following command to produce a compatible firmware that will satisfy the dependency.

From http://fedoraproject.org/wiki/Docs/CustomKernel
Code:
    *  To build with firmware included, do: 
rpmbuild -bb --with baseonly --with firmware --without debuginfo --target=`uname -m` kernel.spec
 
Old 08-08-2009, 02:37 PM   #6
zogthegreat
Member
 
Registered: Apr 2009
Location: Montreal, Canada
Distribution: Fedora, CentOS, Ubuntu
Posts: 63

Original Poster
Rep: Reputation: 16
ok, I recompiled with what you suggested and that worked,. However, I can't seem to locate the new kernel. This is what I did:

[bill@gryphon x86_64]$ su -c 'rpm -ivh kernel-2.6* kernel-firmware*'
Password:
Preparing... ########################################### [100%]
1:kernel-firmware ########################################### [ 50%]
2:kernel ########################################### [100%]
[root@gryphon ~]# rpm -q kernel-2.6.29.6-217.2.3.test.fc11.x86_64.rpm
package kernel-2.6.29.6-217.2.3.test.fc11.x86_64.rpm is not installed
[root@gryphon x86_64]# rpm -ivh kernel-firmware-2.6.29.6-217.2.3.test.fc11.x86_64.rpm
Preparing... ########################################### [100%]
package kernel-firmware-2.6.29.6-217.2.3.test.fc11.x86_64 is already installed
[root@gryphon x86_64]# rpm -ivh kernel-2.6.29.6-217.2.3.test.fc11.x86_64.rpm
Preparing... ########################################### [100%]
package kernel-2.6.29.6-217.2.3.test.fc11.x86_64 is already installed
[root@gryphon x86_64]#


Once again, argh!!

Last edited by zogthegreat; 08-08-2009 at 02:40 PM.
 
Old 08-08-2009, 03:54 PM   #7
zogthegreat
Member
 
Registered: Apr 2009
Location: Montreal, Canada
Distribution: Fedora, CentOS, Ubuntu
Posts: 63

Original Poster
Rep: Reputation: 16
update:

I rebooted my system and my new kernel was installed. However, (I think with recompiling the kernel, "however", is a key word!), I messed up somewhere and my system froze trying to detect my Logitech mouse.

I guess I will try to go through the options on the kernel.spec file and try to see where I went wrong.

BUT! It did work.

Thanks for all of your help.

zog
 
Old 08-08-2009, 04:08 PM   #8
mcolangelo
LQ Newbie
 
Registered: Jun 2009
Location: USA, WI
Distribution: Gentoo
Posts: 25

Rep: Reputation: 17
Cool, glad it worked. Compiled your first kernel with minor problems!
 
Old 08-08-2009, 05:04 PM   #9
zogthegreat
Member
 
Registered: Apr 2009
Location: Montreal, Canada
Distribution: Fedora, CentOS, Ubuntu
Posts: 63

Original Poster
Rep: Reputation: 16
yeah, I will keep trying until I get it figured out.

btw, do you think installing kdump would help me figure out what went wrong?
thanks

zog
 
Old 08-09-2009, 06:11 PM   #10
mcolangelo
LQ Newbie
 
Registered: Jun 2009
Location: USA, WI
Distribution: Gentoo
Posts: 25

Rep: Reputation: 17
kdump wouldn't hurt. I've never used it myself but quickly glancing at it's usage, it looks like it could be helpful.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Good but sorta easy guide to Kernel compiling/Re-Compiling? linus72 Linux - General 1 07-13-2009 01:37 PM
Compiling a module separately without compiling entire kernel kushalkoolwal Linux - Kernel 8 08-06-2008 01:45 AM
compiling kernel problem --- Kernel panic: unable to mount root fs ........ anthonymts123 Linux - General 5 07-31-2006 02:29 AM
Where Is Kernel Directory In Rh9(kernel 2.4.20-8), For Compiling HSP56 MR(pctel) Mode rudy3107 Linux - Software 1 07-25-2004 04:17 AM
Kernel compiling and module compiling tarballed Linux - General 1 12-22-2002 05:31 PM

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

All times are GMT -5. The time now is 06:05 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
Open Source Consulting | Domain Registration