From patchwork Fri Jul 9 02:48:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jack Hill X-Patchwork-Id: 31244 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 5DB2E27BC81; Fri, 9 Jul 2021 03:50:20 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 2563727BC78 for ; Fri, 9 Jul 2021 03:50:20 +0100 (BST) Received: from localhost ([::1]:48162 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m1gap-0004aw-7S for patchwork@mira.cbaines.net; Thu, 08 Jul 2021 22:50:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59190) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m1gaY-0004ao-Sy for guix-patches@gnu.org; Thu, 08 Jul 2021 22:50:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46417) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m1gaY-0003YB-Lf for guix-patches@gnu.org; Thu, 08 Jul 2021 22:50:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m1gaY-0007EV-Ci for guix-patches@gnu.org; Thu, 08 Jul 2021 22:50:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49475] [PATCH] linux-boot: Resume from hibernation after pre-boot. Resent-From: Jack Hill Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 09 Jul 2021 02:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 49475 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49475@debbugs.gnu.org Cc: Tobias Geerinckx-Rice X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.162579895827745 (code B ref -1); Fri, 09 Jul 2021 02:50:02 +0000 Received: (at submit) by debbugs.gnu.org; 9 Jul 2021 02:49:18 +0000 Received: from localhost ([127.0.0.1]:57963 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m1gZq-0007DR-2r for submit@debbugs.gnu.org; Thu, 08 Jul 2021 22:49:18 -0400 Received: from lists.gnu.org ([209.51.188.17]:35666) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m1gZm-0007DI-GO for submit@debbugs.gnu.org; Thu, 08 Jul 2021 22:49:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59124) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m1gZm-0004a9-43 for guix-patches@gnu.org; Thu, 08 Jul 2021 22:49:14 -0400 Received: from minsky.hcoop.net ([104.248.1.95]:52226) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m1gZk-00039D-5q for guix-patches@gnu.org; Thu, 08 Jul 2021 22:49:13 -0400 Received: from libre-01.lib.duke.edu ([152.3.119.171] helo=guix-part-test.network) by minsky.hcoop.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m1gZi-0008KE-A8; Thu, 08 Jul 2021 22:49:10 -0400 From: Jack Hill Date: Thu, 8 Jul 2021 22:48:53 -0400 Message-Id: <20210709024853.1170-1-jackhill@jackhill.us> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Received-SPF: pass client-ip=104.248.1.95; envelope-from=jackhill@jackhill.us; helo=minsky.hcoop.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * 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