PDA

View Full Version : Kernel recompile - selecting .config


echo6
9th January 2011, 05:06 PM
I'm following the Building a Custom Kernel guide from the wiki, http://fedoraproject.org/wiki/Building_a_custom_kernel for FC14.

Even though I specify rpmbuild --target=i686 the build process picks out the PAE version. This has been tripping me up because I have been patching the kernel with Spock's fbcondecor patch which requires post .config changes to support console decorations.

I'm not familiar enough with rpmbuild and SPECS to troubleshoot at this stage so some pointers would be greatly appreciated regarding suitable guides which will give me an understanding of how rpmbuild does things.

Previously I've done kernel recompiles under Gentoo and Debian/Ubuntu but have a need to use Fedora, I miss my console decorations :-) I'm hoping I can get some of the rpm packages from http://home.arcor.de/helmut.schlattl/gensplash/ to help get his setup!

AndrewSerk
9th January 2011, 05:34 PM
Hello echo6,

I have been using --target=`uname -m` and it builds PAE and none PAE kernel versions when rebuilding from a src.rpm .

I have been using something similar the following rebuild command:
rpmbuild --rebuild --with baseonly --without debuginfo --target=`uname -m` kernel-2.6.37-2.fc15.src.rpm

Hope this helps,
Andrew

JEO
9th January 2011, 05:41 PM

Have you tried adding the --without <option> parameter to the rpmbuild command?

rpmbuild --without pae --target=i686

echo6
9th January 2011, 09:24 PM
Actually it does build both pae versions and generic i686 version, however it doesn't appear to be using the config file.

e.g.
[echo6@toshiba:~/rpmbuild]$ ls -l RPMS/i686/
total 55368
-rw-r--r--. 1 echo6 echo6 22066204 Jan 9 17:44 kernel-2.6.35.10-74.toshiba.fc14.i686.rpm
-rw-r--r--. 1 echo6 echo6 6903460 Jan 9 17:44 kernel-devel-2.6.35.10-74.toshiba.fc14.i686.rpm
-rw-r--r--. 1 echo6 echo6 924076 Jan 9 17:44 kernel-firmware-2.6.35.10-74.toshiba.fc14.i686.rpm
-rw-r--r--. 1 echo6 echo6 755180 Jan 9 17:44 kernel-headers-2.6.35.10-74.toshiba.fc14.i686.rpm
-rw-r--r--. 1 echo6 echo6 18840332 Jan 9 17:44 kernel-PAE-2.6.35.10-74.toshiba.fc14.i686.rpm
-rw-r--r--. 1 echo6 echo6 6848044 Jan 9 17:45 kernel-PAE-devel-2.6.35.10-74.toshiba.fc14.i686.rpm
-rw-r--r--. 1 echo6 echo6 346248 Jan 9 17:44 perf-2.6.35.10-74.toshiba.fc14.i686.rpm

[echo6@toshiba:~/rpmbuild]$ grep FB_CON SOURCES/config-i686
CONFIG_FB_CON_DECOR=y
[echo6@toshiba:~/rpmbuild]$ grep FB_CON /boot/config-2.6.35.10-74.toshiba.fc14.i686
[echo6@toshiba:~/rpmbuild]$

echo6
16th January 2011, 11:53 AM
I've moved on from that guide because there is a lot going on that I can't follow. It seems overly complicated and I'm not really certain which directories are being used etc for the compile process. Also I can't seem to select the correct .config post fbcondecor patch to include the FB_CON_DECOR option.

I'm now following this guide http://blog.linuxing.org/2010/01/how-to-compile-a-kernel-the-fedora-way/ am I right in thinking that mkinitrd in FC14 has been replaced with another tool?

Gödel
16th January 2011, 11:59 AM
it won't use the .config file unless you copy it (after making customisations) back to rpmbuild/SOURCES/ with the correct name (something like config-`uname -m` or config-`uname -m`-generic, look in the directory for the closest match).

You also must add "# i386" (or "# x86_64") to the top of the .config file manually.

echo6
16th January 2011, 12:19 PM
Thanks for the response, yes I've done that step by following the fedoraproject.org guide.
I have a config file ~/rpmbuild/SOURCES/config-i686 the first line of which contains
# i386

Makes no difference.

jbkt23
16th January 2011, 01:59 PM
eho6
I went through a similar effort and ran out of energy before I could work out the final solution, but I was on the right track once I had followed Godel's advice. Take a look at the following link, post #15 is where the discussion becomes more relevant.

http://fedoraforum.org/forum/showthread.php?t=225820

Since you are just patching the kernel you should have more success than I because I was disabling every module I thought me system didn't need and I was over zealous in that respect.

Keep trying

echo6
16th January 2011, 03:59 PM
I have a config from a Debian install that I have used succesfully on the laptop I'm trying to build the custom kernel for. Like you I am remove drivers etc that I don't need, in addition fbcondecor provides a new character device so you can put images on your framebuffer console. So I can't use a stock config file.

Perhaps I've overlooked a step somewhere, and atm if I have a fail to see where!