nixos/luksroot: Check whether the device already exists
The new reuse behaviour is cool and really useful but it breaks one of my use cases. When using kexec, I have a script which will unlock the disks in my initrd. However, do_open_passphrase will fail if the disk is already unlocked.
This commit is contained in:
parent
7041972128
commit
9cd4ce98bf
@ -118,6 +118,11 @@ let
|
||||
do_open_passphrase() {
|
||||
local passphrase
|
||||
|
||||
# Return if already unlocked
|
||||
if ! cryptsetup status "${name}" > /dev/null; then
|
||||
return
|
||||
fi
|
||||
|
||||
while true; do
|
||||
echo -n "Passphrase for ${device}: "
|
||||
passphrase=
|
||||
|
Loading…
Reference in New Issue
Block a user