LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   need help compiling my kernel (https://www.linuxquestions.org/questions/linux-software-2/need-help-compiling-my-kernel-745927/)

zogthegreat 08-07-2009 08:07 PM

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

mcolangelo 08-07-2009 10:28 PM

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".


voyciz 08-08-2009 12:19 AM

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

zogthegreat 08-08-2009 01:35 PM

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

mcolangelo 08-08-2009 03:02 PM

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


zogthegreat 08-08-2009 03:37 PM

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!!

zogthegreat 08-08-2009 04:54 PM

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

mcolangelo 08-08-2009 05:08 PM

Cool, glad it worked. Compiled your first kernel with minor problems!

zogthegreat 08-08-2009 06:04 PM

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

mcolangelo 08-09-2009 07:11 PM

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


All times are GMT -5. The time now is 04:36 AM.