crypt-loop: cleanup cleanup procedures
Using initqueue --finished to cleanup stuff is not what the initqueue/finished hook was meant for. Move stuff to the real cleanup hook.master
parent
c75ce02775
commit
2187b3d097
|
@ -218,8 +218,7 @@ 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-${mntp##*/}" \
|
||||
$(command -v umount) "$mntp; " $(command -v rmdir) "$mntp"
|
||||
printf "%s\n" "umount \"$mntp\"; rmdir \"$mntp\";" > ${hookdir}/cleanup/"crypt-loop-cleanup-99-${mntp##*/}".sh
|
||||
return 0
|
||||
else
|
||||
die "No loop file support to decrypt '$keypath' on '$keydev'."
|
||||
|
|
|
@ -29,10 +29,8 @@ loop_decrypt() {
|
|||
|
||||
[ -b $key ] || die "Failed to unlock $keypath on $keydev for $device."
|
||||
|
||||
initqueue --onetime --finished --unique --name "crypt-loop-cleanup-10-${key##*/}" \
|
||||
$(command -v cryptsetup) "luksClose $key"
|
||||
initqueue --onetime --finished --unique --name "crypt-loop-cleanup-20-${loopdev##*/}" \
|
||||
$(command -v losetup) "-d $loopdev"
|
||||
printf "%s\n" "cryptsetup luksClose \"$key\"" > ${hookdir}/cleanup/"crypt-loop-cleanup-10-${key##*/}".sh
|
||||
printf "%s\n" "losetup -d \"$loopdev\"" > ${hookdir}/cleanup/"crypt-loop-cleanup-20-${loopdev##*/}".sh
|
||||
fi
|
||||
|
||||
cat $key
|
||||
|
|
Loading…
Reference in New Issue