Discussion:
Multiple initrds in unified kernel images?
(too old to reply)
David Anderson
2018-10-05 07:02:12 UTC
Permalink
Hi,

I'm exploring systemd-boot and secure booting for an Arch Linux install. To
get secure boot working right, I need to build a unified kernel image that
I can sign. However, I also need to pass 2 initrd images into the boot
process (one for CPU microcode, and the proper OS iniramfs).

But, AFAICT from reading the EFI stub source code, I can only have one
".initrd" section in my unified binary.

Is it possible to have multiple initrds in a unified kernel image? If so,
how do I construct the unified image? If not, can you suggest an
alternative that gets me my microcode and my OS initramfs?

Thanks!
- Dave
David Anderson
2018-10-05 07:10:07 UTC
Permalink
And of course, the law of asking questions on the internet is verified, and
I find the answer minutes after asking a thousand people. A Linux initramfs
is a concatenation of cpio archives, so I can just `cat microcode.img
initrd.gz >initrd`, embed that in my unified image, and everything should
just work.

Please let me know if I'm wrong, and otherwise - thanks for being my rubber
ducks!

- Dave
Post by David Anderson
Hi,
I'm exploring systemd-boot and secure booting for an Arch Linux install.
To get secure boot working right, I need to build a unified kernel image
that I can sign. However, I also need to pass 2 initrd images into the boot
process (one for CPU microcode, and the proper OS iniramfs).
But, AFAICT from reading the EFI stub source code, I can only have one
".initrd" section in my unified binary.
Is it possible to have multiple initrds in a unified kernel image? If so,
how do I construct the unified image? If not, can you suggest an
alternative that gets me my microcode and my OS initramfs?
Thanks!
- Dave
Michał Zegan
2018-10-05 10:08:32 UTC
Permalink
I am not really sure if you are right and you can concatenate cpio
archives, just be ware! they may be compressed, and in this case you
would rather cat their uncompressed form... I think so at least.
Post by David Anderson
And of course, the law of asking questions on the internet is verified,
and I find the answer minutes after asking a thousand people. A Linux
initramfs is a concatenation of cpio archives, so I can just `cat
microcode.img initrd.gz >initrd`, embed that in my unified image, and
everything should just work.
Please let me know if I'm wrong, and otherwise - thanks for being my
rubber ducks!
- Dave
Hi,
I'm exploring systemd-boot and secure booting for an Arch Linux
install. To get secure boot working right, I need to build a unified
kernel image that I can sign. However, I also need to pass 2 initrd
images into the boot process (one for CPU microcode, and the proper
OS iniramfs).
But, AFAICT from reading the EFI stub source code, I can only have
one ".initrd" section in my unified binary.
Is it possible to have multiple initrds in a unified kernel image?
If so, how do I construct the unified image? If not, can you suggest
an alternative that gets me my microcode and my OS initramfs?
Thanks!
- Dave
_______________________________________________
systemd-devel mailing list
https://lists.freedesktop.org/mailman/listinfo/systemd-devel
Tobias Hunger
2018-10-05 10:58:19 UTC
Permalink
And of course, the law of asking questions on the internet is verified, and I find the answer minutes after asking a thousand people. A Linux initramfs is a concatenation of cpio archives, so I can just `cat microcode.img initrd.gz >initrd`, embed that in my unified image, and everything should just work.
Please let me know if I'm wrong, and otherwise - thanks for being my rubber ducks!
Concatenating the images (microcode from arch linux package and initrd
created by mkinitcpio) works fine for me.

Best Regards,
Tobias

Continue reading on narkive:
Loading...