How to build a fedora kernel
If you were ever interested in building custom kernel rpms for your machine i have detailed the process here with the minimal amount of steps.
First be sure you have the needed tools
- yum-utils
- rpm-build
Then download the latest kernel source
yumdownloader --source kernel
Once that is downloaded lets setup our local rpm tree
rpmdev-setuptree
Extract and install the source
rpm -Uvh kernel-x.y.zz.ii-jjj.fcx.src.rpm
Execute the “%prep” stage from the spec file. Normally this involves unpacking the sources and applying any patches.
rpmbuild -bp --target=`uname -m` ~/rpmbuild/SPECS/kernel.spec
At this point we can setup our configuration to apply during the build.
cd ~/rpmbuild/BUILD/kernel-x.y.zz/linux-x.y.zz.`uname -m`/ make oldconfig make menuconfig
copy your configuration to the sources folder.
cp .config ~/rpmbuild/SOURCES/config-`uname -m`
and you are ready to build
rpmbuild -bb --with baseonly --without debuginfo --target=`uname -m` ~/rpmbuild/SPECS/kernel.spec
kernel-firmware
if you need to build the firmware module then change this line to this in the
~/rpmbuild/SPECS/kernel.spec
%define with_firmware %{?_with_firmware: 0} %{?!_with_firmware: 1}
Creating Patches
if you’d like to create a working copy to apply any custom test or patches, this will allow you to create a patch for your build.
cp -r ~/rpmbuild/BUILD/kernel-2.6.26/linux-2.6.26.x86_64 ~/rpmbuild/BUILD/kernel-2.6.26.dist cp -al ~/rpmbuild/BUILD/kernel-2.6.26.dist ~/rpmbuild/BUILD/kernel-2.6.26.new diff -uNrp ~/rpmbuild/BUILD/kernel-2.6.26/vanilla/{file} ~/rpmbuild/BUILD/kernel-2.6.26.new/{file} > {file}.patch
Got anything to say? Go ahead and leave a comment!
Popular Posts
About Me

tweets
- getting my savings on... (@ Big Lots) [pic]: http://t.co/Z0W2S4uBtxt tweet and time1 week ago
- I'm at Texas State Capitol (112 E 11th St., at Congress Ave., Austin) w/ 5 others http://t.co/QytsTsFOtxt tweet and time1 week ago
- I'm at Curra's Grill (614 E Oltorf St, Austin) w/ 2 others http://t.co/v9H2a8zTtxt tweet and time1 week ago
- I'm at The Woodland (1716 S Congress Ave, at W Milton, Austin) http://t.co/Gquyomkxtxt tweet and time2 weeks ago
- I'm at Starbucks (2900 W Anderson Ln, Rockwood, Austin) http://t.co/R4ouLeE4txt tweet and time2 weeks ago




Posted under: