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

Support direct kernel booting a disk image #1877

Merged
merged 2 commits into from
Sep 7, 2023

Conversation

DaanDeMeyer
Copy link
Contributor

@DaanDeMeyer DaanDeMeyer commented Sep 7, 2023

This requires two things:

  1. We need to generate a split initrd again to pass to -initrd
  2. We need to synthesize a root= argument as we can't rely on
    gpt-auto-generator since we're not using EFI.

We move the partition and root= specific stuff to a new file
partition.py so we can access it from qemu.py as well.

We also introduce extract_pe_section() since we now use the logic
twice.

@DaanDeMeyer DaanDeMeyer changed the title Disk direct boot Support direct kernel booting a disk image Sep 7, 2023
Copy link
Member

@keszybz keszybz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable. The moving of the code doesn't make it easy to review…

mkosi/partition.py Outdated Show resolved Hide resolved
mkosi/partition.py Show resolved Hide resolved
mkosi/qemu.py Outdated
# kernel argument instead.
root = finalize_root(find_partitions(fname))
if not root:
die("Cannot direct boot image without root or usr partition")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

directly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think direct is more useful here, since we're using the direct kernel boot feature, but I'll change it to "Cannot direct kernel boot image ..."

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That grammatical error is grating. "Cannot perform a direct kernel boot", or "Direct kernel boot is not possible", etc.

This requires two things:
1. We need to generate a split initrd again to pass to -initrd
2. We need to synthesize a root= argument as we can't rely on
gpt-auto-generator since we're not using EFI.

We move the partition and root= specific stuff to a new file
partition.py so we can access it from qemu.py as well.

We also introduce extract_pe_section() since we now use the logic
twice.
@behrmann behrmann merged commit c6bb6ca into systemd:main Sep 7, 2023
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants