Skip to content

Conversation

lbajolet-hashicorp
Copy link
Contributor

By default when specifying EFI as boot method for the image, Packer produces two artifacts: the image itself, and the efivars.fd file that keeps the information about the EFI variables defined.

Since some post-processors use the output from a build to create images on a cloud provider, and they don't support having a efivars.fd file in the resulting archive/artifacts, we add a new option to leave it out of the artifacts from the builder, so they can work in conjunction with EFI images.

Closes #140

@lbajolet-hashicorp lbajolet-hashicorp requested a review from a team as a code owner May 29, 2023 15:51
@lbajolet-hashicorp
Copy link
Contributor Author

Note: tested on the example/efi_build directory with a compress post-processor added to the build file, this does produce a tar.gz that only contains the image, and not the efivars.fd file.
Removing the efi_keep_efivars option contains both the image and the efivars.fd file.

@nywilken nywilken added version/bump minor A PR that changes behavior or contains breaking changes template configuration options. enhancement labels Jun 2, 2023
@nywilken nywilken added the stage/thinking Flagged for internal discussions about possible enhancements. label Sep 25, 2023
By default when specifying EFI as boot method for the image, Packer
produces two artifacts: the image itself, and the efivars.fd file that
keeps the information about the EFI variables defined.

Since some post-processors use the output from a build to create images
on a cloud provider, and they don't support having a efivars.fd file in
the resulting archive/artifacts, we add a new option to leave it out of
the artifacts from the builder, so they can work in conjunction with EFI
images.
@lbajolet-hashicorp lbajolet-hashicorp changed the title builder: add efi_keep_efivars option to builder builder: add efi_drop_efivars option to builder Sep 25, 2023
@lbajolet-hashicorp
Copy link
Contributor Author

After our discussion this morning @nywilken, I opted to rename the option to efi_drop_efivars. This is false by default (not a Trilean anymore, just a plain boolean), and explicitely drops the efivars.fd from the list of files produced by the builder.
This should solve the issue linked, with an extra step for the users to not include the file in the produced artifacts.

Copy link
Contributor

@nywilken nywilken left a comment

Choose a reason for hiding this comment

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

LGTM

@lbajolet-hashicorp lbajolet-hashicorp merged commit 8ab752b into main Sep 26, 2023
@lbajolet-hashicorp lbajolet-hashicorp deleted the keep_efivars_option branch September 26, 2023 13:41
@lbajolet-hashicorp lbajolet-hashicorp removed the stage/thinking Flagged for internal discussions about possible enhancements. label Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement version/bump minor A PR that changes behavior or contains breaking changes template configuration options.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set boolean to keep or not efivars.fd
2 participants