andreyv / sbupdate

Generate and sign kernel images for UEFI Secure Boot on Arch Linux
GNU General Public License v3.0
225 stars 20 forks source link

How to load fallback initramfs? #8

Closed kustodian closed 5 years ago

kustodian commented 5 years ago

I set an additional initramfs in sbupdate config like this:

INITRD[linux]=/boot/initramfs-linux.img
INITRD[linux]=/boot/initramfs-linux-fallback.img

And I noticed that when I added these two lines the signed efi doubled in size, but I have no idea how to boot it with the fallback initramfs. I didn't see a section about this in the README.md.

Maryse47 commented 5 years ago

This way you are bundling two initramfs inside. You need to pass one: INITRD[linux]=/boot/initramfs-linux-fallback.img

kustodian commented 5 years ago

I want to be able to boot a same kernel with either the default initramfs, or the fallback one. Is there a way to specify that it builds two separate efi images with the same kernel, but different initramfs?

andreyv commented 5 years ago

Hi,

Currently there is no support for multiple initramfs per kernel. It is on the TODO list.

If your /boot supports symlinks, then, as a workaround, you can create a symlink /boot/vmlinuz-linux-fallback pointing to vmlinuz-linux. Then it should be automatically matched with /boot/initramfs-linux-fallback.img.

Or you can also use linux-lts as a fallback.

Maryse47 commented 5 years ago

@kustodian keep in mind that unless you have some ancient hardware, booting from non-fallback initramfs doesn't have any benefits. By using both you would only waste space.

kustodian commented 5 years ago

You're probably right. When I added autodetect hook to initramfs it reduced the size of it to about a half and I could feel the difference in boot times, because initramfs loaded faster. But now when I configured secure boot and generated a single efi binary, there isn't much of a difference, because the whole boot process is slower anyway. I'll just remove autodetect and it will be the same as fallback.

Thanks for your help and for writing and awesome tool.