Linux Kernel
Linux Kernel questions in LPIC-2 201-450 cover building and installing a kernel, generating initramfs, and controlling loadable modules and parameters at boot and runtime.
Build and install
- Source is commonly under
/usr/src/linux-<version>;.configholds choices made withmake menuconfigormake xconfig. make -j$(nproc)compiles;make modules_installputs modules under/lib/modules/$(make kernelrelease).make installcopiesvmlinuz,System.mapandconfig-*to/boot; the boot loader entry still must be regenerated.- Initramfs needs storage, LVM or RAID modules to mount root. Rebuild with
dracut -forupdate-initramfs -u. lsmod,modinfo,insmod,modprobe,depmodandrmmodare core module tools.modproberesolves dependencies viamodules.dep;insmoddoes not./etc/modprobe.d/*.confsupportsoptions,blacklist,aliasandinstall.sysctlsettings persist under/etc/sysctl.d/.
Worked example
You need e1000e loaded with InterruptThrottleRate=3000 at boot. Create /etc/modprobe.d/e1000e.conf containing options e1000e InterruptThrottleRate=3000. Run modprobe -r e1000e then modprobe e1000e to test. Because the NIC may be needed to mount root, rebuild initramfs so the option is present early. Verify in /sys/module/e1000e/parameters/. Reasoning: modprobe reads modprobe.d, but initramfs carries its own module configuration.
Traps
- Using
insmodand expecting dependency or option handling. - Forgetting
depmodafter copying a module manually. - Assuming
blacklistblocks an explicitmodprobe. - Editing boot loader files without regenerating the boot entry.