This works. However, I'm using native ZFS encryption for my root fs. Now, I get prompted twice at boot for a password (first for swap, then for root).
I only need my swap open in initramfs when resuming from hibernation (on a clean boot, it gets opened through crypttab and keyfile on root). On a clean boot, I can just enter an empty (incorrect) password 3 times, swap gets skipped, system boots and opens swap just fine. However, each incorrect password takes time.
Is there any way to conditionally open the swap, only when EFI reports a hibernation image?
Something like this would work (except I don't know how to implement the actual conditional, I can imagine probing the HibernateLocation EFI var somehow):
run_hook () {
if SOMETHING; then
return 0
fi
... # Original hook
}
Pinned Comments