]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
feat(resume): also consider resume= in the cmdline as enabling hibernation
authorнаб <nabijaczleweli@nabijaczleweli.xyz>
Mon, 2 Jan 2023 15:48:14 +0000 (16:48 +0100)
committerJóhann B. Guðmundsson <johannbg@gmail.com>
Mon, 13 Feb 2023 10:57:11 +0000 (10:57 +0000)
Don't consider noresume to disable, that's a single-boot flag

Closes #924

modules.d/95resume/module-setup.sh

index 5e8910489a25adff52002e308d0e014a60eb9a0b..d255103366b4b5363775a3ddb24cf9a24778ac75 100755 (executable)
@@ -13,7 +13,7 @@ check() {
     # Only support resume if hibernation is currently on
     # and no swap is mounted on a net device
     [[ $hostonly ]] || [[ $mount_needs ]] && {
-        swap_on_netdevice || [[ -f /sys/power/resume && "$(cat /sys/power/resume)" == "0:0" ]] && return 255
+        swap_on_netdevice || [[ -f /sys/power/resume && "$(< /sys/power/resume)" == "0:0" ]] || grep -rq '^\|[[:space:]]resume=' /proc/cmdline /etc/cmdline /etc/cmdline.d /etc/kernel/cmdline /usr/lib/kernel/cmdline 2> /dev/null && return 255
     }
 
     return 0