From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id A5D6F13835A for ; Sun, 21 Mar 2021 22:36:13 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 00B8AE0880; Sun, 21 Mar 2021 22:36:13 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id DD2E5E0880 for ; Sun, 21 Mar 2021 22:36:12 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E4FEB335C9F for ; Sun, 21 Mar 2021 22:36:11 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 2FC6C630 for ; Sun, 21 Mar 2021 22:36:09 +0000 (UTC) From: "Thomas Deutschmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Thomas Deutschmann" Message-ID: <1616362769.3e69d8284b17f5f3471a9f7b7c58787d4a2bf051.whissi@gentoo> Subject: [gentoo-commits] proj/genkernel:master commit in: defaults/ X-VCS-Repository: proj/genkernel X-VCS-Files: defaults/initrd.scripts X-VCS-Directories: defaults/ X-VCS-Committer: whissi X-VCS-Committer-Name: Thomas Deutschmann X-VCS-Revision: 3e69d8284b17f5f3471a9f7b7c58787d4a2bf051 X-VCS-Branch: master Date: Sun, 21 Mar 2021 22:36:09 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: e01760e1-3d3d-4772-898f-d5293d51456a X-Archives-Hash: 9a7708f795c7dd435c85e9b38ea0d669 commit: 3e69d8284b17f5f3471a9f7b7c58787d4a2bf051 Author: Thomas Deutschmann gentoo org> AuthorDate: Sun Mar 21 18:17:47 2021 +0000 Commit: Thomas Deutschmann gentoo org> CommitDate: Sun Mar 21 21:39:29 2021 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=3e69d828 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 gentoo.org> defaults/initrd.scripts | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index fb6f314..927404d 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() {