Skip to content
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

[PATCH 0/3] kexec: Add support for UKI format kernel #9

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

pfliu
Copy link

@pfliu pfliu commented Oct 14, 2024

As a UEFI PE format kernel image becomes more popular, there is a need
for kexec to reboot those kinds of images.

After the introduction of the UKI (another PE), at present, there are
three competitive methods to support that goal, but all of them have
pros and cons.1 It seems that none of them can be accepted in the near
future. Therefore, we are resorting to the user space kexec-tools to
parse the UKI format for the time being.

By parsing the UKI, systemd-stub is stepped around and PCM will not affect
the boot up of the second system.


v1 -> v2:
Add include/pe.h in makefile to fix 'make dist'
Rename default_initrd_fd to implicit_initrd_fd

Pingfan Liu added 3 commits October 14, 2024 09:21
At present, initrd information is passed through --initrd args, and
handled until image load. But for the UKI case, the initrd may be stored
implicitly in the .initrd section.

It means that initrd is perceived at the probe stage. And there should
be a way to carry this information forward to the load stage. In oder to
implement that, introducing a global implicit_initrd_fd.

Signed-off-by: Pingfan Liu <[email protected]>
A UKI image is a PE file that consists of several sections, typically
including: .text, .data, .linux, .initrd, .cmdline, and others.

The kernel image is stored in the .linux section, which is one of the
formats currently recognized by kexec-tools. Therefore, the UKI parser
can be used to strip away the UKI layer, allowing the other parser to
continue the procession of the kernel image.

Signed-off-by: Pingfan Liu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant