-
Notifications
You must be signed in to change notification settings - Fork 8
Allow netbooting from a local UKI iso #269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
I'm getting a kernel panic when immucore runs. I'm trying to debug. I'm putting these notes here to remember how I got some output from immucore.
This allows me to run it with
to get gdb in the initramfs.
(notice how I copy the custom immucore and custom kairos-init)
I serve it with Auroraboot using this command (from this branch):
I will try to simplify all the above by finding a way to get immucore to print to the graphical console instead of just the file. This way I can simply print messages and skip the long process above. |
First problem I see: ![]() I think the problem is that there is no proper |
This patch in immucore makes the messages appear in the graphical console and drops me to emergency console: If we can make this configurable, maybe we can even merge a feature like that in immucore. |
I had a talk with Chatgpt and figured out that some UEFI implementations don't execute the efi file properly and instead of executing the efi file using the stub's enrypoint, they directly execute the kernel (which is part of the UKI file). This way nothing sets the cmdline resulting in the default "file" content. It suggested something that worked. Instead of serving the Kairos efi file via netboot, I served the grub efi file from Fedora (I had to install these 2 packages in the Auroraboot image: This dropped me to a grub shell. Supposedly, according to chatgpt, grub would try to fetch the grub.cfg from the same http server where the efi file was loaded from but to test that, I would have to change the netboot library we use to serve it. Instead of this, I spawn up a python server that served the Kairos efi file (
I had a custom build of immucore that dropped me to an emergency shell right after mounting This proves that chatgpt was right that the uefi firmware can't properly run the UKI file. Grub loads it correctly and cmdline is set. Of course this is just a hack. We would need to find a way to automatically chainload our efi file from grub without needing to manually run any commands in the grub terminal. Maybe grub will indeed try to load the grub.cfg automatically from the same http server. I'll investigate that option. If this works, we can move on to debugging the next failure. Strangely, although I had a custom build of immucore that should drop me to a shell if a panic occured, it didnt' happen and I got a kernel panic instead. |
In any case, grub is not going to cut it because without systemd-boot, there is nothing to enroll the keys to the firmware. We tried a different approach, by trying to serve the ipxe efi file (this one: https://boot.ipxe.org/ipxe.efi). The system enters a loop because as soon as ipxe starts it requests for a netboot and our server replies back with the same efi file. But as soon as a Kill our server (auroraboot) it drops me into a shell. From there I tried:
with memdisk I found on my arch linux under
Next thing to try is |
not generic ISOs. |
Start the server with something like this: ``` go build -o build/auroraboot . docker run --net host --rm --privileged -v $PWD/build/kairos-uki.iso:/kairos.iso -v /var/run/docker.sock:/var/run/docker.sock -v $PWD/build/:/output -v $PWD/build/auroraboot:/bin/auroraboot --entrypoint /bin/auroraboot quay.io/kairos/auroraboot --debug --set "local_iso=/kairos.iso" --set "netboot_type=uki" --set "state_dir=/output" ``` Signed-off-by: Dimitris Karakasilis <[email protected]>
Signed-off-by: Dimitris Karakasilis <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #269 +/- ##
==========================================
- Coverage 29.85% 29.80% -0.06%
==========================================
Files 19 19
Lines 2656 2661 +5
==========================================
Hits 793 793
- Misses 1738 1743 +5
Partials 125 125 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I tried various more things but with no success:
@Itxaka suggested one more idea on Slack: One last thing to try is to find a known-to-work-microsoft-signed efi file and try to netboot that. If that fails too, then the problem is not our signing of efi files. It's on the firmware not supporting secureboot over netboot. |
I tried to setup iscsi target both with Auroraboot and with a simple container but it seems to be very hard to set it up containerized. It requires I'll spend the rest of my day to investigate is HTTP boot is a better option so we have an idea on Monday's planning. |
With a little investigation, is seems that, using HTTP boot, only changes how we load the efi file. The rest of the problems stay:
|
Start the server with something like this: