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).
If you don’t see the directories mentioned in the preceding section, then you haven’t installed your Linux kernel’s source code. There are two ways to install the source code for your RHEL 3 system. You could access the Red Hat RPMs from CD or a network source and install the kernel RPM. Alternatively, you could install the packages through the redhat-config-packages utility. The following example is based on an installation from the appropriate Red Hat Installation CD:
# mount /mnt/cdrom # rpm -Uvh /mnt/cdrom/RedHat/RPMS/kernel-source-*
Depending on the packages you’ve specified when you installed RHEL 3, this may be all you need. However, this command may bring up some error messages similar to the following:
error: Failed dependencies: gcc >= 2.96-98 is needed by kernel-source-2.4.21-4.EL
which suggests that you need to install some other RPM packages, as described in the next section.
Required RPMs
In order to build a kernel from the source code, you need to ensure you have all the RPMs necessary, not only for the kernel, but also for the tools needed to build the kernel. You can check your system to ensure you have the RPM packages described in Table 5-3. Many of these packages have a number of other dependencies.
If not, mount the appropriate Red Hat installation CDs or network installation source and install the needed packages with the rpm -Uvh packagename command. If the revision associated with your package and architecture are different, revise the package names accordingly.
The packages shown in Table 5-3 end with an * because version numbers do change frequently. In any case, the objective is to install these packages. For example, in order to install the tk package from a mounted CD, all you need is the rpm -Uvh /mnt/cdrom/RedHat/RPMS/tk-* command.
However, you’ll also need to install any related dependent packages. For example, the kernel-source-* RPM requires the appropriate GNU C Compiler, which is the gcc-* RPM.
Table 5-3Kernel Source RPMs
Package
Description
kernel-source-*
Kernel source files
glibc-kernheaders-*
Kernel header files
glibc-devel-*
Required for C libraries
cpp-*
C language preprocessor
ncurses-*
Required for menuconfig screen
ncurses-devel-*
Development libraries for ncurses
binutils-*
Required binary utilities
gcc-*
C language compiler
tcl-*
TCL scripting language—required for xconfig screen
tk-*
TK X Window widgets—required for xconfig screen
Wildcards such as an * are often also known as globbing.
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.