[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
14/16: system: hurd: Create a proper profile.
From: |
guix-commits |
Subject: |
14/16: system: hurd: Create a proper profile. |
Date: |
Sat, 11 Apr 2020 15:09:14 -0400 (EDT) |
civodul pushed a commit to branch core-updates
in repository guix.
commit c62126940419d2a6c21e16e21a973990fb11e054
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.
[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(-)
diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm
index 7cf7476..b35a99c 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
+;; <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 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
- branch core-updates updated (916ec91 -> 5084fd3), guix-commits, 2020/04/11
- 01/16: database: 'reset-timestamps' can optionally preserve permissions., guix-commits, 2020/04/11
- 02/16: vm: Preserve file permissions on /dev., guix-commits, 2020/04/11
- 04/16: linux-boot: Add 'make-hurd-device-nodes'., guix-commits, 2020/04/11
- 03/16: linux-boot: 'make-essential-device-nodes' root parameter is optional., guix-commits, 2020/04/11
- 05/16: vm: Make the device node procedure a parameter., guix-commits, 2020/04/11
- 09/16: system: hurd: Add /etc/{passwd,shadow}., guix-commits, 2020/04/11
- 08/16: system: hurd: Add ttys symlink in "/etc/ttys"., guix-commits, 2020/04/11
- 10/16: system: hurd: Add "/bin/sh" symlink., guix-commits, 2020/04/11
- 11/16: system: hurd: Create /etc/{hostname,motd,login} and /root., guix-commits, 2020/04/11
- 14/16: system: hurd: Create a proper profile.,
guix-commits <=
- 07/16: system: hurd: Add "/etc/fstab"., guix-commits, 2020/04/11
- 13/16: gnu: hurd: "/libexec/rc" spawns the console client., guix-commits, 2020/04/11
- 12/16: system: hurd: Add root profile., guix-commits, 2020/04/11
- 06/16: Add (gnu system hurd)., guix-commits, 2020/04/11
- 15/16: system: hurd: Add net-base and inetutils, and /etc/{services, protocols}., guix-commits, 2020/04/11
- 16/16: system: hurd: Add guile-candy., guix-commits, 2020/04/11