From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id gK+KE+PCkmEoWwEAgWs5BA (envelope-from ) for ; Mon, 15 Nov 2021 21:28:19 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id eCBED+PCkmHQegAA1q6Kng (envelope-from ) for ; Mon, 15 Nov 2021 20:28:19 +0000 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 19E5633C31 for ; Mon, 15 Nov 2021 21:28:19 +0100 (CET) Received: from localhost ([::1]:58148 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mmiaQ-0007yq-8c for larch@yhetil.org; Mon, 15 Nov 2021 15:28:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56592) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmiaC-0007fu-3w for guix-patches@gnu.org; Mon, 15 Nov 2021 15:28:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:44744) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mmiaB-00037G-Rs for guix-patches@gnu.org; Mon, 15 Nov 2021 15:28:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mmiaB-0008W7-Nv for guix-patches@gnu.org; Mon, 15 Nov 2021 15:28:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51346] [PATCH v3 4/5] gnu: system: Filter out boot dependencies from swap-space. Resent-From: Josselin Poiret Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 15 Nov 2021 20:28:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51346 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: Josselin Poiret , Tobias Geerinckx-Rice , 51346@debbugs.gnu.org Received: via spool by 51346-submit@debbugs.gnu.org id=B51346.163700804232641 (code B ref 51346); Mon, 15 Nov 2021 20:28:03 +0000 Received: (at 51346) by debbugs.gnu.org; 15 Nov 2021 20:27:22 +0000 Received: from localhost ([127.0.0.1]:56282 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmiZW-0008UJ-FH for submit@debbugs.gnu.org; Mon, 15 Nov 2021 15:27:22 -0500 Received: from jpoiret.xyz ([206.189.101.64]:35100) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmiZS-0008Tu-8k for 51346@debbugs.gnu.org; Mon, 15 Nov 2021 15:27:18 -0500 Received: from authenticated-user (jpoiret.xyz [206.189.101.64]) by jpoiret.xyz (Postfix) with ESMTPA id 6CBE0184F67; Mon, 15 Nov 2021 20:27:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim; t=1637008037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EHYoelUGo2Gf5whnyHK/Ud0HFS1RNHHMUgEymPzenJQ=; b=VJX8Gvn5sagFGAVlqTVzltqO7mjr0xKzDJnsRO2c4lU6OxAm7nom99tHeJQd1xwsHqvB5a bjWq6tBZx2N1u8ATuBIro86hqZU99AzGKw2aTGcKyq1HwcOxxra7BSDlnTSCsah/Gl4zld Phd+nm+W6R/FhSuCpDsnCsTRZ804GAfZ7UWP7HWlaSkLoS9ZQnaVYyAxDRao/bSQi+jKgD +mgG34+4zy1Zyzhc+9sn2X8iq+USFcW67sggX0KIs9U/vOPMa1Rf15wnLpJrWi4bmQfyCf 95FE2rnKDzklIVPk3bVmu9G40ScggVVUfK6Vf8e2pnLKw4bNEQBt5vJePfmWHQ== Date: Mon, 15 Nov 2021 20:26:30 +0000 Message-Id: <20211115202631.6032-5-dev@jpoiret.xyz> In-Reply-To: <20211115202631.6032-1-dev@jpoiret.xyz> References: <87y25p65on.fsf_-_@gnu.org> <20211115202631.6032-1-dev@jpoiret.xyz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spamd-Bar: / 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" Reply-to: Josselin Poiret X-ACL-Warn: , Josselin Poiret via Guix-patches From: Josselin Poiret via Guix-patches via X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1637008099; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: 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=EHYoelUGo2Gf5whnyHK/Ud0HFS1RNHHMUgEymPzenJQ=; b=WPxqYLmqWTnxBhUej01ogGYA50vgaXwXHSDRIM6+4kXZv3/1D2MwyYSTcq29+9Rr2EKP// oheEmOOG9O56mfDds2FBlr1KxzRt8/mtWvnRPXd2R00HwJdaXzikPmfJQR1nxfLwDqkTNX N/v3Wi5NClm3AjYyeoyuwJAUIC/TbF4cUTt/RTyART/YUzvu9qUXgjcAMXiP1ppNnGmNxq SEVNe1nLeNYYOTxz8SfLhq/wS5LH5WNU4IsZT+WJmmIksbQ6JEFWx5xWL3fZ7p8Ff6p/Ti hJ0CT8F7lS3+kpkbIKNCx6EpT3TEEXmKT0wyWKIy0MxClkYEaqg9c59k9ujAsw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1637008099; a=rsa-sha256; cv=none; b=JchdWl1m84xuzO1nwKu0ltClIYma5ysiELSx/S1cC2kE/b60tplkgz+9XCGxdUdFBY9D7p B4AyRBXzSBWIO8AiBlxdy68cIatRxgA0AE9I8zkhgkZedtMKS40HlKuQdghMeqRzVGNoyk NVP8eElCTEQsXxB4PTas5GaJR964G+8d2jJFLX/Ook3534cMs9iC6BE9I55X4p5gUbAjBU iMyDXO1LdtN2LDV9OIDTWMZzdKKpETMw/qLA7ukLYEOIKINeONw9dnJTxSM5DfVQSfnBJU D2cxIvqUftvFMj7/pnq4T6YI1qji/8Wtl+OEDgThLHnCKh7bRnIJvnFETTJCmg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b=VJX8Gvn5; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 0.66 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b=VJX8Gvn5; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 19E5633C31 X-Spam-Score: 0.66 X-Migadu-Scanner: scn1.migadu.com X-TUID: 68Qkkw0/7i3B * gnu/systems.scm (swap-services): Filter them. --- gnu/system.scm | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/gnu/system.scm b/gnu/system.scm index 76a904b681..03fb55db15 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -601,7 +601,25 @@ (define (%warn-swap-devices-change value location) (define (swap-services os) "Return the list of swap services for OS." - (map swap-service (operating-system-swap-devices os))) + (define early-userspace-file-systems + (filter file-system-needed-for-boot? + (operating-system-file-systems os))) + + (define early-userspace-mapped-devices + (operating-system-boot-mapped-devices os)) + + (define (filter-deps swap) + (if (swap-space? swap) + (swap-space + (inherit swap) + (dependencies (remove (lambda (dep) + (or (member dep early-userspace-mapped-devices) + (member dep early-userspace-file-systems))) + (swap-space-dependencies swap)))) + swap)) + + (map (compose swap-service filter-deps) + (operating-system-swap-devices os))) (define* (system-linux-image-file-name #:optional (target (or (%current-target-system) -- 2.33.1