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

Fix disk encryption crash when libfido2 is not installed #1893

Merged
merged 1 commit into from Jun 22, 2023
Merged

Fix disk encryption crash when libfido2 is not installed #1893

merged 1 commit into from Jun 22, 2023

Conversation

ArtikusHG
Copy link
Contributor

  • This fix issue:

PR Description:

This PR makes one very simple change - it places the call to systemd-cryptenroll --fido2-device=list into a try/except block to prevent the encryption setup from failing when libfido2 is not installed. Unless in a try/except block, the call fails because any command that exits with a non-zero code throws an exception as per SysCommand. When libfido2 is not installed, the mentioned command fails with code 1, unlike when the library is installed, it exits with code 0 regardless of whether there are fido2 devices present or not.

I have tested the code on my machine, and this change allows me to proceed further in the installation process while using disk encryption without the libfido2 package installed. The reason I'm making this change is because libfido2 should not be a hard dependency of archinstall, however, disk encryption can't be used without it (in the current state of the program).

If you want me to make any changes, or explain anything else, I will be happy to cooperate.

Tests and Checks

  • I have tested the code!

@ArtikusHG ArtikusHG requested a review from Torxed as a code owner June 22, 2023 16:44
@Torxed
Copy link
Member

Torxed commented Jun 22, 2023

I think this is a valid fix for now. We should perform a pacman -Sy libfido right before we start installing IF HSM was selected. Maybe -Syu if it is kernel or linkage dependant.

But for now this works, but will confuse people why it's not working hehe.

Best thing would make it to a hard dependency in the PKGBUILD I think as it's a small addition to the ISO(?) and it would do no harm to the finished installation.

@ArtikusHG
Copy link
Contributor Author

I don't believe adding libfido2 as a hard dependency is a great fix. It is already in the iso, and the point of my fix is to make it so that you can use archinstall on systems without it.

I found this bug by trying to install arch to another drive from an existing system. libfido2 is not part of base, so it is not installed on most arch systems. I think what we should really do is add libfido2 as an optional dependency, and ship my fix, because fido support is completely optional and the installer shouldn't fail because of this. That being said, I am not strictly against adding libfido2 as a dependency - just think this is not the best way to handle this.

@Torxed
Copy link
Member

Torxed commented Jun 22, 2023

ah fair enough. I mainly operate on the assumption that we're talking about the live environment. Opt dep is fine in PGKBUILD then :)

@Torxed Torxed merged commit 748f03c into archlinux:master Jun 22, 2023
@ArtikusHG
Copy link
Contributor Author

Thanks for cooperation and merging so quickly! :p

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.

None yet

2 participants