VoidLinuxInstaller icon indicating copy to clipboard operation
VoidLinuxInstaller copied to clipboard

Make unified kernel images

Open Stratos-Crimson opened this issue 1 year ago • 4 comments

Unified Kernel Images are easier to work with for secureboot and are just one file.

Stratos-Crimson avatar Aug 10 '23 23:08 Stratos-Crimson

Hi, thank you for suggestion!

As I said in the other issue you opened, I have little to no knowledge about all the Linux related stuffs, in particular about Unified Kernel Image. So if you find any detailed documentation how to do so, please link it here, that would be really helpful!

Or if you feel confident enough, feel free to submit a PR! 😄

Le0xFF avatar Aug 11 '23 07:08 Le0xFF

Very small update on generating Unified Kernel Images (UKI), also needed as a future remainder:

  • packet dracut-uefi exists in void-packages repo and its purpose is exactly to generate EFI executable with dracut itself; it will also install gummiboot-efistub and that will be used as EFI stub, as it implies.
  • for how my script works, when selecting EFISTUB as bootloader, dracut can be easily configured for generating UKI:
    • Disable all the EFISTUB stuffs (kernel.d/post-install and default/efiboomgr)
    • Use the default/efibootmgr as kernel_cmdline for dracut;
    • Set uefi="yes" and as uefi_stub the one from gummiboot in dracut configuration file.

Problem is that even after all of this and correctly generating new files, system won't boot due to the following error:

Initramfs unpacking failed: invalid magic at start of compressed archive

image

I tried different things, like adding as dracut drivers the zstd one but nothing changed. I'm clueless.


https://www.reddit.com/r/Gentoo/comments/12t5yqj/a_few_questions_from_a_new_user_dracut/

https://www.reddit.com/r/voidlinux/comments/16pfw3z/how_to_generate_a_new_efi_executable_initramfs_on/

https://www.reddit.com/r/voidlinux/comments/hgqf5o/dracut_uefi_kernel_image_problem/

Le0xFF avatar Oct 03 '23 10:10 Le0xFF

I don't know about dracut-efi and I don't have It but how I did It is, I have a dracut.conf with the options you said but the normal dracut command doesn't work so I use a custom dracut command. usr/bin/dracut -q --force --uefi --uefi-stub /usr/lib/gummiboot/linuxx64.efi.stub -f /boot/EFI/Linux/linux.efi ${VERSION} and just put that in the post-install hook. And whenever you will install a new kernel, you will get an updated efistub automatically.

Stratos-Crimson avatar Oct 10 '23 23:10 Stratos-Crimson

You can just have that one entry in the efi and It will automatically get updated and you won't need to change It.

Stratos-Crimson avatar Oct 10 '23 23:10 Stratos-Crimson