The Kernel Source Tree and Documentation - Administration
Today, continue on your path to RHCE certification. Learn about creating a new kernel the easy way, kernel sources, recompiling a kernel, and the cron and at systems. Take notes, because there's a test at the end. This comes from chapter five of Red Hat Certified Engineer Linux Study Guide (Exam RH302), fourth edition, by Michael Jang. (McGraw-Hill/Osborne, 2004, ISBN: 0-07-225365-7).
Once installed, you can easily access the kernel source code through the /usr/src/linux-2.4 directory. Installation procedures are addressed in the following sections. Once the source code is installed, the /usr/src directory should look similar to the following:
# ls -l /usr/src/ total 12 drwxr-xr-x 2 root root 4096 Jan 24 2003 debug lrwxrwxrwx 1 root root 17 Oct 23 16:12 linux-2.4 -> linux-2.4.21-4.EL drwxr-xr-x 16 root root 4096 Nov 7 15:56 linux-2.4.21-4.EL drwxr-xr-x 8 root root 4096 Nov 9 12:13 redhat
In this case, the physical directory is /usr/src/linux-2.4.21-4.EL, and there is a soft link called linux-2.4 that points to this directory.
Periodically, you may wish to upgrade your kernel. If you use Red Hat sources, the new RPM packages should automatically update the symbolic link from /usr/src /linux-2.4 to the real directory with the new kernelís source code (for example, symlink it to linux-2.4.21-4.1.EL). If necessary, you could perform the same action with the following command:
# ln -s linux-2.4.21-4.1.EL linux-2.4
The /usr/src/linux-2.4 directory on my RHEL 3 computer includes the following files and directories: arch, Documentation, configs, drivers, COPYING, fs, COPYING.modules, include, CREDITS, init, crypto, ipc, kernel, README, lib, REPORTING-BUGS, MAINTAINERS, Rules.make, MAKEFILE, scripts, mm, tmp_include_depends net.
Begin your study of the current kernel with the README file. While the instructions in this chapter work with the current configuration of RHEL 3 on my computer, details can change from kernel to kernel. Also, examine the Documentation directory. It contains everything you need, from information on setting up symmetrical multiprocessors to serial consoles.
The other directories mainly contain source code, and you probably wonít need to spend time examining those files (unless you reallywant to see how TCP/IP works). There is also a hidden file, .config, that may be present in this directory. Iíll describe this file in more detail later in this chapter.
This is part one from the fifth chapter of Red Hat Certified Engineer Linux Study Guide (Exam RH302), fourth edition, by Michael Jang. (McGraw-Hill/Osborne, 2004, ISBN: 0-07-225365-7). Check it out at your favorite bookstore today. Buy this book now.