Commit 8aeae9f3 authored by Ben Hutchings's avatar Ben Hutchings

hooks/resume: Disable resume when there are no suitable swap devices

In 0.131 the automatic selection of a resume device was changed to
disable resume if the largest swap device was encrypted with a
ephemeral key.

In 0.132 I changed the automatic selection to also reject zram
devices, but I also changed it to loop over all swap devices since
zram might well be used alongside a conventional swap device that we
could use.  Unfortunately, in case swap devices are available but none
are suitable, this results in selecting the last one.

Closes: #916696
Thanks: Trek <trek00@inbox.ru>
Signed-off-by: Ben Hutchings's avatarBen Hutchings <ben@decadent.org.uk>
parent 40e544e1
......@@ -81,7 +81,10 @@ if ! ischroot && [ -r /proc/swaps ]; then
$ephemeral || break
done
if [ -n "$resume_auto" ] && ! $ephemeral; then
if $ephemeral; then
resume_auto=
fi
if [ -n "$resume_auto" ]; then
if [ -n "$dm_name" ]; then
resume_auto_canon="/dev/mapper/$dm_name"
elif UUID=$(blkid -s UUID -o value "$resume_auto"); then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment