A dynamic library bundling the guest payload consumed by libkrun
Go to file
Sergio Lopez 4a7e7781ef qboot: Update to fix issue when mem > 3328 MiB
Update binary to a version that fixes the issue when mem > 3328
MiB (wrapping around the MMIO hole), matching "bc48d49" from
https://github.com/slp/qboot-krunfw

Signed-off-by: Sergio Lopez <slp@redhat.com>
2021-09-24 17:56:00 +02:00
initrd SEV: bundle qboot and initrd into the library 2021-09-09 17:45:08 +02:00
patches patches/0006: Allow booting SEV-ES APs without GHCB (HACK) 2021-09-24 17:54:02 +02:00
qboot qboot: Update to fix issue when mem > 3328 MiB 2021-09-24 17:56:00 +02:00
.gitignore initial commit 2020-08-13 18:47:26 +02:00
Image_to_bundle.py Add support for AArch64 2021-01-27 09:38:27 +01:00
LICENSE-GPL-2.0-only initial commit 2020-08-13 18:47:26 +02:00
LICENSE-LGPL-2.1-only initial commit 2020-08-13 18:47:26 +02:00
Makefile SEV: bundle qboot and initrd into the library 2021-09-09 17:45:08 +02:00
README.md README.md: Add instructions for building under macOS 2021-02-04 11:13:59 +01:00
build_on_krunvm.sh Add a script for building in krunvm 2021-01-27 09:40:34 +01:00
config-libkrunfw_aarch64 Enable security keys in the kernel 2021-01-27 12:18:45 +01:00
config-libkrunfw_x86_64 SEV: update x86_64 config to support SEV guest 2021-09-09 17:35:56 +02:00
initrd_to_bundle.py SEV: bundle qboot and initrd into the library 2021-09-09 17:45:08 +02:00
qboot_to_bundle.py SEV: bundle qboot and initrd into the library 2021-09-09 17:45:08 +02:00
vmlinux_to_bundle.py v2b: Rename symbols and add versioning 2020-09-04 14:43:56 +02:00

README.md

libkrunfw

libkrunfw is a library bundling a Linux kernel in a dynamic library in a way that can be easily consumed by libkrun.

By having the kernel bundled in a dynamic library, libkrun can leave to the linker the work of mapping the sections into the process, and then directly inject those mappings into the guest without any kind of additional work nor processing.

Building

Linux

Requirements

  • The toolchain your distribution needs to build a Linux kernel.
  • Python 3
  • pyelftools (package python3-pyelftools in Fedora and Ubuntu)

Building and installing the library

make
sudo make install

macOS

Requirements

Compiling a Linux kernel natively on macOS is not an easy feat. For this reason, the recommended way for building libkrunfw in this platform is by already having installed a binary version of krunvm and its dependencies (libkrun, and libkrunfw itself), such as the one available in the krunvm Homebrew repo, and then executing the build_on_krunvm.sh script found in this repository.

This will create a lightweight Linux VM using krunvm with the current working directory mapped inside it, and build the kernel on it.

Building the library using krunvm

./build_on_krunvm.sh
make

License

This library bundles a Linux kernel but does not execute any code from it, acting as a mere storage format. As a consequence, this library does not constitute a derivative work of the Linux kernel. Thus, the following licenses apply:

  • Linux kernel: GPL-2.0-only

  • Files contained in the patches directory: GPL-2.0-only

  • Library code, including automatically-generated code: LGPL-2.1-only

Therefore, distributions of this library in binary form are required to be accompanied by the source code of the Linux kernel bundled in the binary along with the code of the library itself, but other programs linking against this library are not required to be licensed under the GPL-2.0-only nor the LGPL-2.1-only licenses.