koverstreet / bcachefs-tools

http://bcachefs.org
GNU General Public License v2.0
120 stars 89 forks source link

Ask for password via systemd-ask-password #320

Closed WhatAmISupposedToPutHere closed 1 month ago

WhatAmISupposedToPutHere commented 1 month ago

This would allow to supply the password via the plymouth password input. If systemd-ask-password does not exist or fails to start, falls back to the old-style password request.

tmuehlbacher commented 1 month ago

Personally, this doesn't feel sound to me.

Wouldn't something like this do here?

while ! bcachefs mount -k fail "UUID=$uuid"; do
  systemd-ask-password --timeout=0 --no-output --keyname="bcachefs:$uuid" "Enter passphrase:"
done
WhatAmISupposedToPutHere commented 1 month ago

That would work, but it would require extra code in dracut to handle bcachefs specifically

tmuehlbacher commented 1 month ago

Do cryptsetup or any fs tools directly call into systemd-ask-password like your PR does?

WhatAmISupposedToPutHere commented 1 month ago

Dracut uses systemd-cryptsetup-generator, which calls into it even more directly (by linking against it and calling a function)