From dfc8ccbf5da96a67eb1cade499f0def21e7fdb02 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Tue, 31 Dec 2019 09:56:51 +0100 Subject: system: Stop using canonical-package. Usage of canonical-package outside of thunked fields breaks cross-compilation, see: https://lists.gnu.org/archive/html/guix-devel/2019-12/msg00410.html. * gnu/installer.scm (installer-program): Remove canonical-package. * gnu/services/base.scm (): Ditto, (%base-services): ditto. * gnu/services/xorg.scm: Remove useless canonical-package import. * gnu/system.scm (%base-packages): Remove canonical-package. * gnu/system/install.scm (%installation-services): Ditto, (installation-os): ditto. * gnu/system/locale.scm (single-locale-directory): Ditto. --- gnu/system/install.scm | 7 +++---- gnu/system/locale.scm | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'gnu/system') diff --git a/gnu/system/install.scm b/gnu/system/install.scm index c15c2c7814..0dc26b2871 100644 --- a/gnu/system/install.scm +++ b/gnu/system/install.scm @@ -384,8 +384,7 @@ Access documentation at any time by pressing Alt-F2.\x1b[0m ;; Having /bin/sh is a good idea. In particular it allows Tramp ;; connections to this system to work. (service special-files-service-type - `(("/bin/sh" ,(file-append (canonical-package bash) - "/bin/sh")))) + `(("/bin/sh" ,(file-append bash "/bin/sh")))) ;; Loopback device, needed by OpenSSH notably. (service static-networking-service-type @@ -408,7 +407,7 @@ Access documentation at any time by pressing Alt-F2.\x1b[0m (list bare-bones-os glibc-utf8-locales texinfo - (canonical-package guile-2.2)))))) + guile-2.2))))) (define %issue ;; Greeting. @@ -480,7 +479,7 @@ Access documentation at any time by pressing Alt-F2.\x1b[0m ;; Explicitly allow for empty passwords. (base-pam-services #:allow-empty-passwords? #t)) - (packages (cons* (canonical-package glibc) ;for 'tzselect' & co. + (packages (cons* glibc ;for 'tzselect' & co. parted gptfdisk ddrescue fontconfig font-dejavu font-gnu-unifont diff --git a/gnu/system/locale.scm b/gnu/system/locale.scm index 8466d5b07d..5baf80622c 100644 --- a/gnu/system/locale.scm +++ b/gnu/system/locale.scm @@ -86,7 +86,7 @@ or #f on failure." #f))) (define* (single-locale-directory locales - #:key (libc (canonical-package glibc))) + #:key (libc glibc)) "Return a directory containing all of LOCALES for LIBC compiled. Because locale data formats are incompatible when switching from one libc to -- cgit 1.4.1 From f30d84d32db0f4f6cb84e139868e1727a7dc0a51 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Wed, 12 Feb 2020 11:07:49 +0100 Subject: system: locale: Remove canonical-package call. This is a follow-up of dfc8ccbf5da96a67eb1cade499f0def21e7fdb02. Building locales using the same glibc as the one programs are linked against is enough. * gnu/system/locale.scm (%default-locale-libcs): Use the plain glibc package. --- gnu/system/locale.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnu/system') diff --git a/gnu/system/locale.scm b/gnu/system/locale.scm index 5baf80622c..c7a371e9bf 100644 --- a/gnu/system/locale.scm +++ b/gnu/system/locale.scm @@ -147,7 +147,7 @@ data format changes between libc versions." (define %default-locale-libcs ;; The libcs for which we build locales by default. - (list (canonical-package glibc))) + (list glibc)) (define %default-locale-definitions ;; Arbitrary set of locales that are built by default. They are here mostly -- cgit 1.4.1 From 82782d8cecec974c03ec95824f62455f0a795815 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 1 Apr 2020 15:03:10 +0200 Subject: vm: 'qemu-image' accepts a list of extra populate directives. * gnu/build/vm.scm (root-partition-initializer): Add #:extra-directives parameter and pass it to 'populate-root-file-system'. * gnu/system/vm.scm (qemu-image): Add #:extra-directives parameter and pass it to 'root-partition-initializer'. --- gnu/build/vm.scm | 11 ++++++++--- gnu/system/vm.scm | 7 ++++++- 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'gnu/system') diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm index 9caa110463..dfb1465fd5 100644 --- a/gnu/build/vm.scm +++ b/gnu/build/vm.scm @@ -363,14 +363,18 @@ it, run its initializer, and unmount it." copy-closures? (register-closures? #t) system-directory - (deduplicate? #t)) + (deduplicate? #t) + (extra-directives '())) "Return a procedure to initialize a root partition. If REGISTER-CLOSURES? is true, register all of CLOSURES in the partition's store. If DEDUPLICATE? is true, then also deduplicate files common to CLOSURES and the rest of the store when registering the closures. If COPY-CLOSURES? is true, copy all of CLOSURES to the partition. -SYSTEM-DIRECTORY is the name of the directory of the 'system' derivation." +SYSTEM-DIRECTORY is the name of the directory of the 'system' derivation. + +EXTRA-DIRECTIVES is an optional list of directives to populate the root file +system that is passed to 'populate-root-file-system'." (lambda (target) (define target-store (string-append target (%store-directory))) @@ -403,7 +407,8 @@ SYSTEM-DIRECTORY is the name of the directory of the 'system' derivation." ;; Add the non-store directories and files. (display "populating...\n") - (populate-root-file-system system-directory target) + (populate-root-file-system system-directory target + #:extras extra-directives) ;; 'register-closure' resets timestamps and everything, so no need to do it ;; once more in that case. diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index 04d84b5220..8baed372cb 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -368,6 +368,7 @@ INPUTS is a list of inputs (as for packages)." (disk-image-size 'guess) (disk-image-format "qcow2") (file-system-type "ext4") + (extra-directives '()) file-system-label file-system-uuid os @@ -392,7 +393,10 @@ all of INPUTS into the image being built. When REGISTER-CLOSURES? is true, register INPUTS in the store database of the image so that Guix can be used in the image. By default, REGISTER-CLOSURES? is set to true only if a service of type GUIX-SERVICE-TYPE is present in the services definition of the operating -system." +system. + +EXTRA-DIRECTIVES is an optional list of directives to populate the root file +system that is passed to 'populate-root-file-system'." (define schema (and register-closures? (local-file (search-path %load-path @@ -441,6 +445,7 @@ system." (((names . _) ...) names))) (initialize (root-partition-initializer + #:extra-directives '#$extra-directives #:closures graphs #:copy-closures? #$copy-inputs? #:register-closures? #$register-closures? -- cgit 1.4.1 From 4d1ff68d731fdc47ca1220863fee07a685a26616 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 1 Apr 2020 15:08:11 +0200 Subject: vm: 'qemu-image' can pass options to the 'mkfs' command. * gnu/build/vm.scm ()[file-system-options]: New field. (create-ext-file-system, create-fat-file-system) (format-partition): Add #:options and honor it. (initialize-partition): Pass #:options to 'format-partition'. * gnu/system/vm.scm (qemu-image): Add #:file-system-options and use it for the root partition. --- gnu/build/vm.scm | 24 +++++++++++++++--------- gnu/system/vm.scm | 5 ++++- 2 files changed, 19 insertions(+), 10 deletions(-) (limited to 'gnu/system') diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm index dfb1465fd5..63140f1cee 100644 --- a/gnu/build/vm.scm +++ b/gnu/build/vm.scm @@ -234,6 +234,8 @@ deduplicates files common to CLOSURE and the rest of PREFIX." (device partition-device (default #f)) (size partition-size) (file-system partition-file-system (default "ext4")) + (file-system-options partition-file-system-options ;passed to 'mkfs.FS' + (default '())) (label partition-label (default #f)) (uuid partition-uuid (default #f)) (flags partition-flags (default '())) @@ -308,7 +310,7 @@ actual /dev name based on DEVICE." (define MS_BIND 4096) ; again! (define* (create-ext-file-system partition type - #:key label uuid) + #:key label uuid (options '())) "Create an ext-family file system of TYPE on PARTITION. If LABEL is true, use that as the volume name. If UUID is true, use it as the partition UUID." (format #t "creating ~a partition... ~@[label: ~s~] ~@[uuid: ~s~]\n" @@ -320,26 +322,29 @@ use that as the volume name. If UUID is true, use it as the partition UUID." '()) ,@(if uuid `("-U" ,(uuid->string uuid)) - '())))) + '()) + ,@options))) (define* (create-fat-file-system partition - #:key label uuid) + #:key label uuid (options '())) "Create a FAT file system on PARTITION. The number of File Allocation Tables will be determined based on file system size. If LABEL is true, use that as the volume name." ;; FIXME: UUID is ignored! (format #t "creating FAT partition...\n") (apply invoke "mkfs.fat" partition - (if label `("-n" ,label) '()))) + (append (if label `("-n" ,label) '()) options))) (define* (format-partition partition type - #:key label uuid) + #:key label uuid (options '())) "Create a file system TYPE on PARTITION. If LABEL is true, use that as the -volume name." +volume name. Options is a list of command-line options passed to 'mkfs.FS'." (cond ((string-prefix? "ext" type) - (create-ext-file-system partition type #:label label #:uuid uuid)) + (create-ext-file-system partition type #:label label #:uuid uuid + #:options options)) ((or (string-prefix? "fat" type) (string= "vfat" type)) - (create-fat-file-system partition #:label label #:uuid uuid)) + (create-fat-file-system partition #:label label #:uuid uuid + #:options options)) (else (error "Unsupported file system.")))) (define (initialize-partition partition) @@ -349,7 +354,8 @@ it, run its initializer, and unmount it." (format-partition (partition-device partition) (partition-file-system partition) #:label (partition-label partition) - #:uuid (partition-uuid partition)) + #:uuid (partition-uuid partition) + #:options (partition-file-system-options partition)) (mkdir-p target) (mount (partition-device partition) target (partition-file-system partition)) diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index 8baed372cb..65e96d42ee 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -368,6 +368,7 @@ INPUTS is a list of inputs (as for packages)." (disk-image-size 'guess) (disk-image-format "qcow2") (file-system-type "ext4") + (file-system-options '()) (extra-directives '()) file-system-label file-system-uuid @@ -382,7 +383,8 @@ INPUTS is a list of inputs (as for packages)." 'qcow2' or 'raw'), with a root partition of type FILE-SYSTEM-TYPE. Optionally, FILE-SYSTEM-LABEL can be specified as the volume name for the root partition; likewise FILE-SYSTEM-UUID, if true, specifies the UUID of the root -partition (a UUID object). +partition (a UUID object). FILE-SYSTEM-OPTIONS is an optional list of +command-line options passed to 'mkfs.ext4' (or similar). The returned image is a full disk image that runs OS-DERIVATION, with a GRUB installation that uses GRUB-CONFIGURATION as its configuration @@ -472,6 +474,7 @@ system that is passed to 'populate-root-file-system'." (uuid #$(and=> file-system-uuid uuid-bytevector)) (file-system #$file-system-type) + (file-system-options '#$file-system-options) (flags '(boot)) (initializer initialize))) ;; Append a small EFI System Partition for use with UEFI -- cgit 1.4.1 From cd45d656f1e8746fadacfbffd5740d22228c4c21 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 7 Apr 2020 10:21:48 +0200 Subject: vm: Make the device node procedure a parameter. * gnu/build/vm.scm (root-partition-initializer): Add #:make-device-nodes parameter and use it. * gnu/system/vm.scm (qemu-image): Add #:device-node parameter. Pass #:make-device-nodes to 'root-partition-initializer'. --- gnu/build/vm.scm | 4 +++- gnu/system/vm.scm | 12 ++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'gnu/system') diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm index c062ab5c71..d2bf7418fd 100644 --- a/gnu/build/vm.scm +++ b/gnu/build/vm.scm @@ -371,6 +371,8 @@ it, run its initializer, and unmount it." (register-closures? #t) system-directory (deduplicate? #t) + (make-device-nodes + make-essential-device-nodes) (extra-directives '())) "Return a procedure to initialize a root partition. @@ -392,7 +394,7 @@ system that is passed to 'populate-root-file-system'." target)) ;; Populate /dev. - (make-essential-device-nodes target) + (make-device-nodes target) ;; Optionally, register the inputs in the image's store. (when register-closures? diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index 65e96d42ee..e8c2f6e162 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -369,6 +369,7 @@ INPUTS is a list of inputs (as for packages)." (disk-image-format "qcow2") (file-system-type "ext4") (file-system-options '()) + (device-nodes 'linux) (extra-directives '()) file-system-label file-system-uuid @@ -397,6 +398,9 @@ the image. By default, REGISTER-CLOSURES? is set to true only if a service of type GUIX-SERVICE-TYPE is present in the services definition of the operating system. +When DEVICE-NODES is 'linux, create Linux-device block and character devices +under /dev. When it is 'hurd, do Hurdish things. + EXTRA-DIRECTIVES is an optional list of directives to populate the root file system that is passed to 'populate-root-file-system'." (define schema @@ -416,6 +420,9 @@ system that is passed to 'populate-root-file-system'." #~(begin (use-modules (gnu build bootloader) (gnu build vm) + ((gnu build linux-boot) + #:select (make-essential-device-nodes + make-hurd-device-nodes)) (guix store database) (guix build utils) (srfi srfi-26) @@ -453,6 +460,11 @@ system that is passed to 'populate-root-file-system'." #:register-closures? #$register-closures? #:system-directory #$os + #:make-device-nodes + #$(match device-nodes + ('linux #~make-essential-device-nodes) + ('hurd #~make-hurd-device-nodes)) + ;; Disable deduplication to speed things up, ;; and because it doesn't help much for a ;; single system generation. -- cgit 1.4.1 From a9f7993ea719c5368ee3e64b813b169eece4e6a1 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 1 Apr 2020 16:18:23 +0200 Subject: Add (gnu system hurd). * gnu/system/hurd.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. --- gnu/local.mk | 1 + gnu/system/hurd.scm | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 113 insertions(+) create mode 100644 gnu/system/hurd.scm (limited to 'gnu/system') diff --git a/gnu/local.mk b/gnu/local.mk index 8303fdca7f..120359f0de 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -598,6 +598,7 @@ GNU_SYSTEM_MODULES = \ %D%/system.scm \ %D%/system/accounts.scm \ %D%/system/file-systems.scm \ + %D%/system/hurd.scm \ %D%/system/install.scm \ %D%/system/keyboard.scm \ %D%/system/linux-container.scm \ diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm new file mode 100644 index 0000000000..0728ce8603 --- /dev/null +++ b/gnu/system/hurd.scm @@ -0,0 +1,112 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2020 Ludovic Courtès +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu system hurd) + #:use-module (guix gexp) + #:use-module (guix utils) + #:use-module (gnu bootloader grub) + #:use-module (gnu packages base) + #:use-module (gnu packages cross-base) + #:use-module (gnu packages hurd) + #:use-module (gnu system vm) + #:export (cross-hurd-image)) + +;;; Commentary: +;;; +;;; This module provides tools to (cross-)build GNU/Hurd virtual machine +;;; images. +;;; +;;; Code: + +(define* (cross-hurd-image #:key (hurd hurd) (gnumach gnumach)) + "Return a cross-built GNU/Hurd image." + (define hurd-os + (let-syntax ((for-hurd (syntax-rules () + ((_ things ...) + (list (with-parameters ((%current-target-system + "i586-pc-gnu")) + things) ...))))) + (directory-union "gnu+hurd" + (cons (with-parameters ((%current-system "i686-linux")) + gnumach) + (for-hurd hurd coreutils grep sed))))) + + (define grub.cfg + (let ((hurd (with-parameters ((%current-target-system "i586-pc-gnu")) + hurd)) + (mach (with-parameters ((%current-system "i686-linux")) + gnumach)) + (libc (cross-libc "i586-pc-gnu"))) + (computed-file "grub.cfg" + #~(call-with-output-file #$output + (lambda (port) + (format port " +set timeout=2 +search.file ~a/boot/gnumach + +menuentry \"GNU\" { + multiboot ~a/boot/gnumach root=device:hd0s1 + module ~a/hurd/ext2fs.static ext2fs \\ + --multiboot-command-line='${kernel-command-line}' \\ + --host-priv-port='${host-port}' \\ + --device-master-port='${device-port}' \\ + --exec-server-task='${exec-task}' -T typed '${root}' \\ + '$(task-create)' '$(task-resume)' + module ~a/lib/ld.so.1 exec ~a/hurd/exec '$(exec-task=task-create)' +}\n" + #+mach #+mach #+hurd + #+libc #+hurd)))))) + + (define hurd-directives + `((directory "/servers") + ,@(map (lambda (server) + `(file ,(string-append "/servers/" server))) + '("startup" "exec" "proc" "password" + "default-pager" "crash-dump-core" + "kill" "suspend")) + ("/servers/crash" -> "crash-dump-core") + (directory "/servers/socket") + (file "/servers/socket/1") + (file "/servers/socket/2") + (file "/servers/socket/16") + ("/servers/socket/local" -> "1") + ("/servers/socket/inet" -> "2") + ("/servers/socket/inet6" -> "16") + (file "/etc/resolv.conf" + "nameserver 10.0.2.3\n") + (directory "/boot") + ("/boot/grub.cfg" -> ,grub.cfg) ;XXX: not strictly needed + ("/hurd" -> ,(file-append (with-parameters ((%current-target-system + "i586-pc-gnu")) + hurd) + "/hurd")))) + + (qemu-image #:file-system-type "ext2" + #:file-system-options '("-o" "hurd") + #:device-nodes 'hurd + #:inputs `(("system" ,hurd-os) + ("grub.cfg" ,grub.cfg)) + #:copy-inputs? #t + #:os hurd-os + #:bootcfg-drv grub.cfg + #:bootloader grub-bootloader + #:register-closures? #f + #:extra-directives hurd-directives)) + +;; Return this thunk so one can type "guix build -f gnu/system/hurd.scm". +cross-hurd-image -- cgit 1.4.1 From 379d0f51841f808d456b885824b50949d0939bd9 Mon Sep 17 00:00:00 2001 From: "Jan (janneke) Nieuwenhuizen" Date: Sun, 5 Apr 2020 08:39:20 +0200 Subject: system: hurd: Add "/etc/fstab". This allows running mount -o remount,rw / successfully. * gnu/system/hurd.scm (cross-hurd-image): Create a hard coded fstab and add it to hurd-os. --- gnu/system/hurd.scm | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'gnu/system') diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm index 0728ce8603..03c49d472f 100644 --- a/gnu/system/hurd.scm +++ b/gnu/system/hurd.scm @@ -72,6 +72,14 @@ menuentry \"GNU\" { #+mach #+mach #+hurd #+libc #+hurd)))))) + (define fstab + (plain-file "fstab" +"# This file was generated from your Guix configuration. Any changes +# will be lost upon reboot or reconfiguration. + +/dev/hd0s1 / ext2 defaults +")) + (define hurd-directives `((directory "/servers") ,@(map (lambda (server) @@ -94,13 +102,15 @@ menuentry \"GNU\" { ("/hurd" -> ,(file-append (with-parameters ((%current-target-system "i586-pc-gnu")) hurd) - "/hurd")))) + "/hurd")) + ("/etc/fstab" -> ,fstab))) (qemu-image #:file-system-type "ext2" #:file-system-options '("-o" "hurd") #:device-nodes 'hurd #:inputs `(("system" ,hurd-os) - ("grub.cfg" ,grub.cfg)) + ("grub.cfg" ,grub.cfg) + ("fstab" , fstab)) #:copy-inputs? #t #:os hurd-os #:bootcfg-drv grub.cfg -- cgit 1.4.1 From cd4faab5636cfc30765f9642189787f49daba519 Mon Sep 17 00:00:00 2001 From: "Jan (janneke) Nieuwenhuizen" Date: Sun, 5 Apr 2020 13:51:56 +0200 Subject: system: hurd: Add ttys symlink in "/etc/ttys". * gnu/packages/hurd.scm (hurd): Substitute /libexec/. * gnu/system/hurd.scm (cross-hurd-image): Add symlink /etc/ttys => /etc/ttys. --- gnu/system/hurd.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gnu/system') diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm index 03c49d472f..4830c91553 100644 --- a/gnu/system/hurd.scm +++ b/gnu/system/hurd.scm @@ -103,7 +103,12 @@ menuentry \"GNU\" { "i586-pc-gnu")) hurd) "/hurd")) - ("/etc/fstab" -> ,fstab))) + ("/etc/fstab" -> ,fstab) + ;; XXX can we instead, harmlessly set _PATH_TTYS (from glibc) in runttys.c? + ("/etc/ttys" -> ,(file-append (with-parameters ((%current-target-system + "i586-pc-gnu")) + hurd) + "/etc/ttys")))) (qemu-image #:file-system-type "ext2" #:file-system-options '("-o" "hurd") -- cgit 1.4.1 From 6598c6149b28ea7ba3450e0081a55e2baabf1371 Mon Sep 17 00:00:00 2001 From: "Jan (janneke) Nieuwenhuizen" Date: Sun, 5 Apr 2020 14:36:34 +0200 Subject: system: hurd: Add /etc/{passwd,shadow}. * gnu/system/hurd.scm: Generate hard-coded /etc/{passwd,shadow}, allows running chown in MAKEDEV and loggin in. --- gnu/system/hurd.scm | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'gnu/system') diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm index 4830c91553..3926f11315 100644 --- a/gnu/system/hurd.scm +++ b/gnu/system/hurd.scm @@ -80,6 +80,18 @@ menuentry \"GNU\" { /dev/hd0s1 / ext2 defaults ")) + (define passwd + (plain-file "passwd" +"root:x:0:0:root:/root:/bin/sh +" +)) + + (define shadow + (plain-file "shadow" +"root::0:0:0:0::: +" +)) + (define hurd-directives `((directory "/servers") ,@(map (lambda (server) @@ -104,6 +116,8 @@ menuentry \"GNU\" { hurd) "/hurd")) ("/etc/fstab" -> ,fstab) + ("/etc/passwd" -> ,passwd) + ("/etc/shadow" -> ,shadow) ;; XXX can we instead, harmlessly set _PATH_TTYS (from glibc) in runttys.c? ("/etc/ttys" -> ,(file-append (with-parameters ((%current-target-system "i586-pc-gnu")) @@ -115,7 +129,9 @@ menuentry \"GNU\" { #:device-nodes 'hurd #:inputs `(("system" ,hurd-os) ("grub.cfg" ,grub.cfg) - ("fstab" , fstab)) + ("fstab" ,fstab) + ("passwd" ,passwd) + ("shadow" ,shadow)) #:copy-inputs? #t #:os hurd-os #:bootcfg-drv grub.cfg -- cgit 1.4.1 From fe1f9646b4533fd4d3ec98bcfaa1b09391396e76 Mon Sep 17 00:00:00 2001 From: "Jan (janneke) Nieuwenhuizen" Date: Sun, 5 Apr 2020 17:16:30 +0200 Subject: system: hurd: Add "/bin/sh" symlink. This allows login.c to succeed for root. * gnu/system/hurd.scm (cross-hurd-image): Link /bin/sh to full the full bash. --- gnu/system/hurd.scm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'gnu/system') diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm index 3926f11315..65706161cb 100644 --- a/gnu/system/hurd.scm +++ b/gnu/system/hurd.scm @@ -21,6 +21,7 @@ #:use-module (guix utils) #:use-module (gnu bootloader grub) #:use-module (gnu packages base) + #:use-module (gnu packages bash) #:use-module (gnu packages cross-base) #:use-module (gnu packages hurd) #:use-module (gnu system vm) @@ -44,7 +45,7 @@ (directory-union "gnu+hurd" (cons (with-parameters ((%current-system "i686-linux")) gnumach) - (for-hurd hurd coreutils grep sed))))) + (for-hurd hurd bash coreutils grep sed))))) (define grub.cfg (let ((hurd (with-parameters ((%current-target-system "i586-pc-gnu")) @@ -122,7 +123,11 @@ menuentry \"GNU\" { ("/etc/ttys" -> ,(file-append (with-parameters ((%current-target-system "i586-pc-gnu")) hurd) - "/etc/ttys")))) + "/etc/ttys")) + ("/bin/sh" -> ,(file-append (with-parameters ((%current-target-system + "i586-pc-gnu")) + bash) + "/bin/sh")))) (qemu-image #:file-system-type "ext2" #:file-system-options '("-o" "hurd") -- cgit 1.4.1 From 5fbf4f85e1bfe028cc17d6fbcd9e337bf7a9e389 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 6 Apr 2020 14:58:58 +0200 Subject: system: hurd: Create /etc/{hostname,motd,login} and /root. * gnu/system/hurd.scm (cross-hurd-image): Add /etc/{hostname,motd,login} and /root. --- gnu/system/hurd.scm | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'gnu/system') diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm index 65706161cb..75b9dacd68 100644 --- a/gnu/system/hurd.scm +++ b/gnu/system/hurd.scm @@ -108,17 +108,32 @@ menuentry \"GNU\" { ("/servers/socket/local" -> "1") ("/servers/socket/inet" -> "2") ("/servers/socket/inet6" -> "16") - (file "/etc/resolv.conf" - "nameserver 10.0.2.3\n") (directory "/boot") ("/boot/grub.cfg" -> ,grub.cfg) ;XXX: not strictly needed ("/hurd" -> ,(file-append (with-parameters ((%current-target-system "i586-pc-gnu")) hurd) "/hurd")) + + ;; TODO: Create those during activation, eventually. + (directory "/root") ("/etc/fstab" -> ,fstab) ("/etc/passwd" -> ,passwd) ("/etc/shadow" -> ,shadow) + (file "/etc/hostname" "guixygnu") + (file "/etc/resolv.conf" + "nameserver 10.0.2.3\n") + + ("/etc/motd" -> ,(file-append (with-parameters ((%current-target-system + "i586-pc-gnu")) + hurd) + "/etc/motd")) + ("/etc/login" -> ,(file-append (with-parameters ((%current-target-system + "i586-pc-gnu")) + hurd) + "/etc/login")) + + ;; XXX can we instead, harmlessly set _PATH_TTYS (from glibc) in runttys.c? ("/etc/ttys" -> ,(file-append (with-parameters ((%current-target-system "i586-pc-gnu")) -- cgit 1.4.1 From da987ece8f9a4ecb6d1d40b042da2c829367f059 Mon Sep 17 00:00:00 2001 From: "Jan (janneke) Nieuwenhuizen" Date: Wed, 8 Apr 2020 08:04:52 +0200 Subject: system: hurd: Add root profile. * gnu/system/hurd.scm (%base-packages/hurd): New variable. (cross-hurd-image)[for-hurd]: New function. (cross-hurd-image)[hurd-os]: Use them. (cross-hurd-image)[profile]: Hack'y .profile for root, only setting PATH. --- gnu/system/hurd.scm | 59 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 22 deletions(-) (limited to 'gnu/system') diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm index 75b9dacd68..7cf7476bd1 100644 --- a/gnu/system/hurd.scm +++ b/gnu/system/hurd.scm @@ -23,6 +23,8 @@ #:use-module (gnu packages base) #:use-module (gnu packages bash) #:use-module (gnu packages cross-base) + #:use-module (gnu packages file) + #:use-module (gnu packages guile) #:use-module (gnu packages hurd) #:use-module (gnu system vm) #:export (cross-hurd-image)) @@ -34,18 +36,20 @@ ;;; ;;; Code: +(define %base-packages/hurd + (list hurd bash coreutils file findutils grep sed guile-3.0)) + (define* (cross-hurd-image #:key (hurd hurd) (gnumach gnumach)) "Return a cross-built GNU/Hurd image." + + (define (for-hurd p) + (with-parameters ((%current-target-system "i586-pc-gnu")) p)) + (define hurd-os - (let-syntax ((for-hurd (syntax-rules () - ((_ things ...) - (list (with-parameters ((%current-target-system - "i586-pc-gnu")) - things) ...))))) - (directory-union "gnu+hurd" - (cons (with-parameters ((%current-system "i686-linux")) - gnumach) - (for-hurd hurd bash coreutils grep sed))))) + (directory-union "gnu+hurd" + (cons (with-parameters ((%current-system "i686-linux")) + gnumach) + (map for-hurd %base-packages/hurd)))) (define grub.cfg (let ((hurd (with-parameters ((%current-target-system "i586-pc-gnu")) @@ -73,9 +77,20 @@ menuentry \"GNU\" { #+mach #+mach #+hurd #+libc #+hurd)))))) + (define profile + (let ((packages (map for-hurd %base-packages/hurd))) + (computed-file + "profile" + #~(call-with-output-file #$output + (lambda (port) + (format port " +PATH=~a/bin:~a/sbin:~a/hurd +" + #+hurd-os #+hurd-os #+hurd-os)))))) + (define fstab (plain-file "fstab" -"# This file was generated from your Guix configuration. Any changes + "# This file was generated from your Guix configuration. Any changes # will be lost upon reboot or reconfiguration. /dev/hd0s1 / ext2 defaults @@ -83,15 +98,13 @@ menuentry \"GNU\" { (define passwd (plain-file "passwd" -"root:x:0:0:root:/root:/bin/sh -" -)) + "root:x:0:0:root:/root:/bin/sh +")) (define shadow (plain-file "shadow" -"root::0:0:0:0::: -" -)) + "root::0:0:0:0::: +")) (define hurd-directives `((directory "/servers") @@ -109,7 +122,7 @@ menuentry \"GNU\" { ("/servers/socket/inet" -> "2") ("/servers/socket/inet6" -> "16") (directory "/boot") - ("/boot/grub.cfg" -> ,grub.cfg) ;XXX: not strictly needed + ("/boot/grub.cfg" -> ,grub.cfg) ;XXX: not strictly needed ("/hurd" -> ,(file-append (with-parameters ((%current-target-system "i586-pc-gnu")) hurd) @@ -117,6 +130,7 @@ menuentry \"GNU\" { ;; TODO: Create those during activation, eventually. (directory "/root") + ("/root/.profile" -> ,profile) ("/etc/fstab" -> ,fstab) ("/etc/passwd" -> ,passwd) ("/etc/shadow" -> ,shadow) @@ -129,16 +143,16 @@ menuentry \"GNU\" { hurd) "/etc/motd")) ("/etc/login" -> ,(file-append (with-parameters ((%current-target-system - "i586-pc-gnu")) - hurd) + "i586-pc-gnu")) + hurd) "/etc/login")) ;; XXX can we instead, harmlessly set _PATH_TTYS (from glibc) in runttys.c? ("/etc/ttys" -> ,(file-append (with-parameters ((%current-target-system - "i586-pc-gnu")) - hurd) - "/etc/ttys")) + "i586-pc-gnu")) + hurd) + "/etc/ttys")) ("/bin/sh" -> ,(file-append (with-parameters ((%current-target-system "i586-pc-gnu")) bash) @@ -151,6 +165,7 @@ menuentry \"GNU\" { ("grub.cfg" ,grub.cfg) ("fstab" ,fstab) ("passwd" ,passwd) + ("profile" ,profile) ("shadow" ,shadow)) #:copy-inputs? #t #:os hurd-os -- cgit 1.4.1 From c62126940419d2a6c21e16e21a973990fb11e054 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 8 Apr 2020 16:36:08 +0200 Subject: system: hurd: Create a proper profile. * gnu/system/hurd.scm (compile-manifest): New procedure. (cross-hurd-image)[for-hurd, hurd-os]: Remove. [cross-built, cross-built-entry]: New procedures. [system-profile]: New variable. [grub.cfg]: Use 'cross-built'. [profile]: Rename to... [etc-profile]: ... this, and adjust accordingly. [hurd-directives]: Create /run/current-system/profile and /etc/profile. Adjust arguments to 'qemu-image'. --- gnu/system/hurd.scm | 69 ++++++++++++++++++++++++++++++++++------------------- 1 file changed, 45 insertions(+), 24 deletions(-) (limited to 'gnu/system') diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm index 7cf7476bd1..b35a99cdfc 100644 --- a/gnu/system/hurd.scm +++ b/gnu/system/hurd.scm @@ -18,6 +18,7 @@ (define-module (gnu system hurd) #:use-module (guix gexp) + #:use-module (guix profiles) #:use-module (guix utils) #:use-module (gnu bootloader grub) #:use-module (gnu packages base) @@ -36,24 +37,39 @@ ;;; ;;; Code: +;; XXX: Surely this belongs in (guix profiles), but perhaps we need high-level +;; objects so one can specify hooks, etc.? +(define-gexp-compiler (compile-manifest (manifest + (@@ (guix profiles) )) + system target) + "Lower MANIFEST as a profile." + (profile-derivation manifest + #:system system + #:target target)) + (define %base-packages/hurd (list hurd bash coreutils file findutils grep sed guile-3.0)) (define* (cross-hurd-image #:key (hurd hurd) (gnumach gnumach)) "Return a cross-built GNU/Hurd image." - (define (for-hurd p) - (with-parameters ((%current-target-system "i586-pc-gnu")) p)) + (define (cross-built thing) + (with-parameters ((%current-target-system "i586-pc-gnu")) + thing)) + + (define (cross-built-entry entry) + (manifest-entry + (inherit entry) + (item (cross-built (manifest-entry-item entry))) + (dependencies (map cross-built-entry + (manifest-entry-dependencies entry))))) - (define hurd-os - (directory-union "gnu+hurd" - (cons (with-parameters ((%current-system "i686-linux")) - gnumach) - (map for-hurd %base-packages/hurd)))) + (define system-profile + (map-manifest-entries cross-built-entry + (packages->manifest %base-packages/hurd))) (define grub.cfg - (let ((hurd (with-parameters ((%current-target-system "i586-pc-gnu")) - hurd)) + (let ((hurd (cross-built hurd)) (mach (with-parameters ((%current-system "i686-linux")) gnumach)) (libc (cross-libc "i586-pc-gnu"))) @@ -77,17 +93,6 @@ menuentry \"GNU\" { #+mach #+mach #+hurd #+libc #+hurd)))))) - (define profile - (let ((packages (map for-hurd %base-packages/hurd))) - (computed-file - "profile" - #~(call-with-output-file #$output - (lambda (port) - (format port " -PATH=~a/bin:~a/sbin:~a/hurd -" - #+hurd-os #+hurd-os #+hurd-os)))))) - (define fstab (plain-file "fstab" "# This file was generated from your Guix configuration. Any changes @@ -106,6 +111,19 @@ PATH=~a/bin:~a/sbin:~a/hurd "root::0:0:0:0::: ")) + (define etc-profile + (plain-file "profile" + "\ +export PS1='\\u@\\h\\$ ' + +GUIX_PROFILE=\"/run/current-system/profile\" +. \"$GUIX_PROFILE/etc/profile\" + +GUIX_PROFILE=\"$HOME/.guix-profile\" +if [ -f \"$GUIX_PROFILE/etc/profile\" ]; then + . \"$GUIX_PROFILE/etc/profile\" +fi\n")) + (define hurd-directives `((directory "/servers") ,@(map (lambda (server) @@ -130,7 +148,10 @@ PATH=~a/bin:~a/sbin:~a/hurd ;; TODO: Create those during activation, eventually. (directory "/root") - ("/root/.profile" -> ,profile) + (directory "/run") + (directory "/run/current-system") + ("/run/current-system/profile" -> ,system-profile) + ("/etc/profile" -> ,etc-profile) ("/etc/fstab" -> ,fstab) ("/etc/passwd" -> ,passwd) ("/etc/shadow" -> ,shadow) @@ -161,14 +182,14 @@ PATH=~a/bin:~a/sbin:~a/hurd (qemu-image #:file-system-type "ext2" #:file-system-options '("-o" "hurd") #:device-nodes 'hurd - #:inputs `(("system" ,hurd-os) + #:inputs `(("system" ,system-profile) ("grub.cfg" ,grub.cfg) ("fstab" ,fstab) ("passwd" ,passwd) - ("profile" ,profile) + ("etc-profile" ,etc-profile) ("shadow" ,shadow)) #:copy-inputs? #t - #:os hurd-os + #:os system-profile #:bootcfg-drv grub.cfg #:bootloader grub-bootloader #:register-closures? #f -- cgit 1.4.1 From db047a482c150806301075a9b65fce2bf01fe8e8 Mon Sep 17 00:00:00 2001 From: "Jan (janneke) Nieuwenhuizen" Date: Wed, 8 Apr 2020 17:39:30 +0200 Subject: system: hurd: Add net-base and inetutils, and /etc/{services,protocols}. This fixes In procedure getaddrinfo: Servname not supported for ai_socktype * gnu/system/hurd.scm (%base-packages/hurd): Add net-base, inetutils. (cross-hurd-image): Add /etc/{services,protocols} from net-base. --- gnu/system/hurd.scm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'gnu/system') diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm index b35a99cdfc..322ac10db8 100644 --- a/gnu/system/hurd.scm +++ b/gnu/system/hurd.scm @@ -21,6 +21,7 @@ #:use-module (guix profiles) #:use-module (guix utils) #:use-module (gnu bootloader grub) + #:use-module (gnu packages admin) #:use-module (gnu packages base) #:use-module (gnu packages bash) #:use-module (gnu packages cross-base) @@ -48,7 +49,8 @@ #:target target)) (define %base-packages/hurd - (list hurd bash coreutils file findutils grep sed guile-3.0)) + (list hurd bash coreutils file findutils grep sed guile-3.0 + net-base inetutils)) (define* (cross-hurd-image #:key (hurd hurd) (gnumach gnumach)) "Return a cross-built GNU/Hurd image." @@ -158,7 +160,14 @@ fi\n")) (file "/etc/hostname" "guixygnu") (file "/etc/resolv.conf" "nameserver 10.0.2.3\n") - + ("/etc/services" -> ,(file-append (with-parameters ((%current-target-system + "i586-pc-gnu")) + net-base) + "/etc/services")) + ("/etc/protocols" -> ,(file-append (with-parameters ((%current-target-system + "i586-pc-gnu")) + net-base) + "/etc/protocols")) ("/etc/motd" -> ,(file-append (with-parameters ((%current-target-system "i586-pc-gnu")) hurd) -- cgit 1.4.1 From 5084fd38541a5fc233f3299e10a33c3a38a7173f Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 8 Apr 2020 23:10:14 +0200 Subject: system: hurd: Add guile-candy. * gnu/system/hurd.scm (%base-packages/hurd): Add GUILE-COLORIZED and GUILE-READLINE. (cross-hurd-image)[hurd-directives]: Add /root/.guile. --- gnu/system/hurd.scm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'gnu/system') diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm index 322ac10db8..2583ff00fa 100644 --- a/gnu/system/hurd.scm +++ b/gnu/system/hurd.scm @@ -27,6 +27,7 @@ #:use-module (gnu packages cross-base) #:use-module (gnu packages file) #:use-module (gnu packages guile) + #:use-module (gnu packages guile-xyz) #:use-module (gnu packages hurd) #:use-module (gnu system vm) #:export (cross-hurd-image)) @@ -49,7 +50,8 @@ #:target target)) (define %base-packages/hurd - (list hurd bash coreutils file findutils grep sed guile-3.0 + (list hurd bash coreutils file findutils grep sed + guile-3.0 guile-colorized guile-readline net-base inetutils)) (define* (cross-hurd-image #:key (hurd hurd) (gnumach gnumach)) @@ -150,6 +152,11 @@ fi\n")) ;; TODO: Create those during activation, eventually. (directory "/root") + (file "/root/.guile" + ,(object->string + '(begin + (use-modules (ice-9 readline) (ice-9 colorized)) + (activate-readline) (activate-colorized)))) (directory "/run") (directory "/run/current-system") ("/run/current-system/profile" -> ,system-profile) -- cgit 1.4.1 From 9a749af4677ef3d63cd4cd46c05045b53cb64dc1 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Wed, 15 Apr 2020 19:39:00 +0200 Subject: installer: Add GC root for Guile 3.0. * gnu/system/install.scm (%installation-services)[gc-root-service-type]: Add GC root for GUILE-3.0 instead of GUILE-2.2. --- gnu/system/install.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnu/system') diff --git a/gnu/system/install.scm b/gnu/system/install.scm index 8b3a5d5fc0..c1481d13e2 100644 --- a/gnu/system/install.scm +++ b/gnu/system/install.scm @@ -442,7 +442,7 @@ Access documentation at any time by pressing Alt-F2.\x1b[0m (list bare-bones-os glibc-utf8-locales texinfo - guile-2.2)) + guile-3.0)) ;; Machines without Kernel Mode Setting (those with many old and ;; current AMD GPUs, SiS GPUs, ...) need uvesafb to show the GUI -- cgit 1.4.1 From 9b0c047c53ce064451717eeae4cc95c8ab213e57 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Tue, 14 Apr 2020 11:16:21 +0300 Subject: system: hurd: Add less, which to %base-packages/hurd. * gnu/system/hurd.scm (%base-packages/hurd): Add less, which. --- gnu/system/hurd.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gnu/system') diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm index 2583ff00fa..f691d96e9d 100644 --- a/gnu/system/hurd.scm +++ b/gnu/system/hurd.scm @@ -29,6 +29,7 @@ #:use-module (gnu packages guile) #:use-module (gnu packages guile-xyz) #:use-module (gnu packages hurd) + #:use-module (gnu packages less) #:use-module (gnu system vm) #:export (cross-hurd-image)) @@ -52,7 +53,7 @@ (define %base-packages/hurd (list hurd bash coreutils file findutils grep sed guile-3.0 guile-colorized guile-readline - net-base inetutils)) + net-base inetutils less which)) (define* (cross-hurd-image #:key (hurd hurd) (gnumach gnumach)) "Return a cross-built GNU/Hurd image." -- cgit 1.4.1 From 3eb4b466fcbe35cbc51e97d088cdcc2ba1853350 Mon Sep 17 00:00:00 2001 From: "Jan (janneke) Nieuwenhuizen" Date: Wed, 8 Apr 2020 09:46:40 +0200 Subject: system: hurd: Add /etc/group. This allows download to run. * gnu/system/hurd.scm (cross-hurd-image): Add /etc/group with guixbuilder. --- gnu/system/hurd.scm | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'gnu/system') diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm index f691d96e9d..58bfdf88f6 100644 --- a/gnu/system/hurd.scm +++ b/gnu/system/hurd.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2020 Ludovic Courtès +;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -109,6 +110,12 @@ menuentry \"GNU\" { (define passwd (plain-file "passwd" "root:x:0:0:root:/root:/bin/sh +guixbuilder:x:1:1:guixbuilder:/var/empty:/bin/no-sh +")) + + (define group + (plain-file "group" + "guixbuild:x:1:guixbuilder ")) (define shadow @@ -163,6 +170,7 @@ fi\n")) ("/run/current-system/profile" -> ,system-profile) ("/etc/profile" -> ,etc-profile) ("/etc/fstab" -> ,fstab) + ("/etc/group" -> ,group) ("/etc/passwd" -> ,passwd) ("/etc/shadow" -> ,shadow) (file "/etc/hostname" "guixygnu") @@ -203,6 +211,7 @@ fi\n")) ("grub.cfg" ,grub.cfg) ("fstab" ,fstab) ("passwd" ,passwd) + ("group" ,group) ("etc-profile" ,etc-profile) ("shadow" ,shadow)) #:copy-inputs? #t -- cgit 1.4.1 From 73ddcab6075f60ef9b3cd72a35fbf7f5d622b6ef Mon Sep 17 00:00:00 2001 From: Florian Pelz Date: Wed, 29 Apr 2020 18:22:48 +0200 Subject: Revert "install: Pass "modprobe.blacklist=radeon"." This reverts commit 785919121066a10b291d783b6903b5e368e992a8, which is no longer needed since uvesafb was added in 557e6820a77b24f8f3f03f28ee473137b1caeb64. --- gnu/system/install.scm | 6 ------ 1 file changed, 6 deletions(-) (limited to 'gnu/system') diff --git a/gnu/system/install.scm b/gnu/system/install.scm index d31ed9a197..8804585215 100644 --- a/gnu/system/install.scm +++ b/gnu/system/install.scm @@ -471,12 +471,6 @@ Access documentation at any time by pressing Alt-F2.\x1b[0m (label (string-append "GNU Guix installation " (package-version guix))) - ;; XXX: The AMD Radeon driver is reportedly broken, which makes kmscon - ;; non-functional: - ;; . - ;; Thus, blacklist it. - (kernel-arguments '("quiet" "modprobe.blacklist=radeon")) - (file-systems ;; Note: the disk image build code overrides this root file system with ;; the appropriate one. -- cgit 1.4.1 From 57833803b446484b6f413fb883b2156933c38639 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Fri, 1 May 2020 22:05:17 +0200 Subject: gnu: linux-initrd: Use Guile 3.0. * gnu/system/linux-initrd.scm (expression->initrd): Change from %GUILE-STATIC-STRIPPED to %GUILE-3.0-STATIC-STRIPPED. --- gnu/system/linux-initrd.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnu/system') diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm index dcc9b6b937..1aa3113ae5 100644 --- a/gnu/system/linux-initrd.scm +++ b/gnu/system/linux-initrd.scm @@ -36,7 +36,7 @@ #:use-module ((gnu packages xorg) #:select (console-setup xkeyboard-config)) #:use-module ((gnu packages make-bootstrap) - #:select (%guile-static-stripped)) + #:select (%guile-3.0-static-stripped)) #:use-module (gnu system file-systems) #:use-module (gnu system mapped-devices) #:use-module (gnu system keyboard) @@ -62,7 +62,7 @@ (define* (expression->initrd exp #:key - (guile %guile-static-stripped) + (guile %guile-3.0-static-stripped) (gzip gzip) (name "guile-initrd") (system (%current-system))) -- cgit 1.4.1 From 27efeef3068bfa21011ea509e21efcbe8c353b5f Mon Sep 17 00:00:00 2001 From: raingloom Date: Fri, 3 Apr 2020 07:00:41 +0200 Subject: linux-initrd: Add initial support for F2FS. * gnu/system/linux-initrd.scm (file-system-type-modules): Add f2fs module. Signed-off-by: Danny Milosavljevic --- gnu/system/linux-initrd.scm | 1 + 1 file changed, 1 insertion(+) (limited to 'gnu/system') diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm index dcc9b6b937..44ee4f10aa 100644 --- a/gnu/system/linux-initrd.scm +++ b/gnu/system/linux-initrd.scm @@ -275,6 +275,7 @@ FILE-SYSTEMS." ("btrfs" => '("btrfs")) ("iso9660" => '("isofs")) ("jfs" => '("jfs")) + ("f2fs" => '("f2fs" "crc32_generic")) (else '()))) (define (file-system-modules file-systems) -- cgit 1.4.1 From 0eed77127592323d89f56c215a15374a1aaae110 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 3 May 2020 17:25:28 +0200 Subject: locale: Add glibc 2.29 to '%default-locale-libcs'. This eases transition for anyone reconfiguring and still having profiles with packages using the former libc. * gnu/system/locale.scm (%default-locale-libcs): Add GLIBC-2.29. --- gnu/system/locale.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gnu/system') diff --git a/gnu/system/locale.scm b/gnu/system/locale.scm index c7a371e9bf..ec1b71e061 100644 --- a/gnu/system/locale.scm +++ b/gnu/system/locale.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2014, 2015, 2016, 2017, 2019 Ludovic Courtès +;;; Copyright © 2014, 2015, 2016, 2017, 2019, 2020 Ludovic Courtès ;;; Copyright © 2018 Mark H Weaver ;;; ;;; This file is part of GNU Guix. @@ -147,7 +147,8 @@ data format changes between libc versions." (define %default-locale-libcs ;; The libcs for which we build locales by default. - (list glibc)) + ;; List the previous and current libc to ease transition. + (list glibc-2.29 glibc)) (define %default-locale-definitions ;; Arbitrary set of locales that are built by default. They are here mostly -- cgit 1.4.1 From f8a0065ae391bc9f717033e612f342741c66d946 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Sun, 3 May 2020 16:12:30 +0200 Subject: install: Add f2fs-tools to the installation image. * gnu/system/install.scm (installation-os)[packages]: Add f2fs-tools. --- 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 8804585215..6435c1bff4 100644 --- a/gnu/system/install.scm +++ b/gnu/system/install.scm @@ -524,6 +524,7 @@ Access documentation at any time by pressing Alt-F2.\x1b[0m mdadm dosfstools ;mkfs.fat, for the UEFI boot partition btrfs-progs + f2fs-tools jfsutils openssh ;we already have sshd, having ssh/scp can help wireless-tools iw wpa-supplicant-minimal iproute -- cgit 1.4.1 From 33eab4a10dcd2a6580f168f18455df1d4653d14b Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Sun, 3 May 2020 22:41:24 +0200 Subject: linux-initrd: Provide fsck for F2FS. * gnu/system/linux-initrd.scm (file-system-packages): Add F2FS fsck. --- gnu/system/linux-initrd.scm | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gnu/system') diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm index 44ee4f10aa..6a1840dbf6 100644 --- a/gnu/system/linux-initrd.scm +++ b/gnu/system/linux-initrd.scm @@ -245,6 +245,9 @@ FILE-SYSTEMS." '()) ,@(if (find (file-system-type-predicate "jfs") file-systems) (list jfs_fsck/static) + '()) + ,@(if (find (file-system-type-predicate "f2fs") file-systems) + (list f2fs-fsck/static) '()))) (define-syntax vhash ;TODO: factorize -- cgit 1.4.1 From 78fbf2bd70e8af00a3ce5b05a5e25258e34f84cc Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Tue, 28 Apr 2020 14:12:34 +0200 Subject: system: vm: Move operating-system-uuid. * gnu/system/vm.scm (operating-system-uuid): Move to ... * gnu/system.scm: ... here. --- gnu/system.scm | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ gnu/system/vm.scm | 48 ------------------------------------------------ 2 files changed, 50 insertions(+), 48 deletions(-) (limited to 'gnu/system') diff --git a/gnu/system.scm b/gnu/system.scm index 107b93db31..0c5d5df365 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -120,6 +120,7 @@ operating-system-etc-directory operating-system-locale-directory operating-system-boot-script + operating-system-uuid system-linux-image-file-name operating-system-with-gc-roots @@ -989,6 +990,55 @@ we're running in the final root." #:mapped-devices mapped-devices #:keyboard-layout (operating-system-keyboard-layout os))) +(define* (operating-system-uuid os #:optional (type 'dce)) + "Compute UUID object with a deterministic \"UUID\" for OS, of the given +TYPE (one of 'iso9660 or 'dce). Return a UUID object." + ;; Note: For this to be deterministic, we must not hash things that contains + ;; (directly or indirectly) procedures, for example. That rules out + ;; anything that contains gexps, thunk or delayed record fields, etc. + + (define service-name + (compose service-type-name service-kind)) + + (define (file-system-digest fs) + ;; Return a hashable digest that does not contain 'dependencies' since + ;; this field can contain procedures. + (let ((device (file-system-device fs))) + (list (file-system-mount-point fs) + (file-system-type fs) + (file-system-device->string device) + (file-system-options fs)))) + + (if (eq? type 'iso9660) + (let ((pad (compose (cut string-pad <> 2 #\0) + number->string)) + (h (hash (map service-name (operating-system-services os)) + 3600))) + (bytevector->uuid + (string->iso9660-uuid + (string-append "1970-01-01-" + (pad (hash (operating-system-host-name os) 24)) "-" + (pad (quotient h 60)) "-" + (pad (modulo h 60)) "-" + (pad (hash (map file-system-digest + (operating-system-file-systems os)) + 100)))) + 'iso9660)) + (bytevector->uuid + (uint-list->bytevector + (list (hash (map file-system-digest + (operating-system-file-systems os)) + (- (expt 2 32) 1)) + (hash (operating-system-host-name os) + (- (expt 2 32) 1)) + (hash (map service-name (operating-system-services os)) + (- (expt 2 32) 1)) + (hash (map file-system-digest (operating-system-file-systems os)) + (- (expt 2 32) 1))) + (endianness little) + 4) + type))) + (define (locale-name->definition* name) "Variant of 'locale-name->definition' that raises an error upon failure." (match (locale-name->definition name) diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index 6f81ac16ff..2fdf954883 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -604,54 +604,6 @@ system." ;;; VM and disk images. ;;; -(define* (operating-system-uuid os #:optional (type 'dce)) - "Compute UUID object with a deterministic \"UUID\" for OS, of the given -TYPE (one of 'iso9660 or 'dce). Return a UUID object." - ;; Note: For this to be deterministic, we must not hash things that contains - ;; (directly or indirectly) procedures, for example. That rules out - ;; anything that contains gexps, thunk or delayed record fields, etc. - - (define service-name - (compose service-type-name service-kind)) - - (define (file-system-digest fs) - ;; Return a hashable digest that does not contain 'dependencies' since - ;; this field can contain procedures. - (let ((device (file-system-device fs))) - (list (file-system-mount-point fs) - (file-system-type fs) - (file-system-device->string device) - (file-system-options fs)))) - - (if (eq? type 'iso9660) - (let ((pad (compose (cut string-pad <> 2 #\0) - number->string)) - (h (hash (map service-name (operating-system-services os)) - 3600))) - (bytevector->uuid - (string->iso9660-uuid - (string-append "1970-01-01-" - (pad (hash (operating-system-host-name os) 24)) "-" - (pad (quotient h 60)) "-" - (pad (modulo h 60)) "-" - (pad (hash (map file-system-digest - (operating-system-file-systems os)) - 100)))) - 'iso9660)) - (bytevector->uuid - (uint-list->bytevector - (list (hash (map file-system-digest - (operating-system-file-systems os)) - (- (expt 2 32) 1)) - (hash (operating-system-host-name os) - (- (expt 2 32) 1)) - (hash (map service-name (operating-system-services os)) - (- (expt 2 32) 1)) - (hash (map file-system-digest (operating-system-file-systems os)) - (- (expt 2 32) 1))) - (endianness little) - 4) - type))) (define* (system-disk-image os #:key -- cgit 1.4.1 From f19cf27c2b9ff92e2c0fd931ef7fde39c376adaa Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Tue, 28 Apr 2020 14:15:28 +0200 Subject: image: Add a new API. Raw disk-images and ISO9660 images are created in a Qemu virtual machine. This is quite fragile, very slow, and almost unusable without KVM. For all these reasons, add support for host image generation. This implies the use new image generation mechanisms. - Raw disk images: images of partitions are created using tools such as mke2fs and mkdosfs depending on the partition file-system type. The partition images are then assembled into a final image using genimage. - ISO9660 images: the ISO root directory is populated within the store. GNU xorriso is then called on that directory, in the exact same way as this is done in (gnu build vm) module. Those mechanisms are built upon the new (gnu image) module. * gnu/image.scm: New file. * gnu/system/image.scm: New file. * gnu/build/image: New file. * gnu/local.mk: Add them. * gnu/system/vm.scm (system-disk-image): Rename to system-disk-image-in-vm. * gnu/ci.scm (qemu-jobs): Adapt to new API. * gnu/tests/install.scm (run-install): Ditto. * guix/scripts/system.scm (system-derivation-for-action): Ditto. --- gnu/build/image.scm | 273 +++++++++++++++++++++++++ gnu/build/install.scm | 1 - gnu/ci.scm | 45 ++-- gnu/image.scm | 76 +++++++ gnu/local.mk | 3 + gnu/system/image.scm | 532 ++++++++++++++++++++++++++++++++++++++++++++++++ gnu/system/vm.scm | 17 +- gnu/tests/install.scm | 22 +- guix/scripts/system.scm | 13 +- 9 files changed, 932 insertions(+), 50 deletions(-) create mode 100644 gnu/build/image.scm create mode 100644 gnu/image.scm create mode 100644 gnu/system/image.scm (limited to 'gnu/system') diff --git a/gnu/build/image.scm b/gnu/build/image.scm new file mode 100644 index 0000000000..fe8e11aa1b --- /dev/null +++ b/gnu/build/image.scm @@ -0,0 +1,273 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès +;;; Copyright © 2016 Christopher Allan Webber +;;; Copyright © 2016, 2017 Leo Famulari +;;; Copyright © 2017 Marius Bakke +;;; Copyright © 2020 Tobias Geerinckx-Rice +;;; Copyright © 2020 Mathieu Othacehe +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu build image) + #:use-module (guix build store-copy) + #:use-module (guix build syscalls) + #:use-module (guix build utils) + #:use-module (guix store database) + #:use-module (gnu build bootloader) + #:use-module (gnu build install) + #:use-module (gnu build linux-boot) + #:use-module (gnu image) + #:use-module (gnu system uuid) + #:use-module (ice-9 ftw) + #:use-module (ice-9 match) + #:use-module (srfi srfi-19) + #:use-module (srfi srfi-34) + #:use-module (srfi srfi-35) + #:export (make-partition-image + genimage + initialize-efi-partition + initialize-root-partition + + make-iso9660-image)) + +(define (sexp->partition sexp) + "Take SEXP, a tuple as returned by 'partition->gexp', and turn it into a + record." + (match sexp + ((size file-system label uuid) + (partition (size size) + (file-system file-system) + (label label) + (uuid uuid))))) + +(define (size-in-kib size) + "Convert SIZE expressed in bytes, to kilobytes and return it as a string." + (number->string + (inexact->exact (ceiling (/ size 1024))))) + +(define (estimate-partition-size root) + "Given the ROOT directory, evalute and return its size. As this doesn't +take the partition metadata size into account, take a 25% margin." + (* 1.25 (file-size root))) + +(define* (make-ext4-image partition target root + #:key + (owner-uid 0) + (owner-gid 0)) + "Handle the creation of EXT4 partition images. See 'make-partition-image'." + (let ((size (partition-size partition)) + (label (partition-label partition)) + (uuid (partition-uuid partition)) + (options "lazy_itable_init=1,lazy_journal_init=1")) + (invoke "mke2fs" "-t" "ext4" "-d" root + "-L" label "-U" (uuid->string uuid) + "-E" (format #f "root_owner=~a:~a,~a" + owner-uid owner-gid options) + target + (format #f "~ak" + (size-in-kib + (if (eq? size 'guess) + (estimate-partition-size root) + size)))))) + +(define* (make-vfat-image partition target root) + "Handle the creation of VFAT partition images. See 'make-partition-image'." + (let ((size (partition-size partition)) + (label (partition-label partition))) + (invoke "mkdosfs" "-n" label "-C" target "-F" "16" "-S" "1024" + (size-in-kib + (if (eq? size 'guess) + (estimate-partition-size root) + size))) + (for-each (lambda (file) + (unless (member file '("." "..")) + (invoke "mcopy" "-bsp" "-i" target + (string-append root "/" file) + (string-append "::" file)))) + (scandir root)))) + +(define* (make-partition-image partition-sexp target root) + "Create and return the image of PARTITION-SEXP as TARGET. Use the given +ROOT directory to populate the image." + (let* ((partition (sexp->partition partition-sexp)) + (type (partition-file-system partition))) + (cond + ((string=? type "ext4") + (make-ext4-image partition target root)) + ((string=? type "vfat") + (make-vfat-image partition target root)) + (else + (format (current-error-port) + "Unsupported partition type~%."))))) + +(define* (genimage config target) + "Use genimage to generate in TARGET directory, the image described in the +given CONFIG file." + ;; genimage needs a 'root' directory. + (mkdir "root") + (invoke "genimage" "--config" config + "--outputpath" target)) + +(define* (register-closure prefix closure + #:key + (deduplicate? #t) (reset-timestamps? #t) + (schema (sql-schema))) + "Register CLOSURE in PREFIX, where PREFIX is the directory name of the +target store and CLOSURE is the name of a file containing a reference graph as +produced by #:references-graphs.. As a side effect, if RESET-TIMESTAMPS? is +true, reset timestamps on store files and, if DEDUPLICATE? is true, +deduplicates files common to CLOSURE and the rest of PREFIX." + (let ((items (call-with-input-file closure read-reference-graph))) + (register-items items + #:prefix prefix + #:deduplicate? deduplicate? + #:reset-timestamps? reset-timestamps? + #:registration-time %epoch + #:schema schema))) + +(define* (initialize-efi-partition root + #:key + bootloader-package + #:allow-other-keys) + "Install in ROOT directory, an EFI loader using BOOTLOADER-PACKAGE." + (install-efi-loader bootloader-package root)) + +(define* (initialize-root-partition root + #:key + bootcfg + bootcfg-location + (deduplicate? #t) + references-graphs + (register-closures? #t) + system-directory + #:allow-other-keys) + "Initialize the given ROOT directory. Use BOOTCFG and BOOTCFG-LOCATION to +install the bootloader configuration. + +If REGISTER-CLOSURES? is true, register REFERENCES-GRAPHS in the store. If +DEDUPLICATE? is true, then also deduplicate files common to CLOSURES and the +rest of the store when registering the closures. SYSTEM-DIRECTORY is the name +of the directory of the 'system' derivation." + (populate-root-file-system system-directory root) + (populate-store references-graphs root) + + (when register-closures? + (for-each (lambda (closure) + (register-closure root + closure + #:reset-timestamps? #t + #:deduplicate? deduplicate?)) + references-graphs)) + + (when bootcfg + (install-boot-config bootcfg bootcfg-location root))) + +(define* (make-iso9660-image xorriso grub-mkrescue-environment + grub bootcfg system-directory root target + #:key (volume-id "Guix_image") (volume-uuid #f) + register-closures? (references-graphs '()) + (compression? #t)) + "Given a GRUB package, creates an iso image as TARGET, using BOOTCFG as +GRUB configuration and OS-DRV as the stuff in it." + (define grub-mkrescue + (string-append grub "/bin/grub-mkrescue")) + + (define grub-mkrescue-sed.sh + (string-append (getcwd) "/" "grub-mkrescue-sed.sh")) + + ;; Use a modified version of grub-mkrescue-sed.sh, see below. + (copy-file (string-append xorriso + "/bin/grub-mkrescue-sed.sh") + grub-mkrescue-sed.sh) + + ;; Force grub-mkrescue-sed.sh to use the build directory instead of /tmp + ;; that is read-only inside the build container. + (substitute* grub-mkrescue-sed.sh + (("/tmp/") (string-append (getcwd) "/")) + (("MKRESCUE_SED_XORRISO_ARGS \\$x") + (format #f "MKRESCUE_SED_XORRISO_ARGS $(echo $x | sed \"s|/tmp|~a|\")" + (getcwd)))) + + ;; 'grub-mkrescue' calls out to mtools programs to create 'efi.img', a FAT + ;; file system image, and mtools honors SOURCE_DATE_EPOCH for the mtime of + ;; those files. The epoch for FAT is Jan. 1st 1980, not 1970, so choose + ;; that. + (setenv "SOURCE_DATE_EPOCH" + (number->string + (time-second + (date->time-utc (make-date 0 0 0 0 1 1 1980 0))))) + + ;; Our patched 'grub-mkrescue' honors this environment variable and passes + ;; it to 'mformat', which makes it the serial number of 'efi.img'. This + ;; allows for deterministic builds. + (setenv "GRUB_FAT_SERIAL_NUMBER" + (number->string (if volume-uuid + + ;; On 32-bit systems the 2nd argument must be + ;; lower than 2^32. + (string-hash (iso9660-uuid->string volume-uuid) + (- (expt 2 32) 1)) + + #x77777777) + 16)) + + (setenv "MKRESCUE_SED_MODE" "original") + (setenv "MKRESCUE_SED_XORRISO" (string-append xorriso "/bin/xorriso")) + (setenv "MKRESCUE_SED_IN_EFI_NO_PT" "yes") + + (for-each (match-lambda + ((name . value) (setenv name value))) + grub-mkrescue-environment) + + (apply invoke grub-mkrescue + (string-append "--xorriso=" grub-mkrescue-sed.sh) + "-o" target + (string-append "boot/grub/grub.cfg=" bootcfg) + root + "--" + ;; Set all timestamps to 1. + "-volume_date" "all_file_dates" "=1" + + `(,@(if compression? + '(;; ‘zisofs’ compression reduces the total image size by + ;; ~60%. + "-zisofs" "level=9:block_size=128k" ; highest compression + ;; It's transparent to our Linux-Libre kernel but not to + ;; GRUB. Don't compress the kernel, initrd, and other + ;; files read by grub.cfg, as well as common + ;; already-compressed file names. + "-find" "/" "-type" "f" + ;; XXX Even after "--" above, and despite documentation + ;; claiming otherwise, "-or" is stolen by grub-mkrescue + ;; which then chokes on it (as ‘-o …’) and dies. Don't use + ;; "-or". + "-not" "-wholename" "/boot/*" + "-not" "-wholename" "/System/*" + "-not" "-name" "unicode.pf2" + "-not" "-name" "bzImage" + "-not" "-name" "*.gz" ; initrd & all man pages + "-not" "-name" "*.png" ; includes grub-image.png + "-exec" "set_filter" "--zisofs" + "--") + '()) + "-volid" ,(string-upcase volume-id) + ,@(if volume-uuid + `("-volume_date" "uuid" + ,(string-filter (lambda (value) + (not (char=? #\- value))) + (iso9660-uuid->string + volume-uuid))) + '())))) diff --git a/gnu/build/install.scm b/gnu/build/install.scm index 59a118e905..b18654f1cc 100644 --- a/gnu/build/install.scm +++ b/gnu/build/install.scm @@ -25,7 +25,6 @@ #:export (install-boot-config evaluate-populate-directive populate-root-file-system - register-closure install-database-and-gc-roots populate-single-profile-directory)) diff --git a/gnu/ci.scm b/gnu/ci.scm index fb2596c809..0430cf594b 100644 --- a/gnu/ci.scm +++ b/gnu/ci.scm @@ -38,6 +38,7 @@ #:select (lookup-compressor self-contained-tarball)) #:use-module (gnu bootloader) #:use-module (gnu bootloader u-boot) + #:use-module (gnu image) #:use-module (gnu packages) #:use-module (gnu packages gcc) #:use-module (gnu packages base) @@ -49,6 +50,7 @@ #:use-module (gnu packages make-bootstrap) #:use-module (gnu packages package-management) #:use-module (gnu system) + #:use-module (gnu system image) #:use-module (gnu system vm) #:use-module (gnu system install) #:use-module (gnu tests) @@ -209,32 +211,23 @@ system.") (expt 2 20)) (if (member system %guixsd-supported-systems) - (if (member system %u-boot-systems) - (list (->job 'flash-image - (run-with-store store - (mbegin %store-monad - (set-guile-for-build (default-guile)) - (system-disk-image - (operating-system (inherit installation-os) - (bootloader (bootloader-configuration - (bootloader u-boot-bootloader) - (target #f)))) - #:disk-image-size - (* 1500 MiB)))))) - (list (->job 'usb-image - (run-with-store store - (mbegin %store-monad - (set-guile-for-build (default-guile)) - (system-disk-image installation-os - #:disk-image-size - (* 1500 MiB))))) - (->job 'iso9660-image - (run-with-store store - (mbegin %store-monad - (set-guile-for-build (default-guile)) - (system-disk-image installation-os - #:file-system-type - "iso9660")))))) + (list (->job 'usb-image + (run-with-store store + (mbegin %store-monad + (set-guile-for-build (default-guile)) + (system-image + (image + (inherit efi-disk-image) + (size (* 1500 MiB)) + (operating-system installation-os)))))) + (->job 'iso9660-image + (run-with-store store + (mbegin %store-monad + (set-guile-for-build (default-guile)) + (system-image + (image + (inherit iso9660-image) + (operating-system installation-os))))))) '())) (define channel-build-system diff --git a/gnu/image.scm b/gnu/image.scm new file mode 100644 index 0000000000..b05fc69dc5 --- /dev/null +++ b/gnu/image.scm @@ -0,0 +1,76 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2020 Mathieu Othacehe +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu image) + #:use-module (guix records) + #:export (partition + partition? + partition-device + partition-size + partition-file-system + partition-label + partition-uuid + partition-flags + partition-initializer + + image + image-name + image-format + image-size + image-operating-system + image-partitions + image-compression? + image-volatile-root? + image-substitutable?)) + + +;;; +;;; Partition record. +;;; + +(define-record-type* partition make-partition + partition? + (device partition-device (default #f)) + (size partition-size) + (file-system partition-file-system (default "ext4")) + (label partition-label (default #f)) + (uuid partition-uuid (default #f)) + (flags partition-flags (default '())) + (initializer partition-initializer (default #f))) + + +;;; +;;; Image record. +;;; + +(define-record-type* + image make-image + image? + (format image-format) ;symbol + (size image-size ;size in bytes as integer + (default 'guess)) + (operating-system image-operating-system ; + (default #f)) + (partitions image-partitions ;list of + (default '())) + (compression? image-compression? ;boolean + (default #t)) + (volatile-root? image-volatile-root? ;boolean + (default #t)) + (substitutable? image-substitutable? ;boolean + (default #t))) diff --git a/gnu/local.mk b/gnu/local.mk index daf6bd0306..4e0521baa5 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -62,6 +62,7 @@ GNU_SYSTEM_MODULES = \ %D%/bootloader/u-boot.scm \ %D%/bootloader/depthcharge.scm \ %D%/ci.scm \ + %D%/image.scm \ %D%/packages.scm \ %D%/packages/abduco.scm \ %D%/packages/abiword.scm \ @@ -606,6 +607,7 @@ GNU_SYSTEM_MODULES = \ %D%/system.scm \ %D%/system/accounts.scm \ %D%/system/file-systems.scm \ + %D%/system/image.scm \ %D%/system/install.scm \ %D%/system/keyboard.scm \ %D%/system/linux-container.scm \ @@ -626,6 +628,7 @@ GNU_SYSTEM_MODULES = \ %D%/build/activation.scm \ %D%/build/bootloader.scm \ %D%/build/cross-toolchain.scm \ + %D%/build/image.scm \ %D%/build/file-systems.scm \ %D%/build/install.scm \ %D%/build/linux-boot.scm \ diff --git a/gnu/system/image.scm b/gnu/system/image.scm new file mode 100644 index 0000000000..571b7af5f3 --- /dev/null +++ b/gnu/system/image.scm @@ -0,0 +1,532 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2020 Mathieu Othacehe +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu system image) + #:use-module (guix gexp) + #:use-module (guix modules) + #:use-module (guix monads) + #:use-module (guix records) + #:use-module (guix store) + #:use-module (guix ui) + #:use-module (guix utils) + #:use-module ((guix self) #:select (make-config.scm)) + #:use-module (gnu bootloader) + #:use-module (gnu bootloader grub) + #:use-module (gnu image) + #:use-module (gnu services) + #:use-module (gnu services base) + #:use-module (gnu system) + #:use-module (gnu system file-systems) + #:use-module (gnu system uuid) + #:use-module (gnu system vm) + #:use-module (guix packages) + #:use-module (gnu packages base) + #:use-module (gnu packages bootloaders) + #:use-module (gnu packages cdrom) + #:use-module (gnu packages disk) + #:use-module (gnu packages gawk) + #:use-module (gnu packages genimage) + #:use-module (gnu packages guile) + #:autoload (gnu packages gnupg) (guile-gcrypt) + #:use-module (gnu packages linux) + #:use-module (gnu packages mtools) + #:use-module ((srfi srfi-1) #:prefix srfi-1:) + #:use-module (srfi srfi-11) + #:use-module (srfi srfi-26) + #:use-module (srfi srfi-35) + #:use-module (rnrs bytevectors) + #:use-module (ice-9 match) + #:export (esp-partition + root-partition + + efi-disk-image + iso9660-image + + find-image + system-image)) + + +;;; +;;; Images definitions. +;;; + +(define esp-partition + (partition + (size (* 40 (expt 2 20))) + (label "GNU-ESP") ;cosmetic only + ;; Use "vfat" here since this property is used when mounting. The actual + ;; FAT-ness is based on file system size (16 in this case). + (file-system "vfat") + (flags '(esp)) + (initializer (gexp initialize-efi-partition)))) + +(define root-partition + (partition + (size 'guess) + (label "Guix_image") + (file-system "ext4") + (flags '(boot)) + (initializer (gexp initialize-root-partition)))) + +(define efi-disk-image + (image + (format 'disk-image) + (partitions (list esp-partition root-partition)))) + +(define iso9660-image + (image + (format 'iso9660) + (partitions + (list (partition + (size 'guess) + (label "GUIX_IMAGE") + (flags '(boot))))) + ;; XXX: Temporarily disable compression to speed-up the tests. + (compression? #f))) + + +;; +;; Helpers. +;; + +(define not-config? + ;; Select (guix …) and (gnu …) modules, except (guix config). + (match-lambda + (('guix 'config) #f) + (('guix rest ...) #t) + (('gnu rest ...) #t) + (rest #f))) + +(define (partition->gexp partition) + "Turn PARTITION, a object, into a list-valued gexp suitable for +'make-partition-image'." + #~'(#$@(list (partition-size partition)) + #$(partition-file-system partition) + #$(partition-label partition) + #$(and=> (partition-uuid partition) + uuid-bytevector))) + +(define gcrypt-sqlite3&co + ;; Guile-Gcrypt, Guile-SQLite3, and their propagated inputs. + (srfi-1:append-map + (lambda (package) + (cons package + (match (package-transitive-propagated-inputs package) + (((labels packages) ...) + packages)))) + (list guile-gcrypt guile-sqlite3))) + +(define-syntax-rule (with-imported-modules* gexp* ...) + (with-extensions gcrypt-sqlite3&co + (with-imported-modules `(,@(source-module-closure + '((gnu build vm) + (gnu build image) + (guix store database)) + #:select? not-config?) + ((guix config) => ,(make-config.scm))) + #~(begin + (use-modules (gnu build vm) + (gnu build image) + (guix store database) + (guix build utils)) + gexp* ...)))) + + +;; +;; Disk image. +;; + +(define* (system-disk-image image + #:key + (name "disk-image") + bootcfg + bootloader + register-closures? + (inputs '())) + "Return as a file-like object, the disk-image described by IMAGE. Said +image can be copied on a USB stick as is. BOOTLOADER is the bootloader that +will be installed and configured according to BOOTCFG parameter. + +Raw images of the IMAGE partitions are first created. Then, genimage is used +to assemble the partition images into a disk-image without resorting to a +virtual machine. + +INPUTS is a list of inputs (as for packages). When REGISTER-CLOSURES? is +true, register INPUTS in the store database of the image so that Guix can be +used in the image." + + (define genimage-name "image") + + (define (image->genimage-cfg image) + ;; Return as a file-like object, the genimage configuration file + ;; describing the given IMAGE. + (define (format->image-type format) + ;; Return the genimage format corresponding to FORMAT. For now, only + ;; the hdimage format (raw disk-image) is supported. + (case format + ((disk-image) "hdimage") + (else + (raise (condition + (&message + (message + (format #f (G_ "Unsupported image type ~a~%.") format)))))))) + + (define (partition->dos-type partition) + ;; Return the MBR partition type corresponding to the given PARTITION. + ;; See: https://en.wikipedia.org/wiki/Partition_type. + (let ((flags (partition-flags partition))) + (cond + ((member 'esp flags) "0xEF") + (else "0x83")))) + + (define (partition-image partition) + ;; Return as a file-like object, an image of the given PARTITION. A + ;; directory, filled by calling the PARTITION initializer procedure, is + ;; first created within the store. Then, an image of this directory is + ;; created using tools such as 'mke2fs' or 'mkdosfs', depending on the + ;; partition file-system type. + (let* ((os (image-operating-system image)) + (schema (local-file (search-path %load-path + "guix/store/schema.sql"))) + (graph (match inputs + (((names . _) ...) + names))) + (root-builder + (with-imported-modules* + (let* ((initializer #$(partition-initializer partition))) + (sql-schema #$schema) + + ;; Allow non-ASCII file names--e.g., 'nss-certs'--to be + ;; decoded. + (setenv "GUIX_LOCPATH" + #+(file-append glibc-utf8-locales "/lib/locale")) + (setlocale LC_ALL "en_US.utf8") + + (initializer #$output + #:references-graphs '#$graph + #:deduplicate? #f + #:system-directory #$os + #:bootloader-package + #$(bootloader-package bootloader) + #:bootcfg #$bootcfg + #:bootcfg-location + #$(bootloader-configuration-file bootloader))))) + (image-root + (computed-file "partition-image-root" root-builder + #:options `(#:references-graphs ,inputs))) + (type (partition-file-system partition)) + (image-builder + (with-imported-modules* + (let ((inputs '#$(list e2fsprogs dosfstools mtools))) + (set-path-environment-variable "PATH" '("bin" "sbin") inputs) + (make-partition-image #$(partition->gexp partition) + #$output + #$image-root))))) + (computed-file "partition.img" image-builder))) + + (define (partition->config partition) + ;; Return the genimage partition configuration for PARTITION. + (let ((label (partition-label partition)) + (dos-type (partition->dos-type partition)) + (image (partition-image partition))) + #~(format #f "~/partition ~a { + ~/~/partition-type = ~a + ~/~/image = \"~a\" + ~/}" #$label #$dos-type #$image))) + + (let* ((format (image-format image)) + (image-type (format->image-type format)) + (partitions (image-partitions image)) + (partitions-config (map partition->config partitions)) + (builder + #~(begin + (let ((format (@ (ice-9 format) format))) + (call-with-output-file #$output + (lambda (port) + (format port + "\ +image ~a { +~/~a {} +~{~a~^~%~} +}~%" #$genimage-name #$image-type (list #$@partitions-config)))))))) + (computed-file "genimage.cfg" builder))) + + (let* ((substitutable? (image-substitutable? image)) + (builder + (with-imported-modules* + (let ((inputs '#$(list genimage coreutils findutils))) + (set-path-environment-variable "PATH" '("bin" "sbin") inputs) + (genimage #$(image->genimage-cfg image) #$output)))) + (image-dir (computed-file "image-dir" builder))) + (computed-file name + #~(symlink + (string-append #$image-dir "/" #$genimage-name) + #$output) + #:options `(#:substitutable? ,substitutable?)))) + + +;; +;; ISO9660 image. +;; + +(define (has-guix-service-type? os) + "Return true if OS contains a service of the type GUIX-SERVICE-TYPE." + (not (not (srfi-1:find (lambda (service) + (eq? (service-kind service) guix-service-type)) + (operating-system-services os))))) + +(define* (system-iso9660-image image + #:key + (name "iso9660-image") + bootcfg + bootloader + register-closures? + (inputs '()) + (grub-mkrescue-environment '())) + "Return as a file-like object a bootable, stand-alone iso9660 image. + +INPUTS is a list of inputs (as for packages). When REGISTER-CLOSURES? is +true, register INPUTS in the store database of the image so that Guix can be +used in the image. " + (define root-label + (match (image-partitions image) + ((partition) + (partition-label partition)))) + + (define root-uuid + (match (image-partitions image) + ((partition) + (uuid-bytevector (partition-uuid partition))))) + + (let* ((os (image-operating-system image)) + (bootloader (bootloader-package bootloader)) + (compression? (image-compression? image)) + (substitutable? (image-substitutable? image)) + (schema (local-file (search-path %load-path + "guix/store/schema.sql"))) + (graph (match inputs + (((names . _) ...) + names))) + (root-builder + (with-imported-modules* + (sql-schema #$schema) + + ;; Allow non-ASCII file names--e.g., 'nss-certs'--to be decoded. + (setenv "GUIX_LOCPATH" + #+(file-append glibc-utf8-locales "/lib/locale")) + (setlocale LC_ALL "en_US.utf8") + + (initialize-root-partition #$output + #:references-graphs '#$graph + #:deduplicate? #f + #:system-directory #$os))) + (image-root + (computed-file "image-root" root-builder + #:options `(#:references-graphs ,inputs))) + (builder + (with-imported-modules* + (let* ((inputs '#$(list parted e2fsprogs dosfstools xorriso + sed grep coreutils findutils gawk))) + (set-path-environment-variable "PATH" '("bin" "sbin") inputs) + (make-iso9660-image #$xorriso + '#$grub-mkrescue-environment + #$bootloader + #$bootcfg + #$os + #$image-root + #$output + #:references-graphs '#$graph + #:register-closures? #$register-closures? + #:compression? #$compression? + #:volume-id #$root-label + #:volume-uuid #$root-uuid))))) + (computed-file name builder + #:options `(#:references-graphs ,inputs + #:substitutable? ,substitutable?)))) + + +;; +;; Image creation. +;; + +(define (root-partition? partition) + "Return true if PARTITION is the root partition, false otherwise." + (member 'boot (partition-flags partition))) + +(define (find-root-partition image) + "Return the root partition of the given IMAGE." + (srfi-1:find root-partition? (image-partitions image))) + +(define (image->root-file-system image) + "Return the IMAGE root partition file-system type." + (let ((format (image-format image))) + (if (eq? format 'iso9660) + "iso9660" + (partition-file-system (find-root-partition image))))) + +(define (root-size image) + "Return the root partition size of IMAGE." + (let* ((image-size (image-size image)) + (root-partition (find-root-partition image)) + (root-size (partition-size root-partition))) + (cond + ((and (eq? root-size 'guess) image-size) + image-size) + (else root-size)))) + +(define* (image-with-os base-image os) + "Return an image based on BASE-IMAGE but with the operating-system field set +to OS. Also set the UUID and the size of the root partition." + (define root-file-system + (srfi-1:find + (lambda (fs) + (string=? (file-system-mount-point fs) "/")) + (operating-system-file-systems os))) + + (let*-values (((partitions) (image-partitions base-image)) + ((root-partition other-partitions) + (srfi-1:partition root-partition? partitions))) + (image + (inherit base-image) + (operating-system os) + (partitions + (cons (partition + (inherit (car root-partition)) + (uuid (file-system-device root-file-system)) + (size (root-size base-image))) + other-partitions))))) + +(define (operating-system-for-image image) + "Return an operating-system based on the one specified in IMAGE, but +suitable for image creation. Assign an UUID to the root file-system, so that +it can be used for bootloading." + (define volatile-root? (image-volatile-root? image)) + + (define (root-uuid os) + ;; UUID of the root file system, computed in a deterministic fashion. + ;; This is what we use to locate the root file system so it has to be + ;; different from the user's own file system UUIDs. + (let ((type (if (eq? (image-format image) 'iso9660) + 'iso9660 + 'dce))) + (operating-system-uuid os type))) + + (let* ((root-file-system-type (image->root-file-system image)) + (base-os (image-operating-system image)) + (file-systems-to-keep + (srfi-1:remove + (lambda (fs) + (string=? (file-system-mount-point fs) "/")) + (operating-system-file-systems base-os))) + (format (image-format image)) + (os + (operating-system + (inherit base-os) + (initrd (lambda (file-systems . rest) + (apply (operating-system-initrd base-os) + file-systems + #:volatile-root? volatile-root? + rest))) + (bootloader (if (eq? format 'iso9660) + (bootloader-configuration + (inherit + (operating-system-bootloader base-os)) + (bootloader grub-mkrescue-bootloader)) + (operating-system-bootloader base-os))) + (file-systems (cons (file-system + (mount-point "/") + (device "/dev/placeholder") + (type root-file-system-type)) + file-systems-to-keep)))) + (uuid (root-uuid os))) + (operating-system + (inherit os) + (file-systems (cons (file-system + (mount-point "/") + (device uuid) + (type root-file-system-type)) + file-systems-to-keep))))) + +(define* (make-system-image image) + "Return the derivation of IMAGE. It can be a raw disk-image or an ISO9660 +image, depending on IMAGE format." + (define substitutable? (image-substitutable? image)) + + (let* ((os (operating-system-for-image image)) + (image* (image-with-os image os)) + (register-closures? (has-guix-service-type? os)) + (bootcfg (operating-system-bootcfg os)) + (bootloader (bootloader-configuration-bootloader + (operating-system-bootloader os)))) + (case (image-format image) + ((disk-image) + (system-disk-image image* + #:bootcfg bootcfg + #:bootloader bootloader + #:register-closures? register-closures? + #:inputs `(("system" ,os) + ("bootcfg" ,bootcfg)))) + ((iso9660) + (system-iso9660-image image* + #:bootcfg bootcfg + #:bootloader bootloader + #:register-closures? register-closures? + #:inputs `(("system" ,os) + ("bootcfg" ,bootcfg)) + #:grub-mkrescue-environment + '(("MKRESCUE_SED_MODE" . "mbr_hfs"))))))) + +(define (find-image file-system-type) + "Find and return an image that could match the given FILE-SYSTEM-TYPE. This +is useful to adapt to interfaces written before the addition of the +record." + ;; XXX: Add support for system and target here, or in the caller. + (match file-system-type + ("iso9660" iso9660-image) + (_ efi-disk-image))) + +(define (system-image image) + "Wrap 'make-system-image' call, so that it is used only if the given IMAGE +is supported. Otherwise, fallback to image creation in a VM. This is +temporary and should be removed once 'make-system-image' is able to deal with +all types of images." + (define substitutable? (image-substitutable? image)) + (define volatile-root? (image-volatile-root? image)) + + (let* ((image-os (image-operating-system image)) + (image-root-filesystem-type (image->root-file-system image)) + (bootloader (bootloader-configuration-bootloader + (operating-system-bootloader image-os))) + (bootloader-name (bootloader-name bootloader)) + (size (image-size image)) + (format (image-format image))) + (mbegin %store-monad + (if (and (or (eq? bootloader-name 'grub) + (eq? bootloader-name 'extlinux)) + (eq? format 'disk-image)) + ;; Fallback to image creation in a VM when it is not yet supported + ;; by this module. + (system-disk-image-in-vm image-os + #:disk-image-size size + #:file-system-type image-root-filesystem-type + #:volatile? volatile-root? + #:substitutable? substitutable?) + (lower-object + (make-system-image image)))))) + +;;; image.scm ends here diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index 2fdf954883..37840ce355 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -77,7 +77,7 @@ system-qemu-image/shared-store system-qemu-image/shared-store-script - system-disk-image + system-disk-image-in-vm system-docker-image virtual-machine @@ -604,14 +604,13 @@ system." ;;; VM and disk images. ;;; - -(define* (system-disk-image os - #:key - (name "disk-image") - (file-system-type "ext4") - (disk-image-size (* 900 (expt 2 20))) - (volatile? #t) - (substitutable? #t)) +(define* (system-disk-image-in-vm os + #:key + (name "disk-image") + (file-system-type "ext4") + (disk-image-size (* 900 (expt 2 20))) + (volatile? #t) + (substitutable? #t)) "Return the derivation of a disk image of DISK-IMAGE-SIZE bytes of the system described by OS. Said image can be copied on a USB stick as is. When VOLATILE? is true, the root file system is made volatile; this is useful diff --git a/gnu/tests/install.scm b/gnu/tests/install.scm index 23f60c68bf..2e5913953e 100644 --- a/gnu/tests/install.scm +++ b/gnu/tests/install.scm @@ -22,9 +22,11 @@ (define-module (gnu tests install) #:use-module (gnu) #:use-module (gnu bootloader extlinux) + #:use-module (gnu image) #:use-module (gnu tests) #:use-module (gnu tests base) #:use-module (gnu system) + #:use-module (gnu system image) #:use-module (gnu system install) #:use-module (gnu system vm) #:use-module ((gnu build vm) #:select (qemu-command)) @@ -229,14 +231,18 @@ packages defined in installation-os." ;; we cheat a little bit by adding TARGET to its GC ;; roots. This way, we know 'guix system init' will ;; succeed. - (image (system-disk-image - (operating-system-with-gc-roots - os (list target)) - #:disk-image-size install-size - #:file-system-type - installation-disk-image-file-system-type - ;; Don't provide substitutes; too big. - #:substitutable? #f))) + (image + (system-image + (image + (inherit + (find-image + installation-disk-image-file-system-type)) + (size install-size) + (operating-system + (operating-system-with-gc-roots + os (list target))) + ;; Don't provide substitutes; too big. + (substitutable? #f))))) (define install (with-imported-modules '((guix build utils) (gnu build marionette)) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 2664c66a30..3c8691a08c 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -54,9 +54,11 @@ #:autoload (gnu build linux-modules) (device-module-aliases matching-modules) #:use-module (gnu system linux-initrd) + #:use-module (gnu image) #:use-module (gnu system) #:use-module (gnu bootloader) #:use-module (gnu system file-systems) + #:use-module (gnu system image) #:use-module (gnu system mapped-devices) #:use-module (gnu system linux-container) #:use-module (gnu system uuid) @@ -692,12 +694,11 @@ checking this by themselves in their 'check' procedure." (* 70 (expt 2 20))) #:mappings mappings)) ((disk-image) - (system-disk-image os - #:name (match file-system-type - ("iso9660" "image.iso") - (_ "disk-image")) - #:disk-image-size image-size - #:file-system-type file-system-type)) + (system-image + (image + (inherit (find-image file-system-type)) + (size image-size) + (operating-system os)))) ((docker-image) (system-docker-image os)))) -- cgit 1.4.1 From 77f5296236693fe6ade4eee1dfc077c18dc2204c Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Tue, 28 Apr 2020 16:37:57 +0200 Subject: vm: Remove obsolete procedures. * gnu/build/vm.scm (install-efi, make-iso9660-image): Remove those procedures that are now implemented in (gnu build image) module, (initialize-hard-disk): remove efi support. * gnu/system/vm.scm (iso9660-image): Remove it, (qemu-image): adapt it to remove ISO9660 support. --- gnu/build/vm.scm | 156 +----------------------------------------------------- gnu/system/vm.scm | 151 ++++++---------------------------------------------- 2 files changed, 18 insertions(+), 289 deletions(-) (limited to 'gnu/system') diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm index bc6071daa9..1a888b1a51 100644 --- a/gnu/build/vm.scm +++ b/gnu/build/vm.scm @@ -57,8 +57,7 @@ estimated-partition-size root-partition-initializer initialize-partition-table - initialize-hard-disk - make-iso9660-image)) + initialize-hard-disk)) ;;; Commentary: ;;; @@ -417,159 +416,6 @@ SYSTEM-DIRECTORY is the name of the directory of the 'system' derivation." (mkdir-p directory) (symlink bootcfg (string-append directory "/bootcfg")))) -(define (install-efi grub esp config-file) - "Write a self-contained GRUB EFI loader to the mounted ESP using CONFIG-FILE." - (let* ((system %host-type) - ;; Hard code the output location to a well-known path recognized by - ;; compliant firmware. See "3.5.1.1 Removable Media Boot Behaviour": - ;; http://www.uefi.org/sites/default/files/resources/UEFI%20Spec%202_6.pdf - (grub-mkstandalone (string-append grub "/bin/grub-mkstandalone")) - (efi-directory (string-append esp "/EFI/BOOT")) - ;; Map grub target names to boot file names. - (efi-targets (cond ((string-prefix? "x86_64" system) - '("x86_64-efi" . "BOOTX64.EFI")) - ((string-prefix? "i686" system) - '("i386-efi" . "BOOTIA32.EFI")) - ((string-prefix? "armhf" system) - '("arm-efi" . "BOOTARM.EFI")) - ((string-prefix? "aarch64" system) - '("arm64-efi" . "BOOTAA64.EFI"))))) - ;; grub-mkstandalone requires a TMPDIR to prepare the firmware image. - (setenv "TMPDIR" esp) - - (mkdir-p efi-directory) - (invoke grub-mkstandalone "-O" (car efi-targets) - "-o" (string-append efi-directory "/" - (cdr efi-targets)) - ;; Graft the configuration file onto the image. - (string-append "boot/grub/grub.cfg=" config-file)))) - -(define* (make-iso9660-image xorriso grub-mkrescue-environment - grub config-file os-drv target - #:key (volume-id "Guix_image") (volume-uuid #f) - register-closures? (closures '())) - "Given a GRUB package, creates an iso image as TARGET, using CONFIG-FILE as -GRUB configuration and OS-DRV as the stuff in it." - (define grub-mkrescue - (string-append grub "/bin/grub-mkrescue")) - - (define grub-mkrescue-sed.sh - (string-append xorriso "/bin/grub-mkrescue-sed.sh")) - - (define target-store - (string-append "/tmp/root" (%store-directory))) - - (define items - ;; The store items to add to the image. - (delete-duplicates - (append-map (lambda (closure) - (map store-info-item - (call-with-input-file (string-append "/xchg/" closure) - read-reference-graph))) - closures))) - - (populate-root-file-system os-drv "/tmp/root") - (mount (%store-directory) target-store "" MS_BIND) - - (when register-closures? - (display "registering closures...\n") - (for-each (lambda (closure) - (register-closure - "/tmp/root" - (string-append "/xchg/" closure) - - ;; TARGET-STORE is a read-only bind-mount so we shouldn't try - ;; to modify it. - #:deduplicate? #f - #:reset-timestamps? #f)) - closures) - (register-bootcfg-root "/tmp/root" config-file)) - - ;; 'grub-mkrescue' calls out to mtools programs to create 'efi.img', a FAT - ;; file system image, and mtools honors SOURCE_DATE_EPOCH for the mtime of - ;; those files. The epoch for FAT is Jan. 1st 1980, not 1970, so choose - ;; that. - (setenv "SOURCE_DATE_EPOCH" - (number->string - (time-second - (date->time-utc (make-date 0 0 0 0 1 1 1980 0))))) - - ;; Our patched 'grub-mkrescue' honors this environment variable and passes - ;; it to 'mformat', which makes it the serial number of 'efi.img'. This - ;; allows for deterministic builds. - (setenv "GRUB_FAT_SERIAL_NUMBER" - (number->string (if volume-uuid - - ;; On 32-bit systems the 2nd argument must be - ;; lower than 2^32. - (string-hash (iso9660-uuid->string volume-uuid) - (- (expt 2 32) 1)) - - #x77777777) - 16)) - - (setenv "MKRESCUE_SED_MODE" "original") - (setenv "MKRESCUE_SED_XORRISO" (string-append xorriso - "/bin/xorriso")) - (setenv "MKRESCUE_SED_IN_EFI_NO_PT" "yes") - (for-each (match-lambda - ((name . value) (setenv name value))) - grub-mkrescue-environment) - - (let ((pipe - (apply open-pipe* OPEN_WRITE - grub-mkrescue - (string-append "--xorriso=" grub-mkrescue-sed.sh) - "-o" target - (string-append "boot/grub/grub.cfg=" config-file) - "etc=/tmp/root/etc" - "var=/tmp/root/var" - "run=/tmp/root/run" - ;; /mnt is used as part of the installation - ;; process, as the mount point for the target - ;; file system, so create it. - "mnt=/tmp/root/mnt" - "-path-list" "-" - "--" - - ;; Set all timestamps to 1. - "-volume_date" "all_file_dates" "=1" - - ;; ‘zisofs’ compression reduces the total image size by ~60%. - "-zisofs" "level=9:block_size=128k" ; highest compression - ;; It's transparent to our Linux-Libre kernel but not to GRUB. - ;; Don't compress the kernel, initrd, and other files read by - ;; grub.cfg, as well as common already-compressed file names. - "-find" "/" "-type" "f" - ;; XXX Even after "--" above, and despite documentation claiming - ;; otherwise, "-or" is stolen by grub-mkrescue which then chokes - ;; on it (as ‘-o …’) and dies. Don't use "-or". - "-not" "-wholename" "/boot/*" - "-not" "-wholename" "/System/*" - "-not" "-name" "unicode.pf2" - "-not" "-name" "bzImage" - "-not" "-name" "*.gz" ; initrd & all man pages - "-not" "-name" "*.png" ; includes grub-image.png - "-exec" "set_filter" "--zisofs" - "--" - - "-volid" (string-upcase volume-id) - (if volume-uuid - `("-volume_date" "uuid" - ,(string-filter (lambda (value) - (not (char=? #\- value))) - (iso9660-uuid->string - volume-uuid))) - `())))) - ;; Pass lines like 'gnu/store/…-x=/gnu/store/…-x' corresponding to the - ;; '-path-list -' option. - (for-each (lambda (item) - (format pipe "~a=~a~%" - (string-drop item 1) item)) - items) - (unless (zero? (close-pipe pipe)) - (error "oh, my! grub-mkrescue failed" grub-mkrescue)))) - (define* (initialize-hard-disk device #:key bootloader-package diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index 37840ce355..1cab8997b4 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -269,95 +269,6 @@ substitutable." (eq? (service-kind service) guix-service-type)) (operating-system-services os))))) -(define* (iso9660-image #:key - (name "iso9660-image") - file-system-label - file-system-uuid - (system (%current-system)) - (target (%current-target-system)) - (qemu qemu-minimal) - os - bootcfg-drv - bootloader - (register-closures? (has-guix-service-type? os)) - (inputs '()) - (grub-mkrescue-environment '()) - (substitutable? #t)) - "Return a bootable, stand-alone iso9660 image. - -INPUTS is a list of inputs (as for packages)." - (define schema - (and register-closures? - (local-file (search-path %load-path - "guix/store/schema.sql")))) - - (expression->derivation-in-linux-vm - name - (with-extensions gcrypt-sqlite3&co - (with-imported-modules `(,@(source-module-closure '((gnu build vm) - (guix store database) - (guix build utils)) - #:select? not-config?) - ((guix config) => ,(make-config.scm))) - #~(begin - (use-modules (gnu build vm) - (guix store database) - (guix build utils)) - - (sql-schema #$schema) - - ;; Allow non-ASCII file names--e.g., 'nss-certs'--to be decoded. - (setenv "GUIX_LOCPATH" - #+(file-append glibc-utf8-locales "/lib/locale")) - (setlocale LC_ALL "en_US.utf8") - - (let ((inputs - '#$(append (list parted e2fsprogs dosfstools xorriso) - (map canonical-package - (list sed grep coreutils findutils gawk)))) - - - (graphs '#$(match inputs - (((names . _) ...) - names))) - ;; This variable is unused but allows us to add INPUTS-TO-COPY - ;; as inputs. - (to-register - '#$(map (match-lambda - ((name thing) thing) - ((name thing output) `(,thing ,output))) - inputs))) - - (set-path-environment-variable "PATH" '("bin" "sbin") inputs) - (make-iso9660-image #$xorriso - '#$grub-mkrescue-environment - #$(bootloader-package bootloader) - #$bootcfg-drv - #$os - "/xchg/guixsd.iso" - #:register-closures? #$register-closures? - #:closures graphs - #:volume-id #$file-system-label - #:volume-uuid #$(and=> file-system-uuid - uuid-bytevector)))))) - #:system system - #:target target - - ;; Keep a local file system for /tmp so that we can populate it directly as - ;; root and have files owned by root. See . - #:file-systems (remove (lambda (file-system) - (string=? (file-system-mount-point file-system) - "/tmp")) - %linux-vm-file-systems) - - #:make-disk-image? #f - #:single-file-output? #t - #:references-graphs inputs - #:substitutable? substitutable? - - ;; Xorriso seems to be quite memory-hungry, so increase the VM's RAM size. - #:memory-size 512)) - (define* (qemu-image #:key (name "qemu-image") (system (%current-system)) @@ -618,25 +529,14 @@ to USB sticks meant to be read-only. SUBSTITUTABLE? determines whether the returned derivation should be marked as substitutable." - (define normalize-label - ;; ISO labels are all-caps (case-insensitive), but since - ;; 'find-partition-by-label' is case-sensitive, make it all-caps here. - (if (string=? "iso9660" file-system-type) - string-upcase - identity)) - (define root-label - ;; Volume name of the root file system. - (normalize-label "Guix_image")) + "Guix_image") (define (root-uuid os) ;; UUID of the root file system, computed in a deterministic fashion. ;; This is what we use to locate the root file system so it has to be ;; different from the user's own file system UUIDs. - (operating-system-uuid os - (if (string=? file-system-type "iso9660") - 'iso9660 - 'dce))) + (operating-system-uuid os 'dce)) (define file-systems-to-keep (remove (lambda (fs) @@ -653,11 +553,7 @@ substitutable." #:volatile-root? volatile? rest))) - (bootloader (if (string=? "iso9660" file-system-type) - (bootloader-configuration - (inherit (operating-system-bootloader os)) - (bootloader grub-mkrescue-bootloader)) - (operating-system-bootloader os))) + (bootloader (operating-system-bootloader os)) ;; Force our own root file system. (We need a "/" file system ;; to call 'root-uuid'.) @@ -675,33 +571,20 @@ substitutable." (type file-system-type)) file-systems-to-keep)))) (bootcfg (operating-system-bootcfg os))) - (if (string=? "iso9660" file-system-type) - (iso9660-image #:name name - #:file-system-label root-label - #:file-system-uuid uuid - #:os os - #:bootcfg-drv bootcfg - #:bootloader (bootloader-configuration-bootloader - (operating-system-bootloader os)) - #:inputs `(("system" ,os) - ("bootcfg" ,bootcfg)) - #:grub-mkrescue-environment - '(("MKRESCUE_SED_MODE" . "mbr_hfs")) - #:substitutable? substitutable?) - (qemu-image #:name name - #:os os - #:bootcfg-drv bootcfg - #:bootloader (bootloader-configuration-bootloader - (operating-system-bootloader os)) - #:disk-image-size disk-image-size - #:disk-image-format "raw" - #:file-system-type file-system-type - #:file-system-label root-label - #:file-system-uuid uuid - #:copy-inputs? #t - #:inputs `(("system" ,os) - ("bootcfg" ,bootcfg)) - #:substitutable? substitutable?)))) + (qemu-image #:name name + #:os os + #:bootcfg-drv bootcfg + #:bootloader (bootloader-configuration-bootloader + (operating-system-bootloader os)) + #:disk-image-size disk-image-size + #:disk-image-format "raw" + #:file-system-type file-system-type + #:file-system-label root-label + #:file-system-uuid uuid + #:copy-inputs? #t + #:inputs `(("system" ,os) + ("bootcfg" ,bootcfg)) + #:substitutable? substitutable?))) (define* (system-qemu-image os #:key -- cgit 1.4.1 From d6c43d7bc1543f22bb850a2bad529bf3d60789ad Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 7 May 2020 12:35:35 +0200 Subject: guix system: 'docker-image' honors '--network'. * gnu/system/vm.scm (system-docker-image): Add #:shared-network? and pass it to 'containerized-operating-system'. (qemu-image): * guix/scripts/system.scm (system-derivation-for-action): Pass #:shared-network? to 'system-docker-image'. * doc/guix.texi (Invoking guix system): Document it. --- doc/guix.texi | 4 ++++ gnu/system/vm.scm | 20 +++++++++++++------- guix/scripts/system.scm | 2 +- 3 files changed, 18 insertions(+), 8 deletions(-) (limited to 'gnu/system') diff --git a/doc/guix.texi b/doc/guix.texi index 6893a914dc..f8e137817c 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -27066,6 +27066,10 @@ example, if you intend to build software using Guix inside of the Docker container, you may need to pass the @option{--privileged} option to @code{docker create}. +Last, the @code{--network} option applies to @command{guix system +docker-image}: it produces an image where network is supposedly shared +with the host, and thus without services like nscd or NetworkManager. + @item container Return a script to run the operating system declared in @var{file} within a container. Containers are a set of lightweight isolation diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index 1cab8997b4..2e82e12be2 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -419,13 +419,17 @@ system." (define* (system-docker-image os #:key (name "guix-docker-image") - (register-closures? (has-guix-service-type? os))) + (register-closures? (has-guix-service-type? os)) + shared-network?) "Build a docker image. OS is the desired . NAME is the -base name to use for the output file. When REGISTER-CLOSURES? is true, -register the closure of OS with Guix in the resulting Docker image. By -default, REGISTER-CLOSURES? is set to true only if a service of type -GUIX-SERVICE-TYPE is present in the services definition of the operating -system." +base name to use for the output file. When SHARED-NETWORK? is true, assume +that the container will share network with the host and thus doesn't need a +DHCP client, nscd, and so on. + +When REGISTER-CLOSURES? is true, register the closure of OS with Guix in the +resulting Docker image. By default, REGISTER-CLOSURES? is set to true only if +a service of type GUIX-SERVICE-TYPE is present in the services definition of +the operating system." (define schema (and register-closures? (local-file (search-path %load-path @@ -442,7 +446,9 @@ system." (let ((os (operating-system-with-gc-roots - (containerized-operating-system os '()) + (containerized-operating-system os '() + #:shared-network? + shared-network?) (list boot-program))) (name (string-append name ".tar.gz")) (graph "system-graph")) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 3c8691a08c..3efd113ac8 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -700,7 +700,7 @@ checking this by themselves in their 'check' procedure." (size image-size) (operating-system os)))) ((docker-image) - (system-docker-image os)))) + (system-docker-image os #:shared-network? container-shared-network?)))) (define (maybe-suggest-running-guix-pull) "Suggest running 'guix pull' if this has never been done before." -- cgit 1.4.1 From dd0804c67e99914eecc471fdb92f4220425a1cbc Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 8 May 2020 16:15:33 +0200 Subject: services: Add descriptions. * gnu/services/dbus.scm (polkit-service-type)[description]: New field. * gnu/services/dict.scm (dicod-service-type)[description]: New field. * gnu/services/dns.scm (knot-service-type)[description]: New field. * gnu/services/networking.scm (dhcpd-service-type)[description]: New field. * gnu/services/shepherd.scm (shepherd-root-service-type)[description]: New field. * gnu/services/xorg.scm (slim-service-type)[description]: New field. (screen-locker-service-type)[description]: New field. * gnu/system/pam.scm (pam-root-service-type)[description]: New field. * gnu/system/shadow.scm (account-service-type)[description]: New field. --- gnu/services/dbus.scm | 10 ++++++++-- gnu/services/dict.scm | 9 +++++++-- gnu/services/dns.scm | 5 ++++- gnu/services/networking.scm | 4 +++- gnu/services/shepherd.scm | 6 +++++- gnu/services/xorg.scm | 12 +++++++++--- gnu/system/pam.scm | 10 ++++++++-- gnu/system/shadow.scm | 5 ++++- 8 files changed, 48 insertions(+), 13 deletions(-) (limited to 'gnu/system') diff --git a/gnu/services/dbus.scm b/gnu/services/dbus.scm index 7b3c8100e2..e015d3f68d 100644 --- a/gnu/services/dbus.scm +++ b/gnu/services/dbus.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2019 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2019, 2020 Ludovic Courtès ;;; Copyright © 2015 Sou Bunnbu ;;; ;;; This file is part of GNU Guix. @@ -363,7 +363,13 @@ tuples, are all set as environment variables when the bus daemon launches it." (append (polkit-configuration-actions config) actions))))) - (default-value (polkit-configuration)))) + (default-value (polkit-configuration)) + (description + "Run the +@uref{http://www.freedesktop.org/wiki/Software/polkit/, Polkit privilege +management service}, which allows system administrators to grant access to +privileged operations in a structured way. Polkit is a requirement for most +desktop environments, such as GNOME."))) (define* (polkit-service #:key (polkit polkit)) "Return a service that runs the diff --git a/gnu/services/dict.scm b/gnu/services/dict.scm index 70b05e8f80..519ed3eca2 100644 --- a/gnu/services/dict.scm +++ b/gnu/services/dict.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2016 Sou Bunnbu -;;; Copyright © 2016, 2017, 2018 Ludovic Courtès +;;; Copyright © 2016, 2017, 2018, 2020 Ludovic Courtès ;;; Copyright © 2017 Huang Ying ;;; ;;; This file is part of GNU Guix. @@ -174,7 +174,12 @@ database { (const %dicod-activation)) (service-extension shepherd-root-service-type dicod-shepherd-service))) - (default-value (dicod-configuration)))) + (default-value (dicod-configuration)) + (description + "Run @command{dicod}, the dictionary server of +@uref{https://www.gnu.org/software/dico, GNU Dico}. @command{dicod} +implements the standard DICT protocol supported by clients such as +@command{dico} and GNOME Dictionary."))) (define* (dicod-service #:key (config (dicod-configuration))) "Return a service that runs the @command{dicod} daemon, an implementation diff --git a/gnu/services/dns.scm b/gnu/services/dns.scm index 478c837d13..9caa3611be 100644 --- a/gnu/services/dns.scm +++ b/gnu/services/dns.scm @@ -639,7 +639,10 @@ (service-extension activation-service-type knot-activation) (service-extension account-service-type - (const %knot-accounts)))))) + (const %knot-accounts)))) + (description + "Run @uref{https://www.knot-dns.cz/, Knot}, an authoritative +name server for the @acronym{DNS, Domain Name System}."))) ;;; diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 383b2b0d04..d6b0aee357 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -335,7 +335,9 @@ Protocol (DHCP) client, on all the non-loopback network interfaces." (name 'dhcpd) (extensions (list (service-extension shepherd-root-service-type dhcpd-shepherd-service) - (service-extension activation-service-type dhcpd-activation))))) + (service-extension activation-service-type dhcpd-activation))) + (description "Run a DHCP (Dynamic Host Configuration Protocol) daemon. The +daemon is responsible for allocating IP addresses to its client."))) ;;; diff --git a/gnu/services/shepherd.scm b/gnu/services/shepherd.scm index 2f30c6c907..ecdf2f242e 100644 --- a/gnu/services/shepherd.scm +++ b/gnu/services/shepherd.scm @@ -105,7 +105,11 @@ (extensions (list (service-extension boot-service-type shepherd-boot-gexp) (service-extension profile-service-type - (const (list shepherd))))))) + (const (list shepherd))))) + (description + "Run the GNU Shepherd as PID 1---i.e., the operating system's first +process. The Shepherd takes care of managing services such as daemons by +ensuring they are started and stopped in the right order."))) (define %shepherd-root-service ;; The root shepherd service, aka. PID 1. Its parameter is a list of diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index d0196a299e..6441400ffd 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017 Andy Wingo -;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2019 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2019, 2020 Ludovic Courtès ;;; Copyright © 2015 Sou Bunnbu ;;; Copyright © 2018, 2019 Timothy Sample ;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen @@ -619,7 +619,9 @@ reboot_cmd " shepherd "/sbin/reboot\n" (service-extension profile-service-type (const (list xterm))))) - (default-value (slim-configuration))))) + (default-value (slim-configuration)) + (description + "Run the SLiM graphical login manager for X11.")))) (define-deprecated (slim-service #:key (slim slim) (allow-empty-passwords? #t) auto-login? @@ -691,7 +693,11 @@ theme." (list (service-extension pam-root-service-type screen-locker-pam-services) (service-extension setuid-program-service-type - screen-locker-setuid-programs))))) + screen-locker-setuid-programs))) + (description + "Allow the given program to be used as a screen locker for +the graphical server by making it setuid-root, so it can authenticate users, +and by creating a PAM service for it."))) (define* (screen-locker-service package #:optional diff --git a/gnu/system/pam.scm b/gnu/system/pam.scm index 85f75517b1..ad02586be8 100644 --- a/gnu/system/pam.scm +++ b/gnu/system/pam.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2019 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2019, 2020 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -367,7 +367,13 @@ strings or string-valued gexps." ;; Arguments include as well as procedures. (compose concatenate) - (extend extend-configuration))) + (extend extend-configuration) + (description + "Configure the Pluggable Authentication Modules (PAM) for all +the specified @dfn{PAM services}. Each PAM service corresponds to a program, +such as @command{login} or @command{sshd}, and specifies for instance how the +program may authenticate users or what it should do when opening a new +session."))) (define* (pam-root-service base #:key (transform identity)) "The \"root\" PAM service, which collects instance and turns diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm index a6f1d806cf..a69339bc07 100644 --- a/gnu/system/shadow.scm +++ b/gnu/system/shadow.scm @@ -378,7 +378,10 @@ the /etc/skel directory for those." (service-extension user-processes-service-type (const '(user-homes))) (service-extension etc-service-type - etc-files))))) + etc-files))) + (description + "Ensure the specified user accounts and groups exist, as well +as each account home directory."))) (define (account-service accounts+groups skeletons) "Return a that takes care of user accounts and user groups, with -- cgit 1.4.1 From 4daa7a85b41c10d70893675edf1ac61ebd3bf746 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 14 May 2020 23:20:14 +0200 Subject: locale: Use the native gzip and libc when building locales. This fixes system cross-compilation. * gnu/system/locale.scm (single-locale-directory)[build]: Use the native GZIP and LIBC. --- gnu/system/locale.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnu/system') diff --git a/gnu/system/locale.scm b/gnu/system/locale.scm index ec1b71e061..689d238d1a 100644 --- a/gnu/system/locale.scm +++ b/gnu/system/locale.scm @@ -106,7 +106,7 @@ of LIBC." ;; 'localedef' executes 'gzip' to access compressed locale sources. (setenv "PATH" - (string-append #$gzip "/bin:" #$libc "/bin")) + (string-append #+gzip "/bin:" #+libc "/bin")) (setvbuf (current-output-port) 'line) (setvbuf (current-error-port) 'line) -- cgit 1.4.1