unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Jack Hill <jackhill@jackhill.us>
To: 49475@debbugs.gnu.org
Cc: Tobias Geerinckx-Rice <me@tobias.gr>
Subject: [bug#49475] [PATCH] linux-boot: Resume from hibernation after pre-boot.
Date: Thu,  8 Jul 2021 22:48:53 -0400	[thread overview]
Message-ID: <20210709024853.1170-1-jackhill@jackhill.us> (raw)

* gnu/build/linux-boot.scm (boot-system): Call resume-if-hibernated
after pre-mount.
---

This change allows resuming from a swap device that needs device-mapper
to be set up first. In my case I tested swap on lvm on dm-crypt. I
believe this change to be safe since pre-mount shouldn't mount or
otherwise touch the filesystems. It it did, there would be data
corruption, so special care should be taken when reviewing.

 gnu/build/linux-boot.scm | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm
index 461df9ff46..778ee99690 100644
--- a/gnu/build/linux-boot.scm
+++ b/gnu/build/linux-boot.scm
@@ -563,15 +563,6 @@ upon error."
         (load-linux-modules-from-directory linux-modules
                                            linux-module-directory)
 
-        (unless (or (member "hibernate=noresume" args)
-                    ;; Also handle the equivalent old-style argument.
-                    ;; See Documentation/admin-guide/kernel-parameters.txt.
-                    (member "noresume" args))
-          ;; Try to resume immediately after loading (storage) modules
-          ;; but before any on-disk file systems have been mounted.
-          (false-if-exception           ; failure is not fatal
-           (resume-if-hibernated (find-long-option "resume" args))))
-
         (when keymap-file
           (let ((status (system* "loadkeys" keymap-file)))
             (unless (zero? status)
@@ -606,6 +597,15 @@ upon error."
           (unless (pre-mount)
             (error "pre-mount actions failed")))
 
+        (unless (or (member "hibernate=noresume" args)
+                    ;; Also handle the equivalent old-style argument.
+                    ;; See Documentation/admin-guide/kernel-parameters.txt.
+                    (member "noresume" args))
+          ;; Try to resume immediately after loading (storage) modules
+          ;; but before any on-disk file systems have been mounted.
+          (false-if-exception           ; failure is not fatal
+           (resume-if-hibernated (find-long-option "resume" args))))
+
         (setenv "EXT2FS_NO_MTAB_OK" "1")
 
         (if root-device
-- 
2.32.0





             reply	other threads:[~2021-07-09  2:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-09  2:48 Jack Hill [this message]
2021-07-09  3:21 ` [bug#49475] [PATCH] linux-boot: Resume from hibernation after pre-boot Tobias Geerinckx-Rice via Guix-patches via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210709024853.1170-1-jackhill@jackhill.us \
    --to=jackhill@jackhill.us \
    --cc=49475@debbugs.gnu.org \
    --cc=me@tobias.gr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).