Kexec as loadable kernel module for Linux ARM64 kernels based on kexec-module.
This loadable kernel module enables users of Linux kernels without built-in Kexec support to still make use of Kexec functionality. For instance, you may use this module to boot to a more recent kernel if you are unable to replace the boot image.
The project is comprised of two parts:
kernel/
contains the Linux kernel module that exposes Kexec functionality via/dev/kexec
.user/
contains a helper library that allows the use of an unpatchedkexec-tools
.
Make sure you have installed the necessary packages for building Linux kernel
modules on your system (e.g., make
and gcc
).
Enter the kernel
directory and export the path to the Linux kernel sources
against you wish to build:
cd kernel/
Then, build the module using make
:
make KDIR=/path/to/linux
This will build kexec_mod.ko
and kexec_mod_$ARCH.ko
which can be loaded
into the Linux kernel.
Enter the user
directory and build the helper as follows:
make
This will build redir.so
that acts as an LD_PRELOAD
interposer for Kexec
syscalls, allowing the use of unpatched kexec-tools
.
Make sure you have built the module and user-space helper. Also check whether you
have installed kexec-tools
. Then, you can use kexec-tools
as follows:
LD_PRELOAD=/root/redir.so kexec -l /boot/vmlinuz --reuse-cmdline
LD_PRELOAD=/root/redir.so kexec -e
The code is released under the GPLv2 license. See COPYING.txt.