ading2210/shimboot

Add custom OS booting.

Closed this issue · 7 comments

A good idea would be custom OS booting. For example, at the bootloader, there would be an option to boot from a disk image/iso that is stored in the thumb drive. In the build process, it could prompt you to add a disk image to boot from later.

PS: I think you can upgrade the kernel to 5.10.* from here: https://source.android.com/docs/core/architecture/kernel/releases

not how shimboot works.

well maybe :)

no, not maybe, the shim doesn't allow booting from custom kernels or upgrading the kernel since its signed.

ok, but how about the kernel update though?

The kernels provided seem to be signed?

This isn't really possible because the shim kernel has limitations that need to be worked around. The largest problem is that systemd, the init system in the vast majority of distros, doesn't work out of the box. It has to be recompiled with a specific patch for it to even boot. So it's impossible to give shimboot any disk image and expect it to work. Although stuff like Devuan, Alpine, and Gentoo (non-systemd distros) will probably be fine. Another problem is that the shim uses a different system for displaying the console, called frecon. Frecon conficts with windowing systems like Xorg and Wayland, so you have to kill it before starting a UI.

It's also impossible to update the kernel, since shimboot isn't a true bootloader. The kernel is already running when we get control of it, and there's nothing we can do to switch it out. Linux has a kexec feature to replace an already running kernel, but this is disabled in the shim kernel. Remember, shimboot is dependent on a security vulnerability to work at all, so the most control we can get is PID 1 in userspace.

Right now, all that you need to do to boot any other external disk is to name the partition shimboot_rootfs:<put a custom name here> in the GPT partition table. Then the shimboot bootloader will detect it automatically and show it in the list. But you should be warned that this is guaranteed to fail without modifications to the rootfs.

Anyways, I do plan to support more Linux distros out of the box with Shimboot. If you check the alpine-test branch, I have experimental build support for both Alpine Linux and Ubuntu 24.04. Alpine works perfectly, but Ubuntu is still broken.

Thank you for the detailed answer :)