icosa.gif

[] Home
henry12t.jpg Introduction
[] The Labyrinth
[] Social Media
[] Terms
[] Contact

get in shape
Hits: 81649

random hull

audio
bio
decal4linux
diet
dictionary

electronic
find-target
fixboot
halloween
home
hosting
installation
isoedit
kernel
links
nVidia
oldies
pollution
playcd
playdvd
quines
rpmsign
scite
shortcuts
social media
software
terms
the labyrinth
wine
zotero

TheNerdShow.com

Roll your own Fedora Kernel RPM

1. Ensure you have development tools

su
yum -y groupinstall "Development Tools"'
yum -y install rpmdevtools libXi-devel qt-devel
exit

 2. Create build environment for your unpriviliged user (not root), if you haven't already:

fedora-buildrpmtree
Get the required kernel source from http://mirrors.kernel.org/fedora/core/
rpm -ihv kernel-version.src.rpm
3. Edit the spec file ~/rpmbuild/SPECS/kernel-2.6.spec and change the 1 to a 0 on the packages you don't want to build:
# standard kernel
%define with_up      %{?_without_up:      0} %{?!_without_up:      1}
# kernel-smp (only valid for ppc 32-bit, sparc64)
%define with_smp     %{?_without_smp:     0} %{?!_without_smp:     1}
# kernel-PAE (only valid for i686)
%define with_pae     %{?_without_pae:     0} %{?!_without_pae:     0}
# kernel-xen
%define with_xen     %{?_without_xen:     0} %{?!_without_xen:     0}
# kernel-kdump
%define with_kdump   %{?_without_kdump:   0} %{?!_without_kdump:   0}
# kernel-debug
%define with_debug   %{?_without_debug:   0} %{!?_without_debug:   0}
# kernel-doc
%define with_doc     %{?_without_doc:     0} %{?!_without_doc:     1}
# kernel-headers
%define with_headers %{?_without_headers: 0} %{?!_without_headers: 1}

%define _enable_debug_packages 0

Notice I also added %define _enable_debug_packages 0

4. Build prep, extract the sources:
rpmbuild -bp --target=i686 ~/rpmbuild/SPECS/kernel-2.6.spec
5. Clean the source tree
cd ~/rpmbuild/BUILD/kernel-version/linux-version
make mrproper
6. Copy a config from a default one in ~/rpmbuild/SOURCES (or ~/rpmbuild/BUILD/kernel-version/linux-version/configs), and configure it for the compilation
cp ~/rpmbuild/SOURCES/kernel-version-i686.config .config
make oldconfig
Apply any custom settings (for 8K stacks, scroll down to the bottom of the 'Kernel hacking' section
make xconfig
7. This config and source tree will be wiped out at build time so we need to copy it back:
cp .config ~/rpmbuild/SOURCES/kernel-version-i686.config
and then edit ~/rpmbuild/SOURCES/kernel-version-i686.config and add '# i386' to the top so the first 3 lines are
# i386
#
# Automatically generated make config: don't edit
8. Now build the kernel
rpmbuild -bb --target=i686 ~/rpmbuild/SPECS/kernel-2.6.spec
9. Install the kernel
sudo rpm -ihv ~/rpmbuild/RPMS/i686/kernel*.rpm

Do not to use -Uvh! You can use the '--force' option though.

no need to do a mkinitrd

The ~/rpmbuild directory will now contain about 1 gig of build files so you can clear it if you aren't building other rpms and stuff.

rpmdev-wipetree
This page edited conveniently in Firefox or Ineternet Explorer thanks to my Anchorage Net Community Hosting project.