From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 0JbeGYJ1eWGOPQAAgWs5BA (envelope-from ) for ; Wed, 27 Oct 2021 17:51:30 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id gN92FYJ1eWE/KQAAbx9fmQ (envelope-from ) for ; Wed, 27 Oct 2021 15:51:30 +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 33C2737A77 for ; Wed, 27 Oct 2021 17:51:30 +0200 (CEST) Received: from localhost ([::1]:42790 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mflD7-0006RM-Ac for larch@yhetil.org; Wed, 27 Oct 2021 11:51:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57886) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfkZ1-0004St-Og for guix-patches@gnu.org; Wed, 27 Oct 2021 11:10:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:38651) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfkZ1-00078T-FK for guix-patches@gnu.org; Wed, 27 Oct 2021 11:10:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mfkZ1-0000PW-Ac for guix-patches@gnu.org; Wed, 27 Oct 2021 11:10:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#51346] [PATCH v2 3/4] 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: Wed, 27 Oct 2021 15:10: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: Tobias Geerinckx-Rice Cc: Josselin Poiret , 51346@debbugs.gnu.org Received: via spool by 51346-submit@debbugs.gnu.org id=B51346.16353473891523 (code B ref 51346); Wed, 27 Oct 2021 15:10:03 +0000 Received: (at 51346) by debbugs.gnu.org; 27 Oct 2021 15:09:49 +0000 Received: from localhost ([127.0.0.1]:50192 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfkYm-0000OO-JK for submit@debbugs.gnu.org; Wed, 27 Oct 2021 11:09:48 -0400 Received: from jpoiret.xyz ([206.189.101.64]:34834) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfkYj-0000O7-84 for 51346@debbugs.gnu.org; Wed, 27 Oct 2021 11:09:45 -0400 Received: from authenticated-user (jpoiret.xyz [206.189.101.64]) by jpoiret.xyz (Postfix) with ESMTPA id 504D0184BC9; Wed, 27 Oct 2021 15:09:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim; t=1635347384; 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=83Fns071x+nG1qjkWnmqp22+5nT32NIAaiErrr/0H+4=; b=HAE/fuMccxzYyLVpCc2XsCWcn/i6Zs1KO4LZAFb2Khluey9ReoqLPlnrSCtHhqGs76N6Jm tp1ndDld6klNRJbglrOTPXVJE5njUNjuK5d++H5iO550tuY6xJQasHg+kWHbmgB9UEgmhr apQtZ+l1aZ7ryMzU3uL+7KKNuI7Reo7rJuP44PGsQcpEEU4U5x/7NeliYb0rH4CVgw0PjV XxW32cG/DVQTAh9I/BIKTjc0WqZC0MtTZ4T8ZFU69K3NcwdZpGm5lmY1rAhGCjZeZ3ROxX tc4bunUXsZyq0xPFXkTKphi1vPWucyNCFTGSfeYB4mLgOYimjj/vSdED4UboXw== Date: Wed, 27 Oct 2021 15:09:12 +0000 Message-Id: <20211027150913.6038-4-dev@jpoiret.xyz> In-Reply-To: <20211027150913.6038-1-dev@jpoiret.xyz> References: <87tuh6ifwe.fsf@nckx> <20211027150913.6038-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=1635349890; 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=83Fns071x+nG1qjkWnmqp22+5nT32NIAaiErrr/0H+4=; b=BGleA5xceKvSogYlSoyYO+NHlHmI01fvWwtv0JyuHGtO6USiYIAsLOLw1lx3TeIXtnW5AI XgNBDxOLnDUdBgOJHXsW2lZXKmnG7D60h6U65l4u0BP+48XXurxRpXo5HbxFTS++3Fcvxq sD0d8/YHApXYihdE2hV5mc0mhGN/Swghp8YdDk0EHc8LhMhQq5qVc9zfs2BRXOejO2tHaH VwDqj2QzxIfkeliqIrxGQKRZ/IBWHTNY9cWmWgm2vB/jhKpwYMnx42yBhu9JzGlXVHBVZq nEI1/i2vHlSKqogDpQX7dRhIcx5M+5NxFqRADnS+w7NhNYfHSPV7YS9Jk++ZQw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1635349890; a=rsa-sha256; cv=none; b=b2iGNTPlpayYlYNlSvTTRXEm1q7vMRMJowOUoBfY7j0l3Kw2T2BOwBsAuT/iTYl9xYd8uM Az4EXkD29fQRd2uLABMqDZePFKPFw2zxoxNRbfuZRpM6AaZcRcOlhc98w1icxoEw1I76O6 sqgLKEdyupRP2M5+9wj5mhq+5Uy1wkzj2j20pSM/J2MeRfvc9eBTpxL3cc8b2YqE21UiM4 05yoFP7ys6gEAGPdPgLXEq9JUYmGDfHKnl4yoEiu0Z8FU3MF/0rJXk6b/UgkAJDaQtzCzU JAnlPnQivIgfjSjoMwY8dTHSRv7EspvTzR+LCTLJGcIuXSnNHdEKvREkq8BW1Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b="HAE/fuMc"; 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: 2.57 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b="HAE/fuMc"; 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: 33C2737A77 X-Spam-Score: 2.57 X-Migadu-Scanner: scn0.migadu.com X-TUID: GkkRuuRP0J0X * gnu/systems.scm (swap-services): Filter them. --- gnu/system.scm | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/gnu/system.scm b/gnu/system.scm index 2797c07e36..e3accb3c1e 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -586,7 +586,23 @@ (define (device-mapping-services os) (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) + (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))))) + + (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