diff options
| author | Janneke Nieuwenhuizen <janneke@gnu.org> | 2024-11-12 08:05:52 +0100 |
|---|---|---|
| committer | Janneke Nieuwenhuizen <janneke@gnu.org> | 2024-12-03 08:39:01 +0100 |
| commit | 9e2eae54f9ae06a1ca5873ab81fa4835683db2b9 (patch) | |
| tree | fec87fed86ff0151cc2d1cf0d1652364c48f58fd /gnu/system/examples | |
| parent | 204fe1b1f05f4438d1cf72c568b45696e55e54c9 (diff) | |
system: examples: Add bare-hurd64.tmpl.
* gnu/system/examples/bare-hurd.tmpl: Update comments.
* gnu/system/examples/bare-hurd64.tmpl: New file.
Change-Id: I8d26afd19afaa8fb3558948b50b0efdc0f83f29c
Diffstat (limited to 'gnu/system/examples')
| -rw-r--r-- | gnu/system/examples/bare-hurd.tmpl | 21 | ||||
| -rw-r--r-- | gnu/system/examples/bare-hurd64.tmpl | 70 |
2 files changed, 82 insertions, 9 deletions
diff --git a/gnu/system/examples/bare-hurd.tmpl b/gnu/system/examples/bare-hurd.tmpl index 68c6d3c1665..9bfa7767692 100644 --- a/gnu/system/examples/bare-hurd.tmpl +++ b/gnu/system/examples/bare-hurd.tmpl | |||
| @@ -3,23 +3,26 @@ | |||
| 3 | ;; This is an operating system configuration template | 3 | ;; This is an operating system configuration template |
| 4 | ;; for a "bare bones" QEMU 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 | ;; |
| 8 | ;; ./pre-inst-env guix system image --image-type=hurd-raw \ | 8 | ;; ./pre-inst-env guix system image --image-type=hurd-qcow2 \ |
| 9 | ;; gnu/system/examples/bare-hurd.tmpl | 9 | ;; gnu/system/examples/bare-hurd.tmpl |
| 10 | ;; | 10 | ;; |
| 11 | ;; You may run it like so | 11 | ;; You may run it like so: |
| 12 | ;; | 12 | ;; |
| 13 | ;; guix shell qemu -- qemu-system-i386 -enable-kvm -m 2048 \ | 13 | ;; guix shell qemu -- qemu-system-i386 -m 2048 \ |
| 14 | ;; -device rtl8139,netdev=net0 -netdev user,id=net0,hostfwd=tcp:127.0.0.1:10022-:2222 \ | 14 | ;; --enable-kvm \ |
| 15 | ;; -snapshot -hda <the-image> | 15 | ;; --device e1000,netdev=net0 \ |
| 16 | ;; --netdev user,id=net0,hostfwd=tcp:127.0.0.1:10022-:2222 \ | ||
| 17 | ;; --snapshot | ||
| 18 | ;; --hda /gnu/store/...-disk-image | ||
| 16 | ;; | 19 | ;; |
| 17 | ;; and use it like | 20 | ;; and use it like: |
| 18 | ;; | 21 | ;; |
| 19 | ;; ssh -p 10022 root@localhost | 22 | ;; ssh -p 10022 root@localhost |
| 20 | ;; guix build -e '(@@ (gnu packages commencement) gnu-make-boot0)' | 23 | ;; guix build -e '(@@ (gnu packages commencement) gnu-make-boot0)' |
| 21 | ;; | 24 | ;; |
| 22 | ;; or even (if you use --image-size=3G) | 25 | ;; or even, if you build the image with at least --image-size=3G: |
| 23 | ;; | 26 | ;; |
| 24 | ;; guix build hello | 27 | ;; guix build hello |
| 25 | 28 | ||
| @@ -34,7 +37,7 @@ | |||
| 34 | (bootloader grub-minimal-bootloader) | 37 | (bootloader grub-minimal-bootloader) |
| 35 | (targets '("/dev/sdX")))) | 38 | (targets '("/dev/sdX")))) |
| 36 | (file-systems (cons (file-system | 39 | (file-systems (cons (file-system |
| 37 | (device (file-system-label "my-root")) | 40 | (device (file-system-label "hurd")) |
| 38 | (mount-point "/") | 41 | (mount-point "/") |
| 39 | (type "ext2")) | 42 | (type "ext2")) |
| 40 | %base-file-systems)) | 43 | %base-file-systems)) |
diff --git a/gnu/system/examples/bare-hurd64.tmpl b/gnu/system/examples/bare-hurd64.tmpl new file mode 100644 index 00000000000..89811e458af --- /dev/null +++ b/gnu/system/examples/bare-hurd64.tmpl | |||
| @@ -0,0 +1,70 @@ | |||
| 1 | ;; -*-scheme-*- | ||
| 2 | |||
| 3 | ;; This is an operating system configuration template | ||
| 4 | ;; for a "bare bones" QEMU setup, with no X11 display server. | ||
| 5 | |||
| 6 | ;; To build a disk image for a virtual machine, do: | ||
| 7 | ;; | ||
| 8 | ;; ./pre-inst-env guix system image --image-type=hurd64-qcow2 \ | ||
| 9 | ;; gnu/system/examples/bare-hurd64.tmpl | ||
| 10 | ;; | ||
| 11 | ;; You may run it like so: | ||
| 12 | ;; | ||
| 13 | ;; guix shell qemu@7 -- qemu-system-x86_64 -m 2048 \ | ||
| 14 | ;; --machine q35 \ | ||
| 15 | ;; --enable-kvm \ | ||
| 16 | ;; --device e1000,netdev=net0 \ | ||
| 17 | ;; --netdev user,id=net0,hostfwd=tcp:127.0.0.1:10022-:2222 \ | ||
| 18 | ;; --snapshot | ||
| 19 | ;; --hda /gnu/store/...-disk-image | ||
| 20 | ;; | ||
| 21 | ;; and use it like: | ||
| 22 | ;; | ||
| 23 | ;; ssh -p 10022 root@localhost | ||
| 24 | ;; guix build -e '(@@ (gnu packages commencement) gnu-make-boot0)' | ||
| 25 | ;; | ||
| 26 | ;; or even, if you build the image with at least --image-size=3G: | ||
| 27 | ;; | ||
| 28 | ;; guix build hello | ||
| 29 | |||
| 30 | (use-modules (gnu) (gnu system hurd) (guix utils)) | ||
| 31 | (use-service-modules ssh) | ||
| 32 | (use-package-modules ssh) | ||
| 33 | |||
| 34 | (define %hurd64-os | ||
| 35 | (operating-system | ||
| 36 | (inherit %hurd64-default-operating-system) | ||
| 37 | (bootloader (bootloader-configuration | ||
| 38 | (bootloader grub-minimal-bootloader) | ||
| 39 | (targets '("/dev/sdX")))) | ||
| 40 | (kernel-arguments '("noide")) ;use rumpdisk | ||
| 41 | (file-systems (cons (file-system | ||
| 42 | (device (file-system-label "hurd")) | ||
| 43 | (mount-point "/") | ||
| 44 | (type "ext2")) | ||
| 45 | %base-file-systems)) | ||
| 46 | (host-name "guixygnu64") | ||
| 47 | (timezone "Europe/Amsterdam") | ||
| 48 | (users (cons (user-account | ||
| 49 | (name "guix") | ||
| 50 | (comment "Anonymous Hurd Hacker") | ||
| 51 | (group "users") | ||
| 52 | (supplementary-groups '("wheel"))) | ||
| 53 | %base-user-accounts)) | ||
| 54 | (packages (cons openssh-sans-x %base-packages/hurd)) | ||
| 55 | (services (cons (service openssh-service-type | ||
| 56 | (openssh-configuration | ||
| 57 | (openssh openssh-sans-x) | ||
| 58 | (port-number 2222) | ||
| 59 | (permit-root-login #t) | ||
| 60 | (allow-empty-passwords? #t) | ||
| 61 | (password-authentication? #t))) | ||
| 62 | ;; For installing on a real (non-QEMU) machine, use: | ||
| 63 | ;; (static-networking-service-type | ||
| 64 | ;; (list %loopback-static-networking | ||
| 65 | ;; (static-networking | ||
| 66 | ;; ...))) | ||
| 67 | ;; %base-services/hurd | ||
| 68 | %base-services+qemu-networking/hurd)))) | ||
| 69 | |||
| 70 | %hurd64-os | ||
