diff options
| author | Janneke Nieuwenhuizen <janneke@gnu.org> | 2024-10-20 19:37:25 +0200 |
|---|---|---|
| committer | Jan (janneke) Nieuwenhuizen <janneke@gnu.org> | 2024-11-11 07:28:33 +0100 |
| commit | 6dbfe1a118dcded3a9d77f8321aa43fbdd255011 (patch) | |
| tree | d1215abdd57b95bab7e022ab661249467846cfb0 /gnu/system | |
| parent | fdb23d9db8ca5431e280366c5c834e01eda62a5f (diff) | |
system: hurd: Remove qemu networking from %base-services/hurd.
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
Diffstat (limited to 'gnu/system')
| -rw-r--r-- | gnu/system/examples/bare-hurd.tmpl | 10 | ||||
| -rw-r--r-- | gnu/system/hurd.scm | 23 | ||||
| -rw-r--r-- | gnu/system/images/hurd.scm | 2 |
3 files changed, 23 insertions, 12 deletions
diff --git a/gnu/system/examples/bare-hurd.tmpl b/gnu/system/examples/bare-hurd.tmpl index 463c7ee7987..68c6d3c1665 100644 --- a/gnu/system/examples/bare-hurd.tmpl +++ b/gnu/system/examples/bare-hurd.tmpl | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | ;; -*-scheme-*- | 1 | ;; -*-scheme-*- |
| 2 | 2 | ||
| 3 | ;; This is an operating system configuration template | 3 | ;; This is an operating system configuration template |
| 4 | ;; for a "bare bones" setup, with no X11 display server. | 4 | ;; for a "bare bones" QEMU setup, with no X11 display server. |
| 5 | 5 | ||
| 6 | ;; To build a disk image for a virtual machine, do | 6 | ;; To build a disk image for a virtual machine, do |
| 7 | ;; | 7 | ;; |
| @@ -54,6 +54,12 @@ | |||
| 54 | (permit-root-login #t) | 54 | (permit-root-login #t) |
| 55 | (allow-empty-passwords? #t) | 55 | (allow-empty-passwords? #t) |
| 56 | (password-authentication? #t))) | 56 | (password-authentication? #t))) |
| 57 | %base-services/hurd)))) | 57 | ;; For installing on a real (non-QEMU) machine, use: |
| 58 | ;; (static-networking-service-type | ||
| 59 | ;; (list %loopback-static-networking | ||
| 60 | ;; (static-networking | ||
| 61 | ;; ...))) | ||
| 62 | ;; %base-services/hurd | ||
| 63 | %base-services+qemu-networking/hurd)))) | ||
| 58 | 64 | ||
| 59 | %hurd-os | 65 | %hurd-os |
diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm index 6d6a20cf57a..283bae6f109 100644 --- a/gnu/system/hurd.scm +++ b/gnu/system/hurd.scm | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2020-2024 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2020-2024 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen <janneke@gnu.org> | 3 | ;;; Copyright © 2020, 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org> |
| 4 | ;;; | 4 | ;;; |
| 5 | ;;; This file is part of GNU Guix. | 5 | ;;; This file is part of GNU Guix. |
| 6 | ;;; | 6 | ;;; |
| @@ -47,6 +47,7 @@ | |||
| 47 | #:use-module (gnu system vm) | 47 | #:use-module (gnu system vm) |
| 48 | #:export (%base-packages/hurd | 48 | #:export (%base-packages/hurd |
| 49 | %base-services/hurd | 49 | %base-services/hurd |
| 50 | %base-services+qemu-networking/hurd | ||
| 50 | %hurd-default-operating-system | 51 | %hurd-default-operating-system |
| 51 | %hurd-default-operating-system-kernel | 52 | %hurd-default-operating-system-kernel |
| 52 | %setuid-programs/hurd)) | 53 | %setuid-programs/hurd)) |
| @@ -79,14 +80,6 @@ | |||
| 79 | (define %base-services/hurd | 80 | (define %base-services/hurd |
| 80 | (append (list (service hurd-console-service-type | 81 | (append (list (service hurd-console-service-type |
| 81 | (hurd-console-configuration (hurd hurd))) | 82 | (hurd-console-configuration (hurd hurd))) |
| 82 | (service static-networking-service-type | ||
| 83 | (list %loopback-static-networking | ||
| 84 | |||
| 85 | ;; QEMU user-mode networking. To get "eth0", you need | ||
| 86 | ;; QEMU to emulate a device for which Mach has an | ||
| 87 | ;; in-kernel driver, for instance with: | ||
| 88 | ;; --device rtl8139,netdev=net0 --netdev user,id=net0 | ||
| 89 | %qemu-static-networking)) | ||
| 90 | (service guix-service-type | 83 | (service guix-service-type |
| 91 | (guix-configuration | 84 | (guix-configuration |
| 92 | (extra-options '("--disable-chroot" | 85 | (extra-options '("--disable-chroot" |
| @@ -102,6 +95,18 @@ | |||
| 102 | (tty (string-append "tty" (number->string n)))))) | 95 | (tty (string-append "tty" (number->string n)))))) |
| 103 | (iota 6 1)))) | 96 | (iota 6 1)))) |
| 104 | 97 | ||
| 98 | (define %base-services+qemu-networking/hurd | ||
| 99 | (cons | ||
| 100 | (service static-networking-service-type | ||
| 101 | (list %loopback-static-networking | ||
| 102 | |||
| 103 | ;; QEMU user-mode networking. To get "eth0", you need | ||
| 104 | ;; QEMU to emulate a device for which Mach has an | ||
| 105 | ;; in-kernel driver, for instance with: | ||
| 106 | ;; --device rtl8139,netdev=net0 --netdev user,id=net0 | ||
| 107 | %qemu-static-networking)) | ||
| 108 | %base-services/hurd)) | ||
| 109 | |||
| 105 | (define %setuid-programs/hurd | 110 | (define %setuid-programs/hurd |
| 106 | ;; Default set of setuid-root programs. | 111 | ;; Default set of setuid-root programs. |
| 107 | (map file-like->setuid-program | 112 | (map file-like->setuid-program |
diff --git a/gnu/system/images/hurd.scm b/gnu/system/images/hurd.scm index 9b618f7dc6e..01c422a54fb 100644 --- a/gnu/system/images/hurd.scm +++ b/gnu/system/images/hurd.scm | |||
| @@ -60,7 +60,7 @@ | |||
| 60 | (permit-root-login #t) | 60 | (permit-root-login #t) |
| 61 | (allow-empty-passwords? #t) | 61 | (allow-empty-passwords? #t) |
| 62 | (password-authentication? #t))) | 62 | (password-authentication? #t))) |
| 63 | %base-services/hurd)))) | 63 | %base-services+qemu-networking/hurd)))) |
| 64 | 64 | ||
| 65 | (define hurd-initialize-root-partition | 65 | (define hurd-initialize-root-partition |
| 66 | #~(lambda* (#:rest args) | 66 | #~(lambda* (#:rest args) |
