34 lines
1.4 KiB
Diff
34 lines
1.4 KiB
Diff
From 0b97790626bff3579755b38f78a9c524a075cfcc Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
|
|
Date: Wed, 10 Nov 2021 12:14:15 +0100
|
|
Subject: [PATCH] fix(resume): check for presence of /sys/power/resume
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
On platforms where the kernel is built without suspend/resume support we
|
|
see "cat: /sys/power/resume: No such file or directory" message when
|
|
creating an initrd image. Check for the presence of /sys/power/resume
|
|
first before reading it.
|
|
|
|
Signed-off-by: Dan Horák <dan@danny.cz>
|
|
Conflict:NA
|
|
Reference:https://github.com/dracutdevs/dracut/commit/0b97790626bff3579755b38f78a9c524a075cfcc
|
|
---
|
|
modules.d/95resume/module-setup.sh | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/modules.d/95resume/module-setup.sh b/modules.d/95resume/module-setup.sh
|
|
index f0507b136..b47acbece 100755
|
|
--- a/modules.d/95resume/module-setup.sh
|
|
+++ b/modules.d/95resume/module-setup.sh
|
|
@@ -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 || [[ "$(cat /sys/power/resume)" == "0:0" ]] && return 255
|
|
+ swap_on_netdevice || [[ -f /sys/power/resume && "$(cat /sys/power/resume)" == "0:0" ]] && return 255
|
|
}
|
|
|
|
return 0
|