91crypt-loop: use initqueue for cleanup strategy
parent
f855f9daaf
commit
df68781fca
|
|
@ -188,6 +188,9 @@ readkey() {
|
|||
if [ -f /lib/dracut-crypt-loop-lib.sh ]; then
|
||||
. /lib/dracut-crypt-loop-lib.sh
|
||||
loop_decrypt "$mntp" "$keypath" "$keydev" "$device"
|
||||
initqueue --onetime --finished --unique --name "crypt-loop-cleanup-99-$(basename $mntp)" \
|
||||
$(command -v umount) "$mntp; " $(command -v rmdir) "$mntp"
|
||||
return 0
|
||||
else
|
||||
die "No loop file support to decrypt '$keypath' on '$keydev'."
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -32,6 +32,11 @@ loop_decrypt() {
|
|||
--tty-echo-off
|
||||
|
||||
[ -b $key ] || die "Tried setting it up, but keyfile block device was still not found!"
|
||||
|
||||
initqueue --onetime --finished --unique --name "crypt-loop-cleanup-10-$(basename $key)" \
|
||||
$(command -v cryptsetup) "luksClose $key"
|
||||
initqueue --onetime --finished --unique --name "crypt-loop-cleanup-20-$(basename $loopdev)" \
|
||||
$(command -v losetup) "-d $loopdev"
|
||||
else
|
||||
info "Existing keyfile found, re-using it for $device"
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in New Issue