Skip to content

canonical/stubble

Repository files navigation

Stubble

A minimal UEFI kernel boot stub that serves a single purpose:

Loading machine specific device trees embedded within a kernel image.

stubble is compatible with systemd-stub(7) and ukify(1). It is designed to seamlessly integrate with Ubuntu's current bootloader and boot security model. The resulting kernel image can be signed and verified and loaded by grub like any other kernel.

Before loading the kernel, the stub generates hwids of the running machine derived from smbios and compares them to an embedded lookup table in the .hwids section of the kernel image. If a match is found it loads the corresponding device tree from the .dtbauto section before jumping tothe bundled kernel.

Dependencies

# apt install python3-pyelftools systemd-ukify

Building

Build the stub:

$ make

For a simple combined kernel+stubble image bundling a single DTB you can run:

$ ukify build --linux=/boot/vmlinuz --stub=stubble.efi --hwids=hwids/json --dtbauto=/boot/dtb --output=vmlinuz.efi

HWIDs

The .txt files in hwids/txt have been generated with fwupdtool hwids. The can be converted to .json files by running hwid2json.py from the hwids directory. The compatible field of the resulting JSON files has to be filled in manually.

Acknowledgements

This project is originally based on systemd-stub from the systemd project. The .dtbauto feature in systemd was contributed by anonymix007. It is inspired by the dtbloader project by Nikita Travkin and DtbLoader.efi from the aarch64-laptops project.

About

A DTB loading kernel stub

Resources

License

Stars

Watchers

Forks

Contributors 63