Bug 135269

Summary: FC3 Release notes do not reflect the kernel source rpm is no longer avalible.
Product: [Fedora] Fedora Reporter: John Mizell <john.mizell>
Component: fedora-releaseAssignee: Ed Bailey <ed>
Status: CLOSED NEXTRELEASE QA Contact: Brian Brock <bbrock>
Severity: high Docs Contact:
Priority: medium    
Version: 3CC: barryn, ed, moneta.mace, notting, stephan-menzel, wtogami
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-10-19 12:54:34 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 114398, 130887    

Description John Mizell 2004-10-11 11:22:04 EDT
Description of problem:
Release notes do not reflect the kernel source rpm is no longer
avalible or the new method to create a kernel source tree.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Look at the Release Notes
Actual results:

Expected results:
Include a section to document how to create a kernel source tree 

Additional info:
Comment 1 Bill Nottingham 2004-10-15 23:35:59 EDT
OK, here we go.

-- cut here --

In <RELEASE NAME HERE> the kernel-source package is no longer shipped.
If users would like to have an exploded source tree, follow the
following steps:

- Install kernel-<your-version-here>.src.rpm from (the SRPMS dir on
the CD | the FTP site where you got the kernel | running up2date
--get-source kernel)
- Run 'rpmbuild -bp kernel.spec'
- In the tree, the configurations for  the specific kernels shipped in
<RELEASE HERE> are in the configs/ directory. To build the i686 SMP
kernel, for example, do:
   - cp configs/kernel-<version>-i686-smp.config ./.config
   - make oldconfig
   - proceed as normal

Note that an exploded source tree is *NOT* required to build kernel
modules against the currently-in-use kernel.

To make a foo.ko module, do:

Create the Makefile in your directory with the foo.c file:

obj-m    := foo.o

KDIR    := /lib/modules/$(shell uname -r)/build
PWD    := $(shell pwd)

    $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules

Now do a


... and the foo.ko is built.

-- cut here ---

The 2.6 module example is shamelessly stolen from:

Comment 4 Bill Nottingham 2004-10-18 15:25:27 EDT
OK, you need to add "--target <arch>" on x86.

For a i586 kernel, do --target i586.
For a i686 kernel, do --target i686.

On non-x86 arches (including x86_64), it should Just Work.
Comment 5 Ed Bailey 2004-10-18 15:42:53 EDT
Bill -- how's this look:

In order to eliminate the redundancy inherent in providing a separate
package for the kernel source code when that source code already
exists in the kernel's .src.rpm file, Fedora Core 2.92 Test 3 no
longer includes the kernel-source package. Users that require access
to the kernel sources can find them in the kernel .src.rpm file. To
create an exploded source tree from this file, perform the following
steps (note that <version> refers to the version specification for
your currently-running kernel):

1. Obtain the kernel-<version>.src.rpm file from one of the following
  o The SRPMS directory on the appropriate "SRPMS" CD iso image
  o The FTP site where you got the kernel package
  o By running the following command:

    up2date --get-source kernel

2. Install kernel-<version>.src.rpm (given the default RPM
configuration, the files this package contains will be written to

3. Change directory to /usr/src/redhat/SPECS/, and issue the following

   rpmbuild -bp --target=i586 kernel.spec

On a default RPM configuration, the kernel tree will be located in

4. In resulting tree, the configurations for the specific kernels
shipped in Fedora Core 2.92 Test 3 are in the /configs/ directory. For
example, the i686 SMP configuration file is named
/configs/kernel-<version>-i686-smp.config. Issue the following command
to place the desired configuration file in the proper place for building:

    cp <desired-file> ./.config

5. Issue the following command:

    make oldconfig

You can then proceed as usual.

Note:  An exploded source tree is not required to build kernel modules
against the currently in-use kernel.

For example, to build the foo.ko module, create the following file
(named Makefile) in the directory containing the foo.c file:

obj-m    := foo.o

KDIR    := /lib/modules/$(shell uname -r)/build
PWD    := $(shell pwd)

    $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules

Issue the make command to build the foo.ko module.

Comment 6 Bill Nottingham 2004-10-18 15:49:35 EDT
a) the makefile snippet should go through whatever docbook magic is
needed to make it look like program code :0
b) the --target=i586 should probably include a note about 'replace
with your arch here'.

Looks great.
Comment 7 Ed Bailey 2004-10-19 12:54:34 EDT
Bill -- thanks for the feedback...

a) Done already -- you just can't see it from the cut'n'paste :-)

b) Good point -- fixed.
Comment 9 Stephan Menzel 2004-11-11 08:48:00 EST
*** Bug 138810 has been marked as a duplicate of this bug. ***