Skip to content

How kexecboot works

Yury Bushmelev edited this page Jan 24, 2021 · 1 revision

In general steps are:

  • Device's bootloader is loading and starting kexecboot kernel
  • Kernel is starting kexecboot binary as init process from initramfs
  • kexecboot enumerates /proc/partitions entries (except partitions smaller than 200Kb)
  • if devices-recreating feature is enabled then kexecboot removes device node from /dev and mknod it again
  • kexecboot checks every partitions for known (using fstype routine from klibc) and supported (using /proc/filesystems) filesystem. It will:
  • try to mount partitions and look for /boot/boot.cfg
  • if /boot/boot.cfg exists then read it and parse it else check for default kernels (/boot/[zu]Image, /[zu]Image)
  • sort items found by PRIORITY
  • show menu and wait for selection
  • run kexec binary to load and boot selected kernel

Notes

  • There is 'undocumented' support for a 'machine-kernel'. When enabled, kexecboot will look into the /proc/cpuinfo for a 'Hardware' line, lowercase it, replace non-alphanumeric characters with _, then prepend it with /boot/zImage- string. This path will be used to look for kernel as well when no boot.cfg is found. This 'feature' is obsoleted. If you are using this feature please let us know.
  • Currently fstype routine can recognize following FS'es and devices content: gzip, cramfs, romfs, xfs, ext4, squashfs, ext3, ext2, minix, jffs2, vfat, nilfs2, ocfs2, reiserfs, reiser4, gfs2, jfs, iso9660, luks, lvm2, swap, suspend.
  • uImage and zImage support is controlled by --enable-zimage and --enable-uimage configure options
  • kexec binary should reside in /usr/sbin/kexec
  • kexec will load kernel with the following cmdline options: root= rootfstype= rootwait mtdparts= fbcon=