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
Recent Posts
Categories
- Cross Country (32)
- iPhone (2)
- Life (17)
- Technology (6)
- Travel (2)
Tags
About Me
Archives
- September 2022 (1)
- August 2021 (1)
- March 2021 (1)
- June 2014 (1)
- April 2014 (1)
- December 2013 (1)
- June 2013 (1)
- April 2013 (1)
- August 2012 (1)
- July 2012 (2)
- May 2012 (2)
- April 2012 (1)
- November 2011 (3)
- October 2011 (1)
- July 2011 (1)
- December 2010 (1)
- June 2010 (1)
- November 2009 (7)
- October 2009 (18)
- September 2009 (8)
- July 2009 (1)
- March 2009 (1)
- February 2009 (1)