Candidates should be able to customise a kernel for specific system requirements, by patching, compiling and editing configuration files as required. This objective includes being able to assess requirements for a kernel compile as well as build and configure kernel modules.
Key files, terms, and utilities include:
| patch |
| make |
/usr/src/linux |
/proc/sys/kernel/ |
/etc/conf.modules, /etc/modules.conf |
| insmod, lsmod, modprobe |
| kmod |
| kerneld |
Most of the key files, terms and utilities mentioned above have been explained earlier in this chapter, the ones that haven't been mentioned will be mentioned in the paragraphs that follow.
/proc/sys/kernel/ is a directory in the
/proc pseudo filesystem which contains the following
entries:
$ ls -l /proc/sys/kernel/
-rw------- 1 root root 0 Oct 22 14:11 cad_pid
-rw------- 1 root root 0 Oct 22 14:11 cap-bound
-rw-r--r-- 1 root root 0 Oct 22 14:11 core_uses_pid
-rw-r--r-- 1 root root 0 Oct 22 14:11 ctrl-alt-del
-rw-r--r-- 1 root root 0 Oct 22 14:11 domainname
-rw-r--r-- 1 root root 0 Oct 22 14:11 hostname
-rw-r--r-- 1 root root 0 Oct 22 14:11 hotplug
-rw-r--r-- 1 root root 0 Oct 22 14:11 modprobe
-rw-r--r-- 1 root root 0 Oct 22 14:11 msgmax
-rw-r--r-- 1 root root 0 Oct 22 14:11 msgmnb
-rw-r--r-- 1 root root 0 Oct 22 14:11 msgmni
-r--r--r-- 1 root root 0 Oct 22 14:11 osrelease
-r--r--r-- 1 root root 0 Oct 22 14:11 ostype
-rw-r--r-- 1 root root 0 Oct 22 14:11 overflowgid
-rw-r--r-- 1 root root 0 Oct 22 14:11 overflowuid
-rw-r--r-- 1 root root 0 Oct 22 14:11 panic
-rw-r--r-- 1 root root 0 Oct 22 14:11 printk
dr-xr-xr-x 2 root root 0 Oct 22 14:11 random
-rw-r--r-- 1 root root 0 Oct 22 14:11 rtsig-max
-r--r--r-- 1 root root 0 Oct 22 14:11 rtsig-nr
-rw-r--r-- 1 root root 0 Oct 22 14:11 sem
-rw-r--r-- 1 root root 0 Oct 22 14:11 shmall
-rw-r--r-- 1 root root 0 Oct 22 14:11 shmmax
-rw-r--r-- 1 root root 0 Oct 22 14:11 shmmni
-rw-r--r-- 1 root root 0 Oct 22 14:11 tainted
-rw-r--r-- 1 root root 0 Oct 22 14:11 threads-max
-r--r--r-- 1 root root 0 Oct 22 14:11 version
Some files can be used to get information, for instance to show the version of the running kernel:
cat /proc/sys/kernel/osrelease
Some files can also be used to set information in the kernel. For instance, the following will tell the kernel not to loop on a panic, but to auto-reboot after 20 seconds:
echo 20 > /proc/sys/kernel/panic
Both kmod and kerneld make dynamic loading of kernel-modules possible. A module is loaded when the kernel needs it. (Modules are explained earlier is this chapter).
kerneld is a daemon, kmod is a thread in the kernel itself.
The communication with kerneld is done through System V IPC. kmod operates directly from the kernel and does not use System V IPC thereby making it an optional module.
kmod replaces kerneld as of Linux kernel 2.2.x.
Both facilitate dynamic loading of kernel modules.
Both use modprobe to manage dependencies and dynamic loading of modules.
Manual loading of modules with modprobe or insmod is possible without the need for kmod or kerneld.
In both cases, the kernel-option CONFIG_MODULES must
be set to enable the usage of modules.