[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
44/52: system: hurd: Create a proper profile.
From: |
guix-commits |
Subject: |
44/52: system: hurd: Create a proper profile. |
Date: |
Thu, 9 Apr 2020 13:29:13 -0400 (EDT) |
janneke pushed a commit to branch wip-hurd-vm
in repository guix.
commit 9dd48567cbad1af4439f1d460b7050f848005d44
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
- 43/52: gnu: hurd: "/libexec/rc" spawns the console client., (continued)
- 43/52: gnu: hurd: "/libexec/rc" spawns the console client., guix-commits, 2020/04/09
- 41/52: system: hurd: Add /etc/group., guix-commits, 2020/04/09
- 42/52: gnu: libdaemon: Cross-build with --localstatedir=/var., guix-commits, 2020/04/09
- 40/52: system: hurd: Add root profile., guix-commits, 2020/04/09
- 45/52: system: hurd: Add net-base and inetutils., guix-commits, 2020/04/09
- 39/52: gnu: guile-json: Cross-build fix., guix-commits, 2020/04/09
- 48/52: REMOVEME gnu: guix: Bugfix for cross compiling to the Hurd., guix-commits, 2020/04/09
- 51/52: DRAFT daemon: Create wrapper for mount (2)., guix-commits, 2020/04/09
- 50/52: DRAFT gnu: hurd: Add `libhurdutil' patch., guix-commits, 2020/04/09
- 46/52: system: hurd: Add guile-candy., guix-commits, 2020/04/09
- 44/52: system: hurd: Create a proper profile.,
guix-commits <=
- 47/52: system: hurd: Ensure propagated inputs are also cross-built., guix-commits, 2020/04/09
- 49/52: DRAFT gnu: guix: Cross-compilation fixup for wrap-program., guix-commits, 2020/04/09
- 52/52: HACK gnu: guix: Bump to HEAD~1: daemon: Create wrapper for mount (2)., guix-commits, 2020/04/09