[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
44/62: system: hurd: Create a proper profile.
From: |
guix-commits |
Subject: |
44/62: system: hurd: Create a proper profile. |
Date: |
Sat, 11 Apr 2020 11:35:54 -0400 (EDT) |
janneke pushed a commit to branch wip-hurd-vm
in repository guix.
commit bee71e4e2f3dd921a386263df51a484f1f1ce2bf
Author: Ludovic Courtès <address@hidden>
AuthorDate: Wed Apr 8 16:36:08 2020 +0200
system: hurd: Create a proper profile.
* gnu/system/hurd.scm (compile-manifest): New procedure.
(cross-hurd-image)[for-hurd, hurd-os]: Remove.
[system-profile]: New variable.
[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 | 62 +++++++++++++++++++++++++++++++++--------------------
1 file changed, 39 insertions(+), 23 deletions(-)
diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm
index 9474bf6..17a7627 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 admin)
@@ -40,20 +41,30 @@
;;;
;;; Code:
+;; XXX: Surely this belongs in (guix profiles), but perhaps we need high-level
+;; <profile> objects so one can specify hooks, etc.?
+(define-gexp-compiler (compile-manifest (manifest
+ (@@ (guix profiles) <manifest>))
+ 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 guile-3.0 guix openssh sed))
(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
- (directory-union "gnu+hurd"
- (cons (with-parameters ((%current-system "i686-linux"))
- gnumach)
- (map for-hurd %base-packages/hurd))))
+ (define system-profile
+ (map-manifest-entries
+ (lambda (entry)
+ (manifest-entry
+ (inherit entry)
+ (item (with-parameters ((%current-target-system "i586-pc-gnu"))
+ (manifest-entry-item entry)))))
+ (packages->manifest %base-packages/hurd)))
(define grub.cfg
(let ((hurd (with-parameters ((%current-target-system "i586-pc-gnu"))
@@ -81,17 +92,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
@@ -116,6 +116,19 @@ guixbuilder:x:1:1:guixbuilder:/var/empty:/bin/no-sh
"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)
@@ -140,7 +153,10 @@ guixbuilder:x:1:1:guixbuilder:/var/empty:/bin/no-sh
;; 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/group" -> ,group)
("/etc/passwd" -> ,passwd)
@@ -171,15 +187,15 @@ guixbuilder:x:1:1:guixbuilder:/var/empty:/bin/no-sh
(qemu-image #:file-system-type "ext2"
#:file-system-options '("-o" "hurd")
- #:inputs `(("system" ,hurd-os)
+ #:inputs `(("system" ,system-profile)
("grub.cfg" ,grub.cfg)
("fstab" ,fstab)
("passwd" ,passwd)
("group" ,group)
- ("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
- 52/62: gnu: guix: Add dependency on `hurd' when building for the Hurd., (continued)
- 52/62: gnu: guix: Add dependency on `hurd' when building for the Hurd., guix-commits, 2020/04/11
- 50/62: gnu: Fix typo., guix-commits, 2020/04/11
- 58/62: HACK build.sh, 2GiB disk., guix-commits, 2020/04/11
- 59/62: Revert "compile: Run the load phase within 'with-target'.", guix-commits, 2020/04/11
- 24/62: vm: Preserve file permissions on /dev., guix-commits, 2020/04/11
- 29/62: linux-boot: Add 'make-hurd-device-nodes'., guix-commits, 2020/04/11
- 31/62: gnu: guix: Fix cross-compilation., guix-commits, 2020/04/11
- 37/62: gnu: openssh: Build fix for the Hurd., guix-commits, 2020/04/11
- 33/62: gnu: libdaemon: Allow cross-compilation., guix-commits, 2020/04/11
- 43/62: gnu: hurd: "/libexec/rc" spawns the console client., guix-commits, 2020/04/11
- 44/62: system: hurd: Create a proper profile.,
guix-commits <=
- 45/62: system: hurd: Add net-base and inetutils., guix-commits, 2020/04/11
- 61/62: REMOVEME gnu: guix: Bugfix for cross compiling to the Hurd., guix-commits, 2020/04/11
- 57/62: DRAFT daemon: Create wrapper for mount (2)., guix-commits, 2020/04/11
- 60/62: Revert "records: Have ABI check work well for cross-compilation.", guix-commits, 2020/04/11
- 53/62: gnu: guix: Cross-build fix: override compressors., guix-commits, 2020/04/11
- 56/62: DRAFT gnu: hurd: Add `libhurdutil' patch., guix-commits, 2020/04/11
- 26/62: gnu: libgcrypt: Fix cross-compilation., guix-commits, 2020/04/11
- 27/62: gnu: openssl: Support cross-compilation to the Hurd., guix-commits, 2020/04/11
- 28/62: gnu: guix: Apply courage for the Hurd., guix-commits, 2020/04/11
- 41/62: system: hurd: Add /etc/group., guix-commits, 2020/04/11