From patchwork Wed Oct 30 14:30:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janneke Nieuwenhuizen X-Patchwork-Id: 69635 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 7226727BBEA; Wed, 30 Oct 2024 14:34:48 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id DABFC27BBE2 for ; Wed, 30 Oct 2024 14:34:47 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t69lx-0002Da-FE; Wed, 30 Oct 2024 10:34:09 -0400 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 1t69lt-0002BR-AV for guix-patches@gnu.org; Wed, 30 Oct 2024 10:34:05 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t69lt-0003cu-1Z for guix-patches@gnu.org; Wed, 30 Oct 2024 10:34:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=eI15wjPgNJLWfcc2Y9D7xtqi1gvQFO5BP+sIZmkXN8M=; b=dfJC3yNIi9xXjahYtnv2OzRjBJGMbvUd7XN4GuW4mxWQIvkaPuyxfLGBSzFSn1tUimYsDYZj1KclpgWmuZNHF7JA4e2BVxGaonqfFtdawQi3InYeBxat8XGvVqHRLw5wgmZXZx12Sc5otXFUuz34nNTN4SCuYAcxAmy/cvbVZl5uHvZoYqnMTcnzpXEc4uoI1gcVoEcpSmbB3RDKebONbybawD53oM78+xvigDYUVEPH/yCGUeHhWSaZcXktsWo9ljNaHU2+nFP7lylWsScNvClTaWBuQzQHsaq1vfSo9JGSVaiiVZFmG6YtLG+N7W+M375dCeJyvTWuSpX8AtwC/w==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t69ls-0003yS-T9 for guix-patches@gnu.org; Wed, 30 Oct 2024 10:34:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#73927] [PATCH v4 06/18] system: hurd: Add swap-services to hurd-default-essential-services. Resent-From: Janneke Nieuwenhuizen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 30 Oct 2024 14:34:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73927 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 73927@debbugs.gnu.org Received: via spool by 73927-submit@debbugs.gnu.org id=B73927.173029881815132 (code B ref 73927); Wed, 30 Oct 2024 14:34:04 +0000 Received: (at 73927) by debbugs.gnu.org; 30 Oct 2024 14:33:38 +0000 Received: from localhost ([127.0.0.1]:35325 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69lR-0003vt-AT for submit@debbugs.gnu.org; Wed, 30 Oct 2024 10:33:37 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48372) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69lF-0003u7-C9 for 73927@debbugs.gnu.org; Wed, 30 Oct 2024 10:33:26 -0400 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 1t69j2-0003L6-V0; Wed, 30 Oct 2024 10:31:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=eI15wjPgNJLWfcc2Y9D7xtqi1gvQFO5BP+sIZmkXN8M=; b=Ogg5kAsIgk3bwFYYwQi0 Yh6UwuOztGP8KQ604PMl6NaiCLeCnoPmFxeSczmBOTDLLTyI3x+0/kmmftuMnVQ4kuTyQ8DblDmZT c7uzPgcUR96cSw394iVEjFAVHLh+EJqmYcHJYxTbZTICjXyfzw0GOnOUvEcdtW0L0jZIbeUUbLQiY 8/6GEsXgLXh1WcELQzssqp65GUDhpeMOHauugyEjKKD2l+5Hms6TeqmPUw1ZfLudwKFb7qDeH27/3 uS4KPbqIbCS8NliXcrTcSzcamLPEaFXlvgpEY3wpuE1SZL5c6VuItXsov9Fi/lzLBPEjrR3Sq3CXg 6VwSszYVT+TwVw==; From: Janneke Nieuwenhuizen Date: Wed, 30 Oct 2024 15:30:35 +0100 Message-ID: <5c52891a8384febf4152e0e12ae66a32c807739e.1730296564.git.janneke@gnu.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/services/base.scm (swap-service-type): Do not include 'udev' requirement for the Hurd. Use system* with "swapon", "swapoff" for the Hurd. * gnu/system.scm (hurd-default-essential-services): Add swap-services. * gnu/services/base.scm (swap-service-type): Change-Id: I1d4d445c614921752dc84aa0dd6ff42cdbf62aa8 --- gnu/services/base.scm | 20 +++++++++++++------- gnu/system.scm | 13 +++++++------ 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index d0a57a8807..6201dea4b8 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -44,6 +44,7 @@ (define-module (gnu services base) #:autoload (guix diagnostics) (warning formatted-message &fix-hint) #:autoload (guix i18n) (G_) #:use-module (guix combinators) + #:use-module (guix utils) #:use-module (gnu services) #:use-module (gnu services admin) #:use-module (gnu services shepherd) @@ -2647,7 +2648,7 @@ (define swap-service-type (with-imported-modules (source-module-closure '((gnu build file-systems))) (shepherd-service (provision (list (swap->shepherd-service-name swap))) - (requirement `(udev ,@requirements)) + (requirement `(,@(if (target-hurd?) '() '(udev)) ,@requirements)) (documentation "Enable the given swap space.") (modules `((gnu build file-systems) ,@%default-modules)) @@ -2655,16 +2656,21 @@ (define swap-service-type (let ((device #$device-lookup)) (and device (begin - (restart-on-EINTR (swapon device - #$(if (swap-space? swap) - (swap-space->flags-bit-mask - swap) - 0))) + #$(if (target-hurd?) + #~(system* "swapon" device) + #~(restart-on-EINTR + (swapon device + #$(if (swap-space? swap) + (swap-space->flags-bit-mask + swap) + 0)))) #t))))) (stop #~(lambda _ (let ((device #$device-lookup)) (when device - (restart-on-EINTR (swapoff device))) + #$(if (target-hurd?) + #~(system* "swapoff" device) + #~(restart-on-EINTR (swapoff device)))) #f))) (respawn? #f)))) (description "Turn on the virtual memory swap area."))) diff --git a/gnu/system.scm b/gnu/system.scm index c19730b331..533a4154d6 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -845,11 +845,11 @@ (define (hurd-default-essential-services os) (let ((host-name (operating-system-host-name os)) (hosts-file (%operating-system-hosts-file os)) (entries (operating-system-directory-base-entries os))) - (list (service system-service-type entries) - %boot-service - %hurd-startup-service - %activation-service - (service shepherd-root-service-type) + (cons* (service system-service-type entries) + %boot-service + %hurd-startup-service + %activation-service + (service shepherd-root-service-type) (service user-processes-service-type) ;; Make sure that privileged-programs activation script @@ -873,7 +873,8 @@ (define (hurd-default-essential-services os) (list `("hosts" ,hosts-file))) (service hosts-service-type (local-host-entries host-name))) - (service profile-service-type (operating-system-packages os))))) + (service profile-service-type (operating-system-packages os)) + (swap-services os)))) (define* (operating-system-services os) "Return all the services of OS, including \"essential\" services."