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 plymouth passphrase prompt with dracut #12147

Merged
merged 1 commit into from
Jun 26, 2021

Conversation

paper42
Copy link
Contributor

@paper42 paper42 commented May 28, 2021

Motivation and Context

When plymouth is in the initramfs generated by dracut, mounting an encrypted zfs filesystem results in an error

cannot open 'zroot': invalid character ''' in name

This is because plymouth --command is ran which splits the command on spaces which means that zfs-load-key gets the filesystem name enclosed in single quotes (since 13c59bb) and fails.

Similar issue with initramfs: #9193
Similar PR for initramfs where the issue with dracut was also discussed: #9202

Description

This commit fixes it by piping the password directly to the command similar to how it's done in other scripts (initramfs, dracut without plymouth).

How Has This Been Tested?

I tested this on my laptop both with plymouth in the initramfs and without.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

plymouth --command splits the command on spaces which means
that zfs-load-key was getting the filesystem name enclosed
in single quotes (since 13c59bb) and failing. This commit
fixes it by piping the password directly to the command
similar to how it's done in other scripts (initramfs,
dracut without plymouth).

Signed-off-by: Michal Vasilek <[email protected]>
Related-to: openzfs#9193
Related-to: openzfs#9202
@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label May 30, 2021
@behlendorf
Copy link
Contributor

@belperite @ghfields I was hoping since you tackled a similar issue in #9202 I could convince you to review this related fix.

@ahesford
Copy link
Contributor

Ping; I'm wondering if we should pull this patch for void-linux/void-packages#31644

@behlendorf
Copy link
Contributor

If you can verify this does resolve the issue it should be safe to pull. If you are able to test it locally please let us know and we can pull it in as well, it's just been blocked on review/testing.

@ahesford
Copy link
Contributor

Unfortunately, I don't use plymouth, but the change looks to work as intended. I'll let the Void PR gel for a few days in case those you tagged have a chance to review here, but I'm inclined to accept it unless you all discover something unexpected.

@bghira
Copy link

bghira commented Jun 24, 2021

i have strong doubts that this will work, as i've worked on this before for other projects, plymouth is particular about how this is done.

@ericonr
Copy link
Contributor

ericonr commented Jun 25, 2021

This is known to work; as explained in the PR description, @paper42 has tested it on a physical device.

@behlendorf
Copy link
Contributor

Alright, we'll go ahead and move forward with this change. As mentioned in the PR description we've already made a very similar initramfs change for exactly this reason and it's been tested by the author.

@behlendorf behlendorf merged commit f20fb19 into openzfs:master Jun 26, 2021
behlendorf pushed a commit to behlendorf/zfs that referenced this pull request Jun 29, 2021
plymouth --command splits the command on spaces which means
that zfs-load-key was getting the filesystem name enclosed
in single quotes (since 13c59bb) and failing. This commit
fixes it by piping the password directly to the command
similar to how it's done in other scripts (initramfs,
dracut without plymouth).

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Michal Vasilek <[email protected]>
Related-to: openzfs#9193
Related-to: openzfs#9202
Closes openzfs#12147
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Code Review Needed Ready for review and testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants