From aeecd06ab9f748b0b40573e5520ea6c642060e12 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Mon, 28 Nov 2022 13:57:58 -0500 Subject: system: Rename and move %base-packages-disk-utilities. Rationale: It is only used in INSTALLATION-OS and doesn't make sense to be used in another context, given that file systems now automatically pull their dependencies since commit 45eac6cdf5c8d9d7b0c564b105c790d2d2007799 (services: Add file system utilities to profile). * gnu/system.scm (%base-packages-disk-utilities): Deprecate and rename to... * gnu/system/install.scm (%installer-disk-utilities): ... this. (installation-os) [packages]: Adjust accordingly. --- gnu/system/install.scm | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'gnu/system') diff --git a/gnu/system/install.scm b/gnu/system/install.scm index 003c49a3e7..d34d974338 100644 --- a/gnu/system/install.scm +++ b/gnu/system/install.scm @@ -48,6 +48,9 @@ (define-module (gnu system install) #:use-module (gnu packages bootloaders) #:use-module (gnu packages certs) #:use-module (gnu packages compression) + #:use-module (gnu packages cryptsetup) + #:use-module (gnu packages disk) + #:use-module (gnu packages file-systems) #:use-module (gnu packages fonts) #:use-module (gnu packages fontutils) #:use-module (gnu packages guile) @@ -458,6 +461,20 @@ (define %issue \x1b[1;33mUse Alt-F2 for documentation.\x1b[0m ") +(define %installer-disk-utilities + ;; A well-rounded set of packages for interacting with disks, partitions and + ;; file systems, included with the Guix installation image. + (list parted gptfdisk ddrescue + ;; We used to provide fdisk from GNU fdisk, but as of version 2.0.0a + ;; it pulls Guile 1.8, which takes unreasonable space; furthermore + ;; util-linux's fdisk is already available, in %base-packages-linux. + cryptsetup mdadm + dosfstools + btrfs-progs + f2fs-tools + jfsutils + xfsprogs)) + (define installation-os ;; The operating system used on installation images for USB sticks etc. (operating-system @@ -530,7 +547,7 @@ (define installation-os font-dejavu font-gnu-unifont grub ; mostly so xrefs to its manual work nss-certs) ; To access HTTPS, use git, etc. - %base-packages-disk-utilities + %installer-disk-utilities %base-packages)))) (define* (os-with-u-boot os board #:key (bootloader-target "/dev/mmcblk0") -- cgit v1.2.3 From ba4aed0f1feff98559e5712bf11190be78e2aadc Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Mon, 28 Nov 2022 14:03:58 -0500 Subject: install: Add missing e2fsprogs utility. * gnu/system/install.scm (%installer-disk-utilities): Add e2fsprogs. Reported-by: Adam Kandur --- gnu/system/install.scm | 1 + 1 file changed, 1 insertion(+) (limited to 'gnu/system') diff --git a/gnu/system/install.scm b/gnu/system/install.scm index d34d974338..f6f1923121 100644 --- a/gnu/system/install.scm +++ b/gnu/system/install.scm @@ -471,6 +471,7 @@ (define %installer-disk-utilities cryptsetup mdadm dosfstools btrfs-progs + e2fsprogs f2fs-tools jfsutils xfsprogs)) -- cgit v1.2.3 From f59aa79ca342ef311a20dafc782adea6eed29b1a Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 6 Dec 2022 15:06:35 +0100 Subject: system: vm: Non-volatile 'run-vm.sh' creates a CoW image. Previously, copying the image would consume a lot of space and was I/O-intensive, to the point that the marionette connection timeout of 20s could be reached when running tests like "docker-system". * gnu/system/vm.scm (common-qemu-options): Pass 'format=' for each '-drive' option. (system-qemu-image/shared-store-script)[copy-image]: New variable. [builder]: Use it when VOLATILE? is false. --- gnu/system/vm.scm | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'gnu/system') diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index c2f7efa966..b7bccd72a4 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès +;;; Copyright © 2013-2022 Ludovic Courtès ;;; Copyright © 2016 Christine Lemmer-Webber ;;; Copyright © 2016, 2017 Leo Famulari ;;; Copyright © 2017 Mathieu Othacehe @@ -234,8 +234,8 @@ (define (virtfs-option fs) #$@(map virtfs-option shared-fs) #$@(if rw-image? - #~((format #f "-drive file=~a,if=virtio" #$image)) - #~((format #f "-drive file=~a,if=virtio,cache=writeback,werror=report,readonly=on" + #~((format #f "-drive file=~a,format=qcow2,if=virtio" #$image)) + #~((format #f "-drive file=~a,format=raw,if=virtio,cache=writeback,werror=report,readonly=on" #$image))))) (define* (system-qemu-image/shared-store-script os @@ -303,17 +303,26 @@ (define qemu-exec "-m " (number->string #$memory-size) #$@options)) + (define copy-image + ;; Script that "copies" BASE-IMAGE to /tmp. Make a copy-on-write image, + ;; which is much cheaper than actually copying it. + (program-file "copy-image" + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + (unless (file-exists? #$rw-image) + (invoke #+(file-append qemu "/bin/qemu-img") + "create" "-b" #$base-image + "-F" "raw" "-f" "qcow2" #$rw-image)))))) + (define builder #~(call-with-output-file #$output (lambda (port) (format port "#!~a~%" #+(file-append bash "/bin/sh")) - (when (not #$volatile?) - (format port "~a~%" - #$(program-file "copy-image" - #~(unless (file-exists? #$rw-image) - (copy-file #$base-image #$rw-image) - (chmod #$rw-image #o640))))) + #$@(if volatile? + #~() + #~((format port "~a~%" #+copy-image))) (format port "exec ~a \"$@\"~%" (string-join #$qemu-exec " ")) (chmod port #o555)))) -- cgit v1.2.3 From 9ad14196ce48d5161fcaa7fc5fd26259e517cb30 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 6 Dec 2022 15:11:44 +0100 Subject: image: Clarify comment. * gnu/system/image.scm: Adjust comment. --- gnu/system/image.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gnu/system') diff --git a/gnu/system/image.scm b/gnu/system/image.scm index f07a4a5217..d518a05a51 100644 --- a/gnu/system/image.scm +++ b/gnu/system/image.scm @@ -972,9 +972,9 @@ (define target (cond (G_ "~a: unsupported image format") image-format))))))) -;; -;; Image detection. -;; +;;; +;;; Image type discovery. +;;; (define (image-modules) "Return the list of image modules." -- cgit v1.2.3 From 755c4b496e24f2df5f1b0f4a3873e9e00bae1fdc Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 9 Dec 2022 16:40:53 +0100 Subject: system: Remove unused yggdrasil OS template. This file was added in fe1cd098d2b83737e96f19438612291f5a9316e4 but it's not referenced from anywhere, not even gnu/local.mk. Furthermore, we don't normally add full OS examples for the purposes of illustrating the use of a single service. * gnu/system/examples/yggdrasil.tmpl: Remove. --- gnu/system/examples/yggdrasil.tmpl | 60 -------------------------------------- 1 file changed, 60 deletions(-) delete mode 100644 gnu/system/examples/yggdrasil.tmpl (limited to 'gnu/system') diff --git a/gnu/system/examples/yggdrasil.tmpl b/gnu/system/examples/yggdrasil.tmpl deleted file mode 100644 index 4d34f49b54..0000000000 --- a/gnu/system/examples/yggdrasil.tmpl +++ /dev/null @@ -1,60 +0,0 @@ -;; This is an operating system configuration template -;; for a "bare bones" setup, with no X11 display server. - -(use-modules (gnu)) -(use-service-modules networking ssh) -(use-package-modules admin curl networking screen) - -(operating-system - (host-name "ruby-guard-5545") - (timezone "Europe/Budapest") - (locale "en_US.utf8") - - ;; Boot in "legacy" BIOS mode, assuming /dev/sdX is the - ;; target hard disk, and "my-root" is the label of the target - ;; root file system. - (bootloader (bootloader-configuration - (bootloader grub-bootloader) - (targets '("/dev/sdX")))) - (file-systems (cons (file-system - (device (file-system-label "my-root")) - (mount-point "/") - (type "ext4")) - %base-file-systems)) - (users (cons (user-account - (name "alice") - (comment "Bob's sister") - (group "users") - ;; adding her to the yggdrasil group means she can use - ;; yggdrasilctl to modify the configuration - (supplementary-groups '("wheel" "yggdrasil"))) - %base-user-accounts)) - - ;; Globally-installed packages. - (packages (cons* screen curl %base-packages)) - - ;; Add services to the baseline: a DHCP client and - ;; an SSH server. - ;; If you add an /etc/yggdrasil-private.conf, you can log in to ssh - ;; using your Yggdrasil IPv6 address from another machine running Yggdrasil. - ;; Alternatively, the client can sit behind a router that has Yggdrasil. - ;; That file is specifically _not_ handled by Guix, because we don't want its - ;; contents to sit in the world-readable /gnu/store. - (services - (append - (list - (service dhcp-client-service-type) - (service yggdrasil-service-type - (yggdrasil-configuration - (log-to 'stdout) - (log-level 'debug) - (autoconf? #f) - (json-config - ;; choose a few from - ;; https://github.com/yggdrasil-network/public-peers - '((peers . #("tcp://1.2.3.4:1337")))) - (config-file #f))) - (service openssh-service-type - (openssh-configuration - (port-number 2222)))) - %base-services))) -- cgit v1.2.3