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 v1.2.3 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 v1.2.3 From 82782d8cecec974c03ec95824f62455f0a795815 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= 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/system/vm.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gnu/system') 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 v1.2.3 From 4d1ff68d731fdc47ca1220863fee07a685a26616 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= 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/system/vm.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gnu/system') 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 v1.2.3 From cd45d656f1e8746fadacfbffd5740d22228c4c21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= 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/system/vm.scm | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'gnu/system') 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 v1.2.3 From a9f7993ea719c5368ee3e64b813b169eece4e6a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= 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/system/hurd.scm | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 gnu/system/hurd.scm (limited to 'gnu/system') 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 v1.2.3 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 v1.2.3 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 v1.2.3 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 v1.2.3 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 v1.2.3 From 5fbf4f85e1bfe028cc17d6fbcd9e337bf7a9e389 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= 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 v1.2.3 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 v1.2.3 From c62126940419d2a6c21e16e21a973990fb11e054 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= 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 v1.2.3 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 v1.2.3 From 5084fd38541a5fc233f3299e10a33c3a38a7173f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= 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 v1.2.3 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 v1.2.3 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 v1.2.3 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 v1.2.3 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 v1.2.3 From 0eed77127592323d89f56c215a15374a1aaae110 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= 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 v1.2.3