From patchwork Wed Oct 27 15:09:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josselin Poiret X-Patchwork-Id: 34119 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 5FE6827BBE3; Wed, 27 Oct 2021 16:51:28 +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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED 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 12C8227BBE1 for ; Wed, 27 Oct 2021 16:51:28 +0100 (BST) Received: from localhost ([::1]:42790 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mflD3-0006RM-54 for patchwork@mira.cbaines.net; Wed, 27 Oct 2021 11:51:25 -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 X-Spamd-Bar: / Authentication-Results: jpoiret.xyz; auth=pass smtp.auth=jpoiret@jpoiret.xyz smtp.mailfrom=dev@jpoiret.xyz 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" Reply-to: Josselin Poiret X-ACL-Warn: , Josselin Poiret via Guix-patches X-Patchwork-Original-From: Josselin Poiret via Guix-patches via From: Josselin Poiret X-getmail-retrieved-from-mailbox: Patches * 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)