From c7793b82efd3383a9f7adf0dfa82d71ee032e41b Mon Sep 17 00:00:00 2001 From: Stefan Date: Thu, 1 Dec 2022 13:46:38 -0500 Subject: gnu: raspberry-pi: Add a bootloader-chain for the Raspberry Pi and os examples. * gnu/packages/raspberry-pi.scm (grub-efi-bootloader-chain-raspi-64): New bootloader variable, capable to boot a Raspberry Pi over network or from a local storage. * gnu/system/examples/raspberry-pi-64.tmpl: New operating-system example. * gnu/system/examples/raspberry-pi-64-nfs-root.tmpl: New operating-system example for booting over network. * Makefile.am (EXAMPLES): Register the new files. Signed-off-by: Maxim Cournoyer --- gnu/system/examples/raspberry-pi-64-nfs-root.tmpl | 75 +++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 gnu/system/examples/raspberry-pi-64-nfs-root.tmpl (limited to 'gnu/system/examples/raspberry-pi-64-nfs-root.tmpl') diff --git a/gnu/system/examples/raspberry-pi-64-nfs-root.tmpl b/gnu/system/examples/raspberry-pi-64-nfs-root.tmpl new file mode 100644 index 0000000000..7bcac8ded0 --- /dev/null +++ b/gnu/system/examples/raspberry-pi-64-nfs-root.tmpl @@ -0,0 +1,75 @@ +;; This is an operating-system configuration template of a +;; 64-bit minimal system for a Raspberry Pi with an NFS root file-system. + +;; It neither installs firmware nor device-tree files for the Raspberry Pi. +;; It just assumes them to be existing in boot/efi in the same way that some +;; UEFI firmware with ACPI data is usually assumed to be existing on PCs. + +;; It expects the boot/efi directory to be served via TFTP and the root +;; file-system to be served via NFS. See the grub-efi-netboot-bootloader +;; description in the manual for more details. + +(use-modules (gnu) + (gnu artwork) + (gnu system nss)) +(use-service-modules admin + avahi + networking + ssh) +(use-package-modules certs + linux + raspberry-pi + ssh) + +(define %my-public-key + (local-file (string-append (getenv "HOME") "/.ssh/id_ecdsa.pub"))) + +(define-public raspberry-pi-64-nfs-root + (operating-system + (host-name "raspberrypi-guix") + (timezone "Europe/Berlin") + (bootloader (bootloader-configuration + (bootloader grub-efi-bootloader-chain-raspi-64) + (targets (list "/boot/efi")) + (theme (grub-theme + (resolution '(1920 . 1080)) + (image (file-append + %artwork-repository + "/grub/GuixSD-fully-black-16-9.svg")))))) + (kernel-arguments '("ip=dhcp")) + (kernel (customize-linux #:linux linux-libre-arm64-generic + #:extra-version "arm64-generic-netboot" + #:configs '("CONFIG_NFS_SWAP=y" + "CONFIG_USB_USBNET=y" + "CONFIG_USB_LAN78XX=y" + "CONFIG_USB_NET_SMSC95XX=y"))) + (initrd-modules '()) + (file-systems (cons* (file-system + (mount-point "/") + (type "nfs") + (device ":/export/raspberrypi/guix") + (options "addr=10.20.30.40,vers=4.1")) + %base-file-systems)) + (swap-devices (list (swap-space + (target "/run/swapfile")))) + (users (cons* (user-account + (name "pi") + (group "users") + (supplementary-groups '("wheel" "netdev" "audio" "video")) + (home-directory "/home/pi")) + %base-user-accounts)) + (packages (cons* nss-certs + openssh + %base-packages)) + (services (cons* (service avahi-service-type) + (service dhcp-client-service-type) + (service ntp-service-type) + (service openssh-service-type + (openssh-configuration + (x11-forwarding? #t) + (authorized-keys + `(("pi" ,%my-public-key))))) + %base-services)) + (name-service-switch %mdns-host-lookup-nss))) + +raspberry-pi-64-nfs-root -- cgit v1.2.3 From 08dc9f2ca2e96476aa51c906c8ba01ca5d033568 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Sun, 4 Dec 2022 00:37:11 -0500 Subject: gnu: Do not use 'local-file' in Raspberry Pi OS examples. As this breaks the 'tests/guix-system.sh' test. * gnu/system/examples/raspberry-pi-64-nfs-root.tmpl (%my-public-key): Delete variable. (raspberry-pi-64-nfs-root) [services]: Remove key from openssh-configuration. * gnu/system/examples/raspberry-pi-64.tmpl: Likewise. Reported-by: Vagrant Cascadian --- gnu/system/examples/raspberry-pi-64-nfs-root.tmpl | 7 +------ gnu/system/examples/raspberry-pi-64.tmpl | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) (limited to 'gnu/system/examples/raspberry-pi-64-nfs-root.tmpl') diff --git a/gnu/system/examples/raspberry-pi-64-nfs-root.tmpl b/gnu/system/examples/raspberry-pi-64-nfs-root.tmpl index 7bcac8ded0..8c47c650f6 100644 --- a/gnu/system/examples/raspberry-pi-64-nfs-root.tmpl +++ b/gnu/system/examples/raspberry-pi-64-nfs-root.tmpl @@ -21,9 +21,6 @@ raspberry-pi ssh) -(define %my-public-key - (local-file (string-append (getenv "HOME") "/.ssh/id_ecdsa.pub"))) - (define-public raspberry-pi-64-nfs-root (operating-system (host-name "raspberrypi-guix") @@ -66,9 +63,7 @@ (service ntp-service-type) (service openssh-service-type (openssh-configuration - (x11-forwarding? #t) - (authorized-keys - `(("pi" ,%my-public-key))))) + (x11-forwarding? #t))) %base-services)) (name-service-switch %mdns-host-lookup-nss))) diff --git a/gnu/system/examples/raspberry-pi-64.tmpl b/gnu/system/examples/raspberry-pi-64.tmpl index 7d2638dd80..3ad588207c 100644 --- a/gnu/system/examples/raspberry-pi-64.tmpl +++ b/gnu/system/examples/raspberry-pi-64.tmpl @@ -20,9 +20,6 @@ raspberry-pi ssh) -(define %my-public-key - (local-file (string-append (getenv "HOME") "/.ssh/id_ecdsa.pub"))) - (define-public raspberry-pi-64 (operating-system (host-name "raspberrypi-guix") @@ -70,9 +67,7 @@ (service ntp-service-type) (service openssh-service-type (openssh-configuration - (x11-forwarding? #t) - (authorized-keys - `(("pi" ,%my-public-key))))) + (x11-forwarding? #t))) %base-services)) (name-service-switch %mdns-host-lookup-nss))) -- cgit v1.2.3 From 491bddfa276cc9775adf325c07e5f82638f330e7 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Thu, 15 Dec 2022 13:39:35 -0500 Subject: system: examples: Add mode prop line. * gnu/system/examples/asus-c201.tmpl: Add a mode prop line. * gnu/system/examples/bare-bones.tmpl: Likewise. * gnu/system/examples/beaglebone-black.tmpl: Likewise. * gnu/system/examples/desktop.tmpl: Likewise. * gnu/system/examples/docker-image.tmpl: Likewise. * gnu/system/examples/lightweight-desktop.tmpl: Likewise. * gnu/system/examples/raspberry-pi-64-nfs-root.tmpl: Likewise. * gnu/system/examples/raspberry-pi-64.tmpl: Likewise. * gnu/system/examples/vm-image.tmpl: Likewise. --- gnu/system/examples/asus-c201.tmpl | 1 + gnu/system/examples/bare-bones.tmpl | 1 + gnu/system/examples/beaglebone-black.tmpl | 1 + gnu/system/examples/desktop.tmpl | 1 + gnu/system/examples/docker-image.tmpl | 1 + gnu/system/examples/lightweight-desktop.tmpl | 1 + gnu/system/examples/raspberry-pi-64-nfs-root.tmpl | 1 + gnu/system/examples/raspberry-pi-64.tmpl | 1 + gnu/system/examples/vm-image.tmpl | 1 + 9 files changed, 9 insertions(+) (limited to 'gnu/system/examples/raspberry-pi-64-nfs-root.tmpl') diff --git a/gnu/system/examples/asus-c201.tmpl b/gnu/system/examples/asus-c201.tmpl index 6b6aa706fa..019111c167 100644 --- a/gnu/system/examples/asus-c201.tmpl +++ b/gnu/system/examples/asus-c201.tmpl @@ -1,3 +1,4 @@ +;; -*- mode: scheme; -*- ;; This is an operating system configuration template ;; for a "bare bones" setup for an ASUS C201PA. diff --git a/gnu/system/examples/bare-bones.tmpl b/gnu/system/examples/bare-bones.tmpl index 687d4c1573..45b4995574 100644 --- a/gnu/system/examples/bare-bones.tmpl +++ b/gnu/system/examples/bare-bones.tmpl @@ -1,3 +1,4 @@ +;; -*- mode: scheme; -*- ;; This is an operating system configuration template ;; for a "bare bones" setup, with no X11 display server. diff --git a/gnu/system/examples/beaglebone-black.tmpl b/gnu/system/examples/beaglebone-black.tmpl index 90dab62062..40d0a76a37 100644 --- a/gnu/system/examples/beaglebone-black.tmpl +++ b/gnu/system/examples/beaglebone-black.tmpl @@ -1,3 +1,4 @@ +;; -*- mode: scheme; -*- ;; This is an operating system configuration template ;; for a "bare bones" setup on BeagleBone Black board. diff --git a/gnu/system/examples/desktop.tmpl b/gnu/system/examples/desktop.tmpl index 7055a8f92d..10d0e54fa7 100644 --- a/gnu/system/examples/desktop.tmpl +++ b/gnu/system/examples/desktop.tmpl @@ -1,3 +1,4 @@ +;; -*- mode: scheme; -*- ;; This is an operating system configuration template ;; for a "desktop" setup with GNOME and Xfce where the ;; root partition is encrypted with LUKS, and a swap file. diff --git a/gnu/system/examples/docker-image.tmpl b/gnu/system/examples/docker-image.tmpl index bdc6afa6f0..7123917af4 100644 --- a/gnu/system/examples/docker-image.tmpl +++ b/gnu/system/examples/docker-image.tmpl @@ -1,3 +1,4 @@ +;; -*- mode: scheme; -*- ;; This is an operating system configuration template for a "Docker image" ;; setup, so it has barely any services at all. diff --git a/gnu/system/examples/lightweight-desktop.tmpl b/gnu/system/examples/lightweight-desktop.tmpl index d4330ecc8e..4cb3c38311 100644 --- a/gnu/system/examples/lightweight-desktop.tmpl +++ b/gnu/system/examples/lightweight-desktop.tmpl @@ -1,3 +1,4 @@ +;; -*- mode: scheme; -*- ;; This is an operating system configuration template ;; for a "desktop" setup without full-blown desktop ;; environments. diff --git a/gnu/system/examples/raspberry-pi-64-nfs-root.tmpl b/gnu/system/examples/raspberry-pi-64-nfs-root.tmpl index 8c47c650f6..2203375270 100644 --- a/gnu/system/examples/raspberry-pi-64-nfs-root.tmpl +++ b/gnu/system/examples/raspberry-pi-64-nfs-root.tmpl @@ -1,3 +1,4 @@ +;; -*- mode: scheme; -*- ;; This is an operating-system configuration template of a ;; 64-bit minimal system for a Raspberry Pi with an NFS root file-system. diff --git a/gnu/system/examples/raspberry-pi-64.tmpl b/gnu/system/examples/raspberry-pi-64.tmpl index 3ad588207c..185d25c412 100644 --- a/gnu/system/examples/raspberry-pi-64.tmpl +++ b/gnu/system/examples/raspberry-pi-64.tmpl @@ -1,3 +1,4 @@ +;; -*- mode: scheme; -*- ;; This is an operating-system configuration template of a ;; 64-bit minimal system for a Raspberry Pi with local storage. diff --git a/gnu/system/examples/vm-image.tmpl b/gnu/system/examples/vm-image.tmpl index d46a27978c..343287eaf6 100644 --- a/gnu/system/examples/vm-image.tmpl +++ b/gnu/system/examples/vm-image.tmpl @@ -1,3 +1,4 @@ +;; -*- mode: scheme; -*- ;; This is an operating system configuration for a VM image. ;; Modify it as you see fit and instantiate the changes by running: ;; -- cgit v1.2.3