Fix disk encryption crash when libfido2 is not installed #1893
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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