Skip to main content
LPIC-2 Exam 201

LPIC-2 201.2 Compiling a Linux kernel

Weight 3
Description Candidates should be able to properly configure a kernel to include or disable specific features of the Linux kernel as necessary. This objective includes compiling and recompiling the Linux kernel as needed, updating and noting changes in a new kernel, creating an initrd image and installing new kernels.

Key Knowledge Areas:

  • /usr/src/linux/
  • Kernel Makefiles
  • Kernel 2.6.x/3.x make targets
  • Customize the current kernel configuration.
  • Build a new kernel and appropriate kernel modules.
  • Install a new kernel and any modules.
  • Ensure that the boot manager can locate the new kernel and associated files.
  • Module configuration files
  • Awareness of dracut

The following is a partial list of the used files, terms and utilities:

  • mkinitrd
  • mkinitramfs
  • make
  • make targets (all, config, xconfig, menuconfig, gconfig, oldconfig, mrproper, zImage, bzImage, modules, modules_install, rpm-pkg, binrpm-pkg, deb-pkg)
  • gzip
  • bzip2
  • module tools
  • /usr/src/linux/.config
  • /lib/modules/kernel-version/*
  • depmod

In this tutorial we work with SUSE Enterprise Linux 11 SP3 using the kernel 3.0 and download the current latest stable release from kernel.org; being 3.13. We then run though the process are compiling the new kernel

  1. wget “https://kernel.org/pub/linux…..”
  2. tar -Jxvf linux-3.13…tar.xz -C /usr/src/
  3. cd /usr/src/linux-3.13.5/
  4. make clean
  5. make mrproper
  6. make oldconfig
  7. make menuconfig
  8. make bzImage
  9. make modules
  10. make modules_install
  11. make install
  12. reboot