[PATCH] linux-boot: Resume from hibernation after pre-boot.

OpenSubmitted by Jack Hill.
Details
2 participants
  • Jack Hill
  • Tobias Geerinckx-Rice
Owner
unassigned
Severity
normal
J
J
Jack Hill wrote on 9 Jul 04:48 +0200
(address . guix-patches@gnu.org)(name . Tobias Geerinckx-Rice)(address . me@tobias.gr)
20210709024853.1170-1-jackhill@jackhill.us
* gnu/build/linux-boot.scm (boot-system): Call resume-if-hibernatedafter pre-mount.---
This change allows resuming from a swap device that needs device-mapperto be set up first. In my case I tested swap on lvm on dm-crypt. Ibelieve this change to be safe since pre-mount shouldn't mount orotherwise touch the filesystems. It it did, there would be datacorruption, so special care should be taken when reviewing.
gnu/build/linux-boot.scm | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
Toggle diff (38 lines)diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scmindex 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
T
T
Tobias Geerinckx-Rice wrote on 9 Jul 05:21 +0200
(name . Jack Hill)(address . jackhill@jackhill.us)(address . guix-patches@gnu.org)
87a6mwgnvt.fsf@nckx
Jack Hill 写道:
Toggle quote (4 lines)> * gnu/build/linux-boot.scm (boot-system): Call > resume-if-hibernated> after pre-mount.
All right! \o/ Whilst I'm glad it didn't eat your data, it was still just an off-the-cuff suggestion on IRC & I'd like to take the weekend to think about the whole picture.
Kind regards,
T G-R
-----BEGIN PGP SIGNATURE-----
iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCYOfEFg0cbWVAdG9iaWFzLmdyAAoJEA2w/4hPVW155PUA/0XvlC1lk4repufb6af41nb9zjPn9RAKxVMGmg2AFwHmAQC3qkBVZa3EecQH3lcldu0+LLGodZyfUR8pdjMZ2WAxBg===qcha-----END PGP SIGNATURE-----
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send email to 49475@debbugs.gnu.org