include("site.inc"); $template = new Page; $template->initCommon(); $template->displayHeader(); ?>
This section covers changes and important information regarding the 2.6.18 based kernel in Fedora Core 6. The 2.6.18 kernel includes:
Lightweight user space priority inheritance support (http://lwn.net/Articles/178253/)
A "lock validator" debugging tool (http://lwn.net/Articles/185666/)
A new power saving policy for multicore systems, SMPnice (http://lwn.net/Articles/186438/)
A much improved SATA layer (http://lwn.net/Articles/183734/)
Swapless page migration (http://lwn.net/Articles/160201/)
Per-zone VM counters
Per-task delay accounting
A new per-packet access control for SELinux called
secmark
(http://james-morris.livejournal.com/11010.html)
Randomized i386 vDSO
New drivers and additional device support for many existing drivers
Many bug fixes and other small improvements
Fedora Core may include additional patches to the kernel for improvements, bug fixes, or additional features. For this reason, the Fedora Core kernel may not be line-for-line equivalent to the so-called vanilla kernel from the kernel.org web site:
To obtain a list of these patches, download the source RPM package and run the following command against it:
rpm -qpl kernel-<version>
.src.rpm
To retrieve a log of changes to the package, run the following command:
rpm -q --changelog kernel-<version>
If you need a user friendly version of the changelog, refer to http://wiki.kernelnewbies.org/LinuxChanges. A short and full diff of the kernel is available from http://kernel.org/git. The Fedora version kernel is based on the Linus tree.
Customizations made for the Fedora version are available from http://cvs.fedora.redhat.com .
Fedora Core 6 includes the following kernel builds:
Native kernel, for use in most systems. Configured sources are
available in the
kernel-devel-
package.
<version>
.<arch>
.rpm
kernel-PAE, for use in 32-bit x86 systems with > 4GB of RAM, or with CPUs that have a 'NX (No eXecute)' feature. This kernel support both uniprocessor and multi-processor systems.
Virtualization kernel for use with the Xen emulator package.
Configured sources are available in the
kernel-xen-devel-
package.
<version>
.<arch>
.rpm
Kdump kernel for use with
kexec
/kdump
capabilities. Configured sources are available in the
kernel-kdump-devel-
package.
<version>
.<arch>
.rpm
You may install kernel headers for all kernel flavors at the same
time. The files are installed in the
/usr/src/kernels/
tree. Use the following command:
<version>
-[xen|kdump]-<arch>
/
su -c 'yum install kernel-{PAE,xen,kdump}-devel'
Select one or more of these flavors, separated by commas and no
spaces, as appropriate. Enter the root
password when prompted.
![]() | Default Kernel Provides SMP |
---|---|
There is no separate SMP kernel available for Fedora Core 6 on i386, x86_64 and ppc64. Multiprocessor support is provided by the native kernel. |
![]() | PowerPC Kernel Support |
---|---|
There is no support for Xen or kdump for the PowerPC architecture in Fedora Core 6 test3. 32-bit PowerPC does still have a separate SMP kernel. |
Refer to http://kernel.org/pub/linux/docs/lkml/reporting-bugs.html for information on reporting bugs in the Linux kernel. You may also use http://bugzilla.redhat.com for reporting bugs that are specific to Fedora.
Many of the tutorials, examples, and textbooks about Linux kernel
development assume the kernel sources are installed under the
/usr/src/linux/
directory.
If you make a symbolic link, as shown below, you should be able to
use those learning materials with the Fedora Core packages.
Install the appropriate kernel sources, as shown earlier, and then
run the following command:
su -c 'ln -s /usr/src/kernels/<version>
.<release>
-<arch>
/usr/src/linux'
Enter the root
password
when prompted.
Fedora Core 6 does not include the
kernel-source
package provided by older
versions since only the kernel-devel
package
is required now to build external modules. Configured sources are
available, as described in this kernel flavors section.
![]() | Instructions Refer to Current Kernel |
---|---|
To simplify the following directions, we have assumed that you
want to configure the kernel sources to match your
currently-running kernel. In the steps below, the expression
|
Users who require access to Fedora Core original kernel sources
can find them in the kernel .src.rpm
package. To create an
exploded source tree from this file, perform the following steps:
![]() | Do Not Build Packages as Super-user (root) |
---|---|
Building packages as the superuser is inherently dangerous and
is not required, even for the kernel. These instructions allow
you to install the kernel source as a normal user. Many general
information sites refer to |
Prepare a RPM package building environment in your home directory. Run the following commands:
su -c 'yum install rpmdevtools yum-utils' rpmdev-setuptree
Enter the root
password when prompted.
Download the
kernel-
file. Enable any appropriate source repositories, such as
Core, Updates, or Testing, with the <version>
.src.rpm-e
switch:
yumdownloader -e core-source -e updates-source --source kernel
Enter the root
password when prompted.
Install
kernel-
using the command:
<version>
.src.rpm
rpm -Uvh kernel-<version>
.src.rpm
This command writes the RPM contents into ${HOME}/rpmbuild/SOURCES
and
${HOME}/rpmbuild/SPECS
,
where ${HOME}
is your home directory.
![]() | Space Required |
---|---|
The full kernel building process may require several gigabytes of extra space on the file system containing your home directory. |
Prepare the kernel sources using the commands:
cd ~/rpmbuild/SPECS rpmbuild -bp --target $(uname -m) kernel-2.6.spec
The kernel source tree is located in the ~/rpmbuild/BUILD/kernel-
directory.
<version>
/linux-<version>
.<arch>
The configurations for the specific kernels shipped in Fedora
Core 6 are in the ~/rpmbuild/BUILD/kernel-
directory. For example, the i686 configuration file is named
<version>
/linux-<version>
.<arch>
/configs~/rpmbuild/BUILD/kernel-
.
Issue the following command to place the desired configuration
file in the proper place for building:
<version>
/linux-<version>
.<arch>
/configs/kernel-<version>
-i686.config
cp configs/<desired-config-file>
.config
Every kernel gets a name based on its version number. This is
the value the uname -r
command displays.
The kernel name is defined by the first four lines of the
kernel Makefile
. The
Makefile
has been changed to generate a
kernel with a different name from that of
the running kernel. To be accepted by the running kernel, a
module must be compiled for a kernel with the correct name. To
do this, you must edit the kernel
Makefile
.
For example, if the uname -r
returns the string
2.6.17-1.2345_FC6
, change the
EXTRAVERSION
definition from this:
EXTRAVERSION = -prep
to this:
EXTRAVERSION = -1.2345_FC6
That is, substitute everything from the final dash onward.
Run the following command:
make oldconfig
You may then proceed as usual.
![]() | Building Kernel Binary RPMs |
---|---|
Normally, kernels for Fedora are built using the
|
An exploded source tree is not required to build a kernel module,
such as your own device driver, against the currently in-use
kernel. Only the kernel-devel
package is
required to build external modules. If you did not select it
during installation, use Pirut to
install it, going to Applications → Add/Remove Software or
use yum
to install it. Run the following
command to install the kernel-devel
package
using yum
.
su -c 'yum install kernel-devel'
For example, to build the foo.ko
module, create the
following Makefile
in the directory containing the
foo.c
file:
obj-m := foo.o KDIR := /lib/modules/$(shell uname -r)/build PWD := $(shell pwd) default: $(MAKE) -C $(KDIR) M=$(PWD) modules
Issue the make
command to build the
foo.ko
module.