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

Introducing load_key hook in zfsbootmenu/lib/zfsbootmenu-core.sh #452

Closed
wants to merge 5 commits into from

Conversation

rdmitry0911
Copy link

@rdmitry0911 rdmitry0911 commented Jul 18, 2023

This is a hook placeholder for scripts to run just before loading key for a dataset. It can be used for example for automatic dataset unlocking using clevis or for some other purposes. The only argument provided to the hook is dataset name
As a proof of concept a load_key_clevis_hook.sh script is included in contrib directory

Copy link
Member

@ahesford ahesford left a comment

Choose a reason for hiding this comment

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

In principle, I'm not opposed to adding load-key hooks to allow some early setup, but there is a lot to think about when trying to generalize your single-purpose Clevis hook for a broader user base.

zfsbootmenu/lib/zfsbootmenu-core.sh Outdated Show resolved Hide resolved
zfsbootmenu/lib/zfsbootmenu-core.sh Show resolved Hide resolved
zfsbootmenu/lib/zfsbootmenu-core.sh Outdated Show resolved Hide resolved
zfsbootmenu/help-files/92/zfsbootmenu.7.ansi Outdated Show resolved Hide resolved
etc/zfsbootmenu/mkinitcpio.conf Outdated Show resolved Hide resolved
contrib/load_key_clevis_hook.sh Outdated Show resolved Hide resolved
contrib/load_key_clevis_hook.sh Outdated Show resolved Hide resolved
contrib/load_key_clevis_hook.sh Outdated Show resolved Hide resolved
contrib/load_key_clevis_hook.sh Outdated Show resolved Hide resolved
contrib/load_key_clevis_hook.sh Outdated Show resolved Hide resolved
@rdmitry0911 rdmitry0911 marked this pull request as draft July 19, 2023 12:52
@rdmitry0911 rdmitry0911 marked this pull request as ready for review July 19, 2023 12:57
Copy link
Member

@ahesford ahesford left a comment

Choose a reason for hiding this comment

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

You really shouldn't be doing these edits from the GitHub UI. You need to:

  • Drop the edits to contrib/README.md
  • Restore README.md to its original state. Your latest commit deleted the entire file.
  • Add a section to docs/man/zfsbootmenu.7.rst, between the zfsbootmenu_setup and zfsbootmenu_teardown sections of the "Options for dracut" block, fully describing the hooks.
  • Squash all of these commits down to one.

zfsbootmenu/help-files/92/zfsbootmenu.7.ansi Outdated Show resolved Hide resolved
zfsbootmenu/help-files/132/zfsbootmenu.7.ansi Outdated Show resolved Hide resolved
etc/zfsbootmenu/mkinitcpio.conf Outdated Show resolved Hide resolved
etc/zfsbootmenu/mkinitcpio.conf Outdated Show resolved Hide resolved
zfsbootmenu/lib/zfsbootmenu-core.sh Outdated Show resolved Hide resolved
@rdmitry0911
Copy link
Author

rdmitry0911 commented Jul 19, 2023 via email

docs/man/zfsbootmenu.7.rst Outdated Show resolved Hide resolved
rdmitry0911 and others added 4 commits July 22, 2023 17:18
Provided a function for automatic unlocking of encrypted zfs pool using clevis and pcr_ids 1,4,5,7,9 of tpm2 module

Update zfsbootmenu-core.sh

Update zbm-builder.sh

Update zfsbootmenu

Update module-setup.sh for load_key hook

Update mkinitcpio.conf to include load_key hook

Update mkinitcpio.conf to include load_key hook

Update container-building.rst to include load_key hook

Update container-building.rst to include load_key hook

Update zfsbootmenu-core.sh to include load_key hook

Update zfsbootmenu/lib/zfsbootmenu-core.sh

Co-authored-by: Andrew J. Hesford <[email protected]>

Update zfsbootmenu/lib/zfsbootmenu-core.sh

Co-authored-by: Andrew J. Hesford <[email protected]>

Update etc/zfsbootmenu/mkinitcpio.conf

Co-authored-by: Andrew J. Hesford <[email protected]>

Update etc/zfsbootmenu/mkinitcpio.conf

Co-authored-by: Andrew J. Hesford <[email protected]>

Update zfsbootmenu-core.sh

Update docs/guides/general/container-building.rst

Co-authored-by: Andrew J. Hesford <[email protected]>

Update module-setup.sh

Update etc/zbm-builder/mkinitcpio.conf

Co-authored-by: Andrew J. Hesford <[email protected]>

Update etc/zfsbootmenu/mkinitcpio.conf

Co-authored-by: Andrew J. Hesford <[email protected]>

Update zbm-builder.sh

Co-authored-by: Andrew J. Hesford <[email protected]>

Update zfsbootmenu
* Add ca-certs to recovery image, so cURL can connect over HTTPS
* Add sgdisk to recovery image
* Add zbm-kcl / zbm-kcl.8 documentation to release and recovery images

Closes zbm-dev#400
Closes: zbm-dev#427.

Update zfsbootmenu-core.sh

Update mkinitcpio.conf

Update zfsbootmenu-core.sh

Update docs/man/zfsbootmenu.7.rst

Co-authored-by: Andrew J. Hesford <[email protected]>

Update docs/man/zfsbootmenu.7.rst

Co-authored-by: Andrew J. Hesford <[email protected]>
@zdykstra
Copy link
Member

There should be a single commit in this PR. You've added previous commits to this.

@zdykstra
Copy link
Member

zdykstra commented Aug 8, 2023

Feel free to re-open this PR once the acceptance criteria have been met.

@zdykstra zdykstra closed this Aug 8, 2023
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.

4 participants