Академический Документы
Профессиональный Документы
Культура Документы
ISSUE
Even though Red Hat does not provide any support for the customized kernel, as a user, you want to rebuild a kernel (e.g. to test a change or
ENVIRONMENT
RESOLUTION
To build a custom kernel, you need to download the source rpm first. The kernel-version.src.rpmcan be downloaded from the Red Hat Customer Portal.
The steps to rebuild the kernel are described below.
1) Install source rpm and apply the Red Hat patches to the original kernel source
# rpm -ivh kernel-2.6.x-x.src.rpm
# cd /usr/src/redhat/SPECS
# rpmbuild -bp --target=*i686* kernel.spec
These commands will set up the kernel source in the /usr/src/redhat/BUILD/ directory.
2) Move to the directory to rebuild kernel:
# cd /usr/src/redhat/BUILD/kernel-*2.6.x*/linux-*2.6.x*
5) In Red Hat Enterprise Linux 4, the kernel Makefile doesn't have this
INSTALL_MOD_STRIP option, so those commands cannot be used. The spec file in Red Hat Enterprise Linux 4 uses different approach. The following is a
snippet from the kernel-2.6.spec file:
# set the EXTRAVERSION to <version>custom, so that people who follow a kernel building howto
# don't accidentally overwrite their currently working moduleset and hose
# their system
perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{release}custom/" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/Makefile
# some config options may be appropriate for an rpm kernel build but are less so for custom user builds,
# change those to values that are more appropriate as default for people who build their own kernel.
perl -p -i -e "s/^CONFIG_DEBUG_INFO.*/# CONFIG_DEBUG_INFO is not set/" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/configs/*
perl -p -i -e "s/^.*CONFIG_DEBUG_PAGEALLOC.*/# CONFIG_DEBUG_PAGEALLOC is not set/" $RPM_BUILD_ROOT/usr/src/linux -%{KVERREL}/c
onfigs/*
perl -p -i -e "s/^.*CONFIG_DEBUG_SLAB.*/# CONFIG_DEBUG_SLAB is not set/" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/configs/*
perl -p -i -e "s/^.*CONFIG_DEBUG_SPINLOCK.*/# CONFIG_DEBUG_SPINLOCK is not set/" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/con
figs/*
In RHEL4, it doesn't use strip command. Instead it use compile options to remove debug information at the time of kernel compile. So, run the previous
commands before kernel compilation.
If these steps feel tedious, reuse the original rpm spec file.
For detailed information for this steps at the following link:http://fedoraproject.org/wiki/Building_a_custom_kernel.
Comments
Refer to https://access.redhat.com/support/offerings/production/soc.html for details on the Red Hat Global Support Services Production Support Scope of
Coverage and note that rebuilt RPMs are considered modified RPMs.
If you wish to see Red Hat make particular changes to the kernel, please open a support case with Red Hat Global Support Services and request that
these changes be considered for a feature request.