From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id YLPcCglEImdpawAA62LTzQ:P1 (envelope-from ) for ; Wed, 30 Oct 2024 14:34:49 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id YLPcCglEImdpawAA62LTzQ (envelope-from ) for ; Wed, 30 Oct 2024 15:34:49 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=dfJC3yNI; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=Ogg5kAsI; dmarc=pass (policy=none) header.from=gnu.org; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1730298889; a=rsa-sha256; cv=none; b=XbjwyuPYUtXZgPeJL/TyhXShDYveBIF8UAO3OPzTO+qLkV31VFaN52nw9OVbZNJW/wBX3d hG3fAvsf29ls0bAk3Y6q6Q4ttakf/P0cDs+Vaj8PGBVzCO+yUlQTSsOAmpTTY+Cg8EToO4 Amc4x5Jgabgga8Rq5QD723ZEEXQwFY2xTHS/2BSo8pBeyrEmvlZQE5ob21KvGJyHqiLCT9 YMFqQ1LfBP0QMOqAvhqfCZ1dlJtb1fHkgs0yOfjJd1FQ/jX+Oeff6YrBJeP9Mui96oUVXV tE4EqbVzglHNDMJX6R4WlKl0+ldG6YznRUJtcO9YAWLDYUPozOqFLVpDKxB3Ng== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=dfJC3yNI; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=Ogg5kAsI; dmarc=pass (policy=none) header.from=gnu.org; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1730298889; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: 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=eI15wjPgNJLWfcc2Y9D7xtqi1gvQFO5BP+sIZmkXN8M=; b=d8vC+qb3OGdDpSDRq5VAl/gjc/umCdKyHGxvEXezXEBOxUPAyqHwwBPC8CpqPw83tzSixM urLEyviQfszCr1qlBri3gaq8m4zUJKzhbvPRR//iLkDQFH5njGJh9X3gmC/scRzFRBbP3R +StK5czAkqSC6Vst5VeX+cFLK+nAQ5rSRbrYcFmi2uuiYO6jlbPmjAavEnjHc4AN8zFsag RfXytIrPkmy2DLCz+1Je5hdVGZ2r5Ul5eJXTc2UZqjtUMbpC5YVTEJuC5wWpQlJLIY6hG4 teGRZMGgWmo6fVp+wTfr+L4vXpsFlvZ8G3jahVnkhDvVa1XyCUAOFvALQETLOA== 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 87B951F8A for ; Wed, 30 Oct 2024 15:34:48 +0100 (CET) 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: 1.34 X-Spam-Score: 1.34 X-Migadu-Queue-Id: 87B951F8A X-Migadu-Scanner: mx12.migadu.com X-TUID: M440BabaS5Bc * 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." -- Janneke Nieuwenhuizen | GNU LilyPond https://LilyPond.org Freelance IT https://www.JoyOfSource.com | AvatarĀ® https://AvatarAcademy.com