201 Linux Kernel

From My Mnemonic Rhyme
Jump to navigation Jump to search

201.1 Kernel Components

Weight 2

Candidates should be able to utilise kernel components that are necessary to specific hardware, hardware drivers, system resources and requirements. This objective includes implementing different types of kernel images, identifying stable and development kernels and patches, as well as using kernel modules.

Der Kernel liegt normalerweise unter /boot/vmlinuz

Unter Ubuntu 12.04:

root:/boot# file vmlinuz-3.2.0-25-generic
vmlinuz-3.2.0-25-generic: Linux kernel x86 boot executable bzImage, version 3.2.0-25-generic (buildd@crested) 
#40-Ubuntu SMP Wed May 23 20:, RO-rootFS, swap_dev 0x4, Normal VGA

bzImage / zImage

  • Beide sind mit gzip gepackt (nicht bzip2)
  • bzImage = Big Zip Image
  • Werden unterschiedlich geladen / bzImage kann größer sein

Kernelversionen

  • Gerade Versionsnummer = stable 2.4,2.6,3.0,3.2
  • Ungerade Versionsnummer = testing 2.5,2.7,...

uname

  • uname = uname -s


  • -a / --all - alle Parameter
  • -n / --nodename - Hostname
  • -r / --kernel-release - Versionsnummer (z.B. 3.2.0-25-generic)
  • -v / --kernel-version - Erstellungsdatum (z.B. #40-Ubuntu SMP Wed May 23 20:30:51 UTC 2012)
  • -m / --machine - Hardwareplattform (z.B. x86_64)
  • -p / processor - Prozessorname (z.B. x86_64)
  • -i / --hardware-platform - Prozessorfamilie
  • -o / --operating-system - Betriebssystem (z.B. GNU/Linux)

Kernel 2.6.x documentation

Kernel 3.x documentation

/usr/src/linux

/usr/src/linux/Documentation

201.2 Compiling a kernel

Weight 2

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.

/usr/src/linux/

GRUB configuration files

Kernel 2.6.x make options

mkinitrd

mkinitramfs

make

echo "" | make oldconfig

make options

(config, xconfig, menuconfig, oldconfig, cloneconfig, prepare-all, mrproper zImage, bzImage, modules, modules_install)

201.3 Patching a kernel

Weight 1

Candidates should be able to properly patch a kernel to add support for new hardware. This objective also includes being able to properly remove kernel patches from already patched kernels.

Kernel Makefiles

patch

gzip

bzip2

201.4 Customise, build and install a custom kernel and kernel modules

Weight 2

Candidates should be able to customise, build and install a 2.6 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.

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

/usr/src/linux/

Module configuration files

patch

make

module tools

/usr/src/linux/*

/usr/src/linux/.config

/lib/modules/kernel-version/*

/boot/*

make targets

all, config, menuconfig, xconfig, gconfig oldconfig, modules, install, modules_install, depmod, rpm-pkg, binrpm-pkg, deb-pkg

201.5 Manage/Query kernel and kernel modules at runtime

Weight 3

Candidates should be able to manage and/or query a 2.6.x kernel and its loadable modules.

Key Knowledge Areas

   * Use command-line utilities to get information about the currently running kernel and kernel modules.
   * Manually load and unload kernel modules.
   * Determine when modules can be unloaded.
   * Determine what parameters a module accepts.
   * Configure the system to load modules by names other than their file name. 

/lib/modules/kernel-version/modules.dep

module configuration files in /etc

/proc/sys/kernel/

depmod

insmod

lsmod

rmmod

modinfo

modprobe

uname