Switch to systemd-boot for raw-efi builds#4183
Conversation
|
I really like this idea. I have been looking into systemd-boot and UKIs for other purposes, and would like to see them here. A few points on this PR. Some will make it easier, some will make it more complex. First, I don't think you need a The reason we have a separate grub package, is because we need to create the artifacts in grub-dev On the other hand, if you want to build it from source so you have it for riscv64 (assuming that is doable?), then a separate package is the way to go. Next, alpine. Updating alpine is a bit of a pain. It cannot just be updated in Finally, kernel. It needs more than just updating the config. There is a process for updating kernel config, documented here, but it is easier to do so in the context of a new kernel version, documented here. Unfortunately, each of those steps is some work. I would suggest handling each one in a separate PR:
|
|
Yeah I know alpine and the kernel need more work for the full update. I just wanted to outline my ideas and the required changes without all the noise the other changes would introduce. |
bbda9f9 to
365b4eb
Compare
|
I think the building for I'll update the kernel and the alpine next, now that I know what packages I really need and where I need them. |
|
And of course, I commented on the wrong PR. |
365b4eb to
ebce1c4
Compare
|
I rebased the PR on the newest version with our alpine and kernel changes. |
deitch
left a comment
There was a problem hiding this comment.
I rather like this. Should existing tests cover it? I would think so.
Can you describe what the filesystem layout looks like before and after? I can kind of reverse-engineer it from the make-efi code, but better to be explicit. Maybe a quick README in mkimage-raw-efi would be helpful.
Also, what other build formats would benefit from this?
I think I'd actually write an additional test for
Yeah sure, I'll add it.
I think basically everything that targets |
ebce1c4 to
5537918
Compare
Signed-off-by: Chris Irrgang <chris.irrgang@gmx.de>
Signed-off-by: Chris Irrgang <chris.irrgang@gmx.de>
5537918 to
e229328
Compare
| @@ -0,0 +1,32 @@ | |||
| #!/bin/sh | |||
There was a problem hiding this comment.
This is a lovely and simple test.
| sfdisk \ | ||
| sgdisk \ | ||
| xfsprogs \ | ||
| py3-pefile \ |
There was a problem hiding this comment.
The purist in me is bothered by this. ukify is there for building low-level early-stage binaries, so why does the tool itself have to be Python (to which I don't object in general)? But I also need to be practical.
|
And CI is clean, including your tests. Happy to merge it in, and thank you for your patience. |
- What I did
Replaced grub with systemd-boot and make use of the systemd-efistub together with a UKI. Only for
raw-efiandamd64andaarch64for now. Unfortunately, I could not keep theriscv64support because alpine does not have systemd-boot packages built forriscv64. I'm not sure if this would be a dealbreaker or if we maybe could just compile them quickly ourselves.Also I initially thought enabling
CONFIG_EFI_STUBin the kernel would not be necessary because I made use of the systemd-efistub but without the configuration I get the following error during boot:The PR is related to these two issues, with the latter one being the reason for this PR: #4123 #4125
- How I did it
I added a new tools package
systemd-bootthat contains the EFI stubs for bothamd64andaarch64. This is then used in themkimage-raw-efipackage instead of the grub image. Inside themake-efiscript the grub config was replaced with a systemd-boot config and the kernel and initrd together with the cmdline were combined into a single UKI, that is then put into the ESP and is being auto-detected by systemd-boot.- How to verify it
Build the new kernel (only necessary for amd64) and build a simple image with the kernel and with the
raw-efioutput. Let the resulting image run in UEFI mode, e.g. with:If the resulting image is really small this PR would also be required for the file to be valid: #4139
- Description for the changelog
Replaced grub with systemd-boot for
raw-efioutput