Kernel (Topic 1.105)
Objective 1: Manage/Query Kernel and Kernel Modules at Runtime
The Linux kernel is modular, and device driver software is inserted into the running kernel as needed.
Module files are objects, stored under /lib/modules.
Kernel modules can be managed using:
- insmod
Insert a module into the kernel.
- lsmod
List modules.
- modinfo
Get information about a module.
- modprobe
Insert modules along with their prerequisites.
- rmmod
Remove a module from the kernel.
Modules are configured in /etc/conf.modules or /etc/modules.conf.
modprobe determines module dependencies using a filecalled modules.dep. This file is usually created at boot time usingdepmod.
Objective 2: Reconfigure, Build, and Install a Custom Kernel and Kernel Modules
To build a kernel, you need the compiler, assembler, linker, make, kernel source, and kernel headers.
These are typical kernel compilation steps, done in /usr/src/linux:
Make a configuration using make oldconfig (existing setup), make config (basic interactive text program), make menuconfig (interactive text menu program), or make xconfig (graphical program). Each method creates the .config file containing kernel options.
Modify
EXTRAVERSION
in Makefile, if desired.Build dependencies using make dep.
Clean old results with make clean.
Create the kernel with make bzImage.
Create modules with make modules.
Install the modules with make modules_install.
Copy the new image to /boot.
Update /etc/lilo.conf for the new image.
Update the boot loader by running the lilo command. ...
Get LPI Linux Certification in a Nutshell, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.