- Notifications
You must be signed in to change notification settings - Fork44
A dynamic library bundling the guest payload consumed by libkrun
License
containers/libkrunfw
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
libkrunfw is a library bundling a Linux kernel in a dynamic library in a way that can be easily consumed bylibkrun.
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.
- The toolchain your distribution needs to build a Linux kernel.
- Python 3
pyelftools(packagepython3-pyelftoolsin Fedora and Ubuntu)
makesudo make install- The toolchain your distribution needs to build a Linux kernel.
- Python 3
pyelftools(packagepython3-pyelftoolsin Fedora and Ubuntu)
make SEV=1sudo make SEV=1 installCompiling a Linux kernel natively on macOS is not an easy feat. For this reason, the recommended way for buildinglibkrunfw in this platform is by already having installed a binary version ofkrunvm and its dependencies (libkrun, andlibkrunfw itself), such as the one available in thekrunvm Homebrew repo, and then executing thebuild_on_krunvm.sh script found in this repository.
This will create a lightweight Linux VM usingkrunvm with the current working directory mapped inside it, and build the kernel on it.
./build_on_krunvm.shmakeBy default, the build environment is based on a Fedora image. There is also a Debian variant which can be selected by setting theBUILDER environment variable.
BUILDER=debian ./build_on_krunvm.shIn general,./build_on_krunvm.sh will always delegate to./build_on_krunvm_${BUILDER}.sh so additional environments can be added like this if needed.
- To save memory, the embedded kernel is configured with
CONFIG_NR_CPUS=8, which limits the maximum number of supported CPUs to 8. If this kernel runs in a VM with more CPUs, only the first 8 will be initialized and used.
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
patchesdirectory: GPL-2.0-onlyLibrary 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.
About
A dynamic library bundling the guest payload consumed by libkrun
Resources
License
Uh oh!
There was an error while loading.Please reload this page.