分类: LINUX
2005-05-10 19:59:36
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 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
Obtain the
kernel-
The SRPMS directory on the appropriate "SRPMS" CD iso image
The FTP site where you got the kernel package
By running the following command:
up2date --get-source kernel
Install
kernel-
Change directory to /usr/src/redhat/SPECS/, and issue the following command:
rpmbuild -bp
--target=
(Where
On a default RPM configuration, the kernel tree will be located in /usr/src/redhat/BUILD/.
In resulting tree, the configurations for the specific
kernels shipped in Fedora Core 3 are in the
/configs/ directory. For example, the
i686 SMP configuration file is named
/configs/kernel-
cp
Issue the following command:
make oldconfig
You can then proceed as usual.
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)
default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
Issue the make command to build the foo.ko module.