From patchwork Wed Oct 30 14:30:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Janneke Nieuwenhuizen X-Patchwork-Id: 69645 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 8448127BBEB; Wed, 30 Oct 2024 14:35:18 +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 15DA027BBE2 for ; Wed, 30 Oct 2024 14:35:18 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t69lv-0002Ce-Ks; Wed, 30 Oct 2024 10:34:07 -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 1t69ls-0002BC-SU 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 1t69ls-0003ci-IE for guix-patches@gnu.org; Wed, 30 Oct 2024 10:34:04 -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=kjowKCgQPWLCZataSj1MSToSn5qEFtW1ah5tT8UzbYI=; b=k/PKdN0RL53hmwKxCnryQgrgT3rjT3cy956Jh3iKzPgAivQvrcrGAoa5HYbb2pdQzZXI005WzrcMz7ZIuuxsXtrvbrorNBn/GrjnzIVmipLKtqHIUX0NCUerkJcOFqvV2fKAVpdpNx4OylS0nTv1E7Fx0MCYGexa8HVneH9+K2axPaVpGIPHIfBEJ2/Nepnl4OpYQuMrBMx/xVGfjFxGYfq9FBQxBhtWAqntWKjNacHaZk6T/yWuAAQM6wGH4k2qhEWF/ovBwCfPr+3x9kg1JXorN3WJjyc5AITHNpuUcevaRQfrZHGAoAujOVtV0frUcgUOSYqgQUgmp/tPDFq+Ag==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t69ls-0003yI-C6 for guix-patches@gnu.org; Wed, 30 Oct 2024 10:34:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#73927] [PATCH v4 05/18] system: hurd: Remove qemu networking from %base-services/hurd. 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.173029881715124 (code B ref 73927); Wed, 30 Oct 2024 14:34:04 +0000 Received: (at 73927) by debbugs.gnu.org; 30 Oct 2024 14:33:37 +0000 Received: from localhost ([127.0.0.1]:35323 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69lQ-0003vm-M6 for submit@debbugs.gnu.org; Wed, 30 Oct 2024 10:33:37 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36130) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t69lD-0003tq-Ad for 73927@debbugs.gnu.org; Wed, 30 Oct 2024 10:33:24 -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 1t69j1-0003Ky-Pu; Wed, 30 Oct 2024 10:31:07 -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=kjowKCgQPWLCZataSj1MSToSn5qEFtW1ah5tT8UzbYI=; b=aiRbj12mcBMK1NgijyCF 7MpkYHanH6TwLZDoQZd+0YbY5EzgbR6B7jFt9X5N6KvTSY0lArgyaS72OEx2+k8LZEOVHAUs+GoBZ SUHsRJKwfZtmRjPYeUa48dt1hP4Za2cH7isZ6IUKZ68KkT9Q49DAYH2KMNy8//Fqu8ZkP2zlJgd3V N5tiB9vKvc9gtTy+YTFt9rvH/+LJjMN+e74EAa7K5BLZscqMz214D9IS7U2A2RRx1QIocQxqSMA3/ VwviUonQIaBcKeiH/CJV7uc6r9RuDINVlhSW1Q1ThgTpnSfcme77jurVpeNXN8rLgyzikDrELxgCZ BopMxe6iB2mZ1Q==; From: Janneke Nieuwenhuizen Date: Wed, 30 Oct 2024 15:30:34 +0100 Message-ID: <31563aff635d848ced223882a61e0b691f667730.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 This allows us to use %base-services/hurd for services in a Hurd config for a real machine without removing static-networking. * gnu/system/hurd.scm (%base-services/hurd): Factor networking out to... (%base-services+qemu-networking/hurd): ..this new variable. * gnu/system/examples/bare-hurd.tmpl (%hurd-os): Use it. * gnu/services/virtualization.scm (%hurd-vm-operating-system): Use it. * gnu/system/images/hurd.scm (hurd-barebones-os): Use it. Add comment about QEMU and networking for a real machine. Change-Id: I777a63410383b9bf8b5740e4513dbc1e9fb0fd41 --- gnu/services/virtualization.scm | 4 ++-- gnu/system/examples/bare-hurd.tmpl | 10 ++++++++-- gnu/system/hurd.scm | 23 ++++++++++++++--------- gnu/system/images/hurd.scm | 2 +- 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/gnu/services/virtualization.scm b/gnu/services/virtualization.scm index d87e494348..d33dfa6ca7 100644 --- a/gnu/services/virtualization.scm +++ b/gnu/services/virtualization.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017 Ryan Moe ;;; Copyright © 2018, 2020-2024 Ludovic Courtès -;;; Copyright © 2020, 2021, 2023 Janneke Nieuwenhuizen +;;; Copyright © 2020, 2021, 2023, 2024 Janneke Nieuwenhuizen ;;; Copyright © 2021 Timotej Lazar ;;; Copyright © 2022 Oleg Pykhalov ;;; Copyright © 2022 Leo Nikkilä @@ -1643,7 +1643,7 @@ (define %hurd-vm-operating-system ;; /etc/guix/acl file in the childhurd. Thus, clear ;; 'authorize-key?' so that it's not overridden at activation ;; time. - (modify-services %base-services/hurd + (modify-services %base-services+qemu-networking/hurd (guix-service-type config => (guix-configuration (inherit config) diff --git a/gnu/system/examples/bare-hurd.tmpl b/gnu/system/examples/bare-hurd.tmpl index 463c7ee798..68c6d3c166 100644 --- a/gnu/system/examples/bare-hurd.tmpl +++ b/gnu/system/examples/bare-hurd.tmpl @@ -1,7 +1,7 @@ ;; -*-scheme-*- ;; This is an operating system configuration template -;; for a "bare bones" setup, with no X11 display server. +;; for a "bare bones" QEMU setup, with no X11 display server. ;; To build a disk image for a virtual machine, do ;; @@ -54,6 +54,12 @@ (permit-root-login #t) (allow-empty-passwords? #t) (password-authentication? #t))) - %base-services/hurd)))) + ;; For installing on a real (non-QEMU) machine, use: + ;; (static-networking-service-type + ;; (list %loopback-static-networking + ;; (static-networking + ;; ...))) + ;; %base-services/hurd + %base-services+qemu-networking/hurd)))) %hurd-os diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm index 6d6a20cf57..283bae6f10 100644 --- a/gnu/system/hurd.scm +++ b/gnu/system/hurd.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2020-2024 Ludovic Courtès -;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen +;;; Copyright © 2020, 2023, 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -47,6 +47,7 @@ (define-module (gnu system hurd) #:use-module (gnu system vm) #:export (%base-packages/hurd %base-services/hurd + %base-services+qemu-networking/hurd %hurd-default-operating-system %hurd-default-operating-system-kernel %setuid-programs/hurd)) @@ -79,14 +80,6 @@ (define %base-packages/hurd (define %base-services/hurd (append (list (service hurd-console-service-type (hurd-console-configuration (hurd hurd))) - (service static-networking-service-type - (list %loopback-static-networking - - ;; QEMU user-mode networking. To get "eth0", you need - ;; QEMU to emulate a device for which Mach has an - ;; in-kernel driver, for instance with: - ;; --device rtl8139,netdev=net0 --netdev user,id=net0 - %qemu-static-networking)) (service guix-service-type (guix-configuration (extra-options '("--disable-chroot" @@ -102,6 +95,18 @@ (define %base-services/hurd (tty (string-append "tty" (number->string n)))))) (iota 6 1)))) +(define %base-services+qemu-networking/hurd + (cons + (service static-networking-service-type + (list %loopback-static-networking + + ;; QEMU user-mode networking. To get "eth0", you need + ;; QEMU to emulate a device for which Mach has an + ;; in-kernel driver, for instance with: + ;; --device rtl8139,netdev=net0 --netdev user,id=net0 + %qemu-static-networking)) + %base-services/hurd)) + (define %setuid-programs/hurd ;; Default set of setuid-root programs. (map file-like->setuid-program diff --git a/gnu/system/images/hurd.scm b/gnu/system/images/hurd.scm index 9b618f7dc6..01c422a54f 100644 --- a/gnu/system/images/hurd.scm +++ b/gnu/system/images/hurd.scm @@ -60,7 +60,7 @@ (define hurd-barebones-os (permit-root-login #t) (allow-empty-passwords? #t) (password-authentication? #t))) - %base-services/hurd)))) + %base-services+qemu-networking/hurd)))) (define hurd-initialize-root-partition #~(lambda* (#:rest args)