Bug 187582 - RELNOTES - kernel-devel required for modules in section 8.7
RELNOTES - kernel-devel required for modules in section 8.7
Product: Fedora Documentation
Classification: Fedora
Component: release-notes (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Release Notes Tracker
Karsten Wade
Depends On:
  Show dependency treegraph
Reported: 2006-04-01 02:25 EST by John Cooper
Modified: 2007-04-18 13:41 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-04-01 09:30:10 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description John Cooper 2006-04-01 02:25:08 EST
Fedora Core 5 Section 8.7 should state that you DO need to install the
kernel-devel package to create /usr/src/kernels using :-

su -c 'yum install kernel-devel'

(this should really be installed when the devel package is selected on install)

------ Current -----
8.7. Building Only Kernel Modules

An exploded source tree is not required to build a kernel module, such as your
own device driver, against the currently in-use kernel. For example, to build
the foo.ko module, create the following Makefile in the directory containing the
foo.c file:
Comment 1 Tommy Reynolds 2006-04-01 09:25:36 EST
There are actually at least 4 use cases to cover:

1) All I need is to compile a 3rd-party module:

The easiest way is to install the "kernel-devel" RPM and then point make(1) to
the infrastructure that provides:

# cd /path/to/new/module
# make -C /lib/module/$(uname -r)/build M=$PWD modules
# make -C /lib/module/$(uname -r)/build M=$PWD modules_install

is often sufficient.

2) I need to work with same kernel sources as the distro, perhaps to debug a crash:

Install the "kernel-devel" RPM.  In "/usr/src/kernels/$(uname -r)" find a
fully-configured kernel source tree with only those sources used for the FCn
kernel.  Sources for features not supported by the Fedora project, such as NTFS,
are not currently provided in this RPM.

This RPM is also useful to build a new Fedora kernel with some configuration
parameters altered.

To compile a 3rd-party driver using these files, use a make(1) command similar to:

# make -C /usr/src/kernels/$(uname -r) M=$PWD modules
# make -C /usr/src/kernels/$(uname -r) M=$PWD modules_install

3)I want to use a feature not supported by Fedora, or, I want to see full kernel
sources for the current distribution.

Install the "kernel-${version}-${release}.src.rpm" RPM.  Sources for the plain
kernel, the Xen kernels, and the vanilla kernel will be installed in

To build a 3rd-party driver, use a make(1) command similar to:

# make -C ${RPMROOT}/BUILD/kernel-${version}/linux-${version} M=$PWD modules
# make -C ${RPMROOT}/BUILD/kernel-${version}/linux-${version} M=$PWD modules_install

4) I have a textbook about kernel programming and I want to follow the examples.

Install the "kernel-${release}-${version}.src.rpm" RPM as explained above.  Then
move the desired sources into "/usr/src/linux-$(uname -r)" like this:

# cd ${RPMROOT}/BUILD/kernel-${version}
# mv linux-${version} /usr/src/linux-$(uname -r)
# cd /usr/src/
# ln -s ./linux-$(uname -r) linux

# cd /usr/src/linux
Comment 2 Tommy Reynolds 2006-04-01 09:28:33 EST
Don't shoot me.  I didn't package kernel sources in all these variations ;-)
Comment 3 Rahul Sundaram 2006-04-01 09:30:10 EST
Thank you for your feedback.

I have added more information and instructions to
http://fedoraproject.org/wiki/Docs/Beats/Kernel. These will be available as an
errata and on subsequent release notes published. 

Note You need to log in before you can comment on or make changes to this bug.