diff options
author | Thomas Deutschmann <whissi@gentoo.org> | 2021-03-21 19:17:47 +0100 |
---|---|---|
committer | Thomas Deutschmann <whissi@gentoo.org> | 2021-03-21 22:39:29 +0100 |
commit | 3e69d8284b17f5f3471a9f7b7c58787d4a2bf051 (patch) | |
tree | 524a2eb10d84dbbbc30702028359b731c1a57d47 | |
parent | linuxrc: Adjust resume device messages (diff) | |
download | genkernel-3e69d8284b17f5f3471a9f7b7c58787d4a2bf051.tar.gz genkernel-3e69d8284b17f5f3471a9f7b7c58787d4a2bf051.tar.bz2 genkernel-3e69d8284b17f5f3471a9f7b7c58787d4a2bf051.zip |
initrd.scripts: do_resume(): Show warning when kernel doesn't support hibernation
...but "resume" was specified on kernel command-line.
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
-rw-r--r-- | defaults/initrd.scripts | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index fb6f3141..927404d3 100644 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -2538,30 +2538,38 @@ do_resume() { local device=$(find_real_device "${REAL_RESUME}") if [ -z "${device}" ] then - warn_msg "REAL_RESUME (${REAL_RESUME}) device not found; Skipping resume ..." + warn_msg "resume device (${REAL_RESUME}) not found; Skipping resume ..." 0 return 0 else REAL_RESUME="${device}" fi + local resume_tried=no if [ -d /proc/suspend2 -o -d /sys/power/suspend2 -o -d /sys/power/tuxonice ] then tuxonice_resume - else + resume_tried=yes + elif [ -f /sys/power/resume ] + then swsusp_resume + resume_tried=yes + fi + + if is_true "${resume_tried}" + then + warn_msg "System is not resuming from ${REAL_RESUME}, probably because it wasn't suspended; Continue normal booting ..." + else + warn_msg "resume device (${REAL_RESUME}) specified but kernel is lacking proper hibernation support!" fi } swsusp_resume() { # determine swap resume partition local device=$(ls -lL "${REAL_RESUME}" | sed 's/\ */ /g' | cut -d \ -f 5-6 | sed 's/,\ */:/') - if [ -f /sys/power/resume ] - then - log_msg "Trying to resume using swsusp ..." - log_msg "COMMAND: 'echo \"${device}\" > /sys/power/resume'" - echo "${device}" > /sys/power/resume - log_msg "System is not resuming from ${REAL_RESUME}, probably because it wasn't suspended; Continue normal booting ..." - fi + + log_msg "Trying to resume using swsusp ..." + log_msg "COMMAND: 'echo \"${device}\" > /sys/power/resume'" + echo "${device}" > /sys/power/resume } tuxonice_resume() { @@ -2627,7 +2635,6 @@ tuxonice_resume() { echo "${REAL_RESUME}" > "${tuxonice_resumedev}" log_msg "COMMAND: 'echo > ${tuxonice_do_resume}'" echo > "${tuxonice_do_resume}" - log_msg "System is not resuming from ${REAL_RESUME}, probably because it wasn't suspended; Continue normal booting ..." } find_loop() { |