From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id CAsSOvpIt2PEzAAAbAwnHQ (envelope-from ) for ; Thu, 05 Jan 2023 23:02:35 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id GLz7OfpIt2PjFgAAauVa8A (envelope-from ) for ; Thu, 05 Jan 2023 23:02:34 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 971BA3D8C5 for ; Thu, 5 Jan 2023 23:02:34 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDYJJ-0002Hd-9u; Thu, 05 Jan 2023 17:02:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDYJH-0002Gn-0n for guix-patches@gnu.org; Thu, 05 Jan 2023 17:02:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pDYJG-0003oV-OO for guix-patches@gnu.org; Thu, 05 Jan 2023 17:02:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pDYJG-0002fZ-7C for guix-patches@gnu.org; Thu, 05 Jan 2023 17:02:02 -0500 Subject: bug#59746: [DOCUMENTATION] [PATCH] doc: Introduce using Swap Space for hibernation, with an example. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-To: guix-patches@gnu.org Resent-Date: Thu, 05 Jan 2023 22:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 59746 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ivan Vilata i Balaguer Cc: 59746-done@debbugs.gnu.org Mail-Followup-To: 59746@debbugs.gnu.org, ludo@gnu.org, ivan@selidor.net Received: via spool by 59746-done@debbugs.gnu.org id=D59746.167295607910202 (code D ref 59746); Thu, 05 Jan 2023 22:02:01 +0000 Received: (at 59746-done) by debbugs.gnu.org; 5 Jan 2023 22:01:19 +0000 Received: from localhost ([127.0.0.1]:53183 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDYIY-0002eS-IA for submit@debbugs.gnu.org; Thu, 05 Jan 2023 17:01:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55970) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDYIW-0002eE-T2 for 59746-done@debbugs.gnu.org; Thu, 05 Jan 2023 17:01:17 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDYIQ-0003gO-Tp; Thu, 05 Jan 2023 17:01:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=9VlP98MVIEPjyxdZ+X75AeLM6YXjjQCQkpSrV1IWrzc=; b=d/ZTreev6wbt2dXEDyhD ZgOWrZVjtw5JE22VaTZc5Re2FPE9PnJ9v1Ctn4x8Su58K+fDcIDwLQRg4lM0PriXSbW9Gp61S+rR9 SRCE7OROBF0D8ULLtq61L/veXQalcS/3CLG9vRosqEisDvhz1cdkwokti67tcnW1hBogT6yAB4Siv N1IRtKglsdhsbF0T/2H4q7xljqy+IYFBvO5XhYZqKKWRdTKFyT4P0+4UFt4Eg6vmTGG5pLM3qWYqE 5q29rkYJbsGylBapgE6eUf+Eepd/YHMucczughiV4JjDQsJKrah37Q9WRUskmEsnWGkZ+6L8ELAKw BJ2Mylg4fOjhdw==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDYIQ-0008BJ-Hj; Thu, 05 Jan 2023 17:01:10 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: Date: Thu, 05 Jan 2023 23:01:07 +0100 In-Reply-To: (Ivan Vilata i. Balaguer's message of "Wed, 21 Dec 2022 13:16:59 +0100") Message-ID: <87tu141w0s.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1672956154; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-to:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=9VlP98MVIEPjyxdZ+X75AeLM6YXjjQCQkpSrV1IWrzc=; b=YZi9cOKtKMjhBcnZ427BJQJzsA2Fe5rle7DvUNUVep8xOWsqmeiLr1FZn7kpkI89VGroBL tdwESBishG5BZS+IHQsExXJysQ/dI/eZwd/GBLdGujRRJMbK4TkYCUnRBErFvrn2+VRCo9 X1EGzC/o6XntPw9GZ1UqbDVLQ8AcPZeWCK8jKKWg8FvOCYToLPotYqq/YC1gqWJmmN9SJK FyawFRJs29mke146aBJgYLf4R/pnE9BetfQxP3xsXhwBbC5VnizTOINeSlrXEgp3Gm3nzw 1R9abopqqNCKe+hoKtl1EbEViixZF1a+09XSJjQKzVthDIQEnms7WkU1NT8VVw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b="d/ZTreev"; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1672956154; a=rsa-sha256; cv=none; b=gEFcMY8jRvLnNmJADNTouUWPZHCoQMDheRUOK6rf5aZCmS2wIZ95hnci0gojE9PhqswPWn oQycMOv1rWcBeXSLJFkjziyM3leykhkdugfyUk5e5Y/ieAQtfpkPeJz8J0diZP4OV/kkvr KiwlbBqgQuzHb4OxwI3l3dbbtMWTyuDSxoFWEszjzlb7eimy3hg/xjrOm53r2srPk4XGBF aurmcdLu7xss5PQXHRhIEzq01e7dvlIBggfL3rCQV6dy7mjxer3rK6nSIdfL2KJAXyTIwi 0T/vF+Rv/wOpnQKDXpekKm1M4RNEVDHH1/MY5rDceVDqA7qQVSGKOf1qbaG2ow== X-Spam-Score: -1.46 X-Migadu-Queue-Id: 971BA3D8C5 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b="d/ZTreev"; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -1.46 X-TUID: 0WdY32EBM+ob --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, Ivan Vilata i Balaguer skribis: > This patch replaces the previous one and enhances it with several minor f= ixes > and the missing information related to computing the swap file offset, as > discussed [in the guix-devel thread][1]. > > [1]: https://lists.gnu.org/archive/html/guix-devel/2022-12/msg00028.html > > Thanks and cheers! > > --=20 > Ivan Vilata i Balaguer -- https://elvil.net/ > > From e95d79ef8c466e495c730f722b7aefc4d2d5969f Mon Sep 17 00:00:00 2001 > From: Ivan Vilata-i-Balaguer > Date: Wed, 21 Dec 2022 13:08:48 +0100 > Subject: [PATCH] doc: Introduce using swap space for hibernation, with > examples. > > * doc/guix.texi (Swap Space): Add a concise introduction to hibernation a= nd > specifying a swap space to the kernel to make resume work. Mention space > requirements and the need of an offset for swap files. Include a trivial > example on how to set up a mapped swap volume for hibernation and another= one > for a swap file, including how to compute the file offset. Very nice! Applied with the tweaks below. Thanks, Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/doc/guix.texi b/doc/guix.texi index 9a74ae64d6..293c3016aa 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -17109,14 +17109,18 @@ should consider ease of use when deciding between them. Partitions are allocated at disk formatting time (logical volumes notwithstanding), whereas files can be allocated and deallocated at any time. -A swap space is also required in order to hibernate a system using the -Linux kernel. Hibernation (also called suspend to disk) uses at most -half the size of the RAM in the configured swap space. The kernel needs -to know about the swap space to be used to resume from hibernation on -boot (via a kernel argument). When using a swap file, its offset in the -device holding it also needs to be given to the kernel, but that value -has to be updated if the file is initialized again as swap (e.g. because -its size was changed). +@cindex hibernation +@cindex suspend to disk +Swap space is also required to put the system into @dfn{hibernation} +(also called @dfn{suspend to disk}), whereby memory is dumped to swap +before shutdown so it can be restored when the machine is eventually +restarted. Hibernation uses at most half the size of the RAM in the +configured swap space. The Linux kernel needs to know about the swap +space to be used to resume from hibernation on boot (@i{via} a kernel +argument). When using a swap file, its offset in the device holding it +also needs to be given to the kernel; that value has to be updated if +the file is initialized again as swap---e.g., because its size was +changed. Note that swap space is not zeroed on shutdown, so sensitive data (such as passwords) may linger on it if it was paged out. As such, you should @@ -17215,7 +17219,7 @@ select the file system in an elegant fashion! %default-kernel-arguments)) @end lisp -The previous snippet of an @code{operating-system} declaration enables +The above snippet of an @code{operating-system} declaration enables the mapped device @file{/dev/mapper/my-swap} (which may be part of an encrypted device) as swap space, and tells the kernel to use it for hibernation via the @code{resume} kernel argument --=-=-=--