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

Do not set boot device when doing UEFI based QEMU builds #118

Merged
merged 1 commit into from
Jan 24, 2023

Conversation

anish
Copy link
Contributor

@anish anish commented Jan 24, 2023

Describe the change you are making here!
The boot mode that packer defaults to ( "-boot", "foo") is ignored in UEFI mode. This is a harmless failure on x86_64 but when using aarch64, QEMU will reject this option and bail out with the following error:

2023/01/23 16:55:28 packer-1.8.5 plugin: Started Qemu. Pid: 3594063
2023/01/23 16:55:28 packer-1.8.5 plugin: Qemu stderr: qemu-system-aarch64: no function defined to set boot device list for this architecture

Added a test case for this, also verified working on RHEL9

@anish anish requested a review from a team as a code owner January 24, 2023 01:07
Copy link
Contributor

@lbajolet-hashicorp lbajolet-hashicorp left a comment

Choose a reason for hiding this comment

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

Hi @anish,

Thanks for the PR, the code makes sense to me, I would just like to understand how you inferred that the -boot command was ignored in UEFI builds, I tried building a x86-64 UEFI image locally, and I did not see any warning regarding this being ignored.

From my understanding it would make sense as EFIVars is what handles boot ordering, but I just wanted to have your input here.

I'd be inclined to approve this PR based on the diff, this looks harmless for x86-64, and if it fixes aarch64 builds, it's a good catch.

When you have time though please do share your thoughts, if only for my own curiosity :)

Thanks again for the fix!

@lbajolet-hashicorp lbajolet-hashicorp merged commit c5a2daf into hashicorp:main Jan 24, 2023
@anish
Copy link
Contributor Author

anish commented Jan 24, 2023

@lbajolet-hashicorp I tested manually in qemu. whatever boot order you set in efibootmgr takes precedence if you reuse your efivars image. you can also try not passing an efivars image, and it will ignore everything you pass in no matter what you set and just try the default boot order of pxe->disk->cd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants