[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
40/52: system: hurd: Add root profile.
From: |
guix-commits |
Subject: |
40/52: system: hurd: Add root profile. |
Date: |
Thu, 9 Apr 2020 13:29:12 -0400 (EDT) |
janneke pushed a commit to branch wip-hurd-vm
in repository guix.
commit 6770f69d70cdd70fdceb3665b21d31c1b2e114bc
Author: Jan (janneke) Nieuwenhuizen <address@hidden>
AuthorDate: Wed Apr 8 08:04:52 2020 +0200
system: hurd: Add root profile.
* gnu/system/hurd.scm (%base-packages/hurd): New variable.
Include file, findutils and guile-3.0.
(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 | 61 +++++++++++++++++++++++++++++++++--------------------
1 file changed, 38 insertions(+), 23 deletions(-)
diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm
index 6e5789e..3d9369d 100644
--- a/gnu/system/hurd.scm
+++ b/gnu/system/hurd.scm
@@ -24,9 +24,12 @@
#: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 packages package-management)
#:use-module (gnu packages ssh)
+ #:use-module (gnu services)
#:use-module (gnu system vm)
#:export (cross-hurd-image))
@@ -37,19 +40,20 @@
;;;
;;; Code:
+(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
- (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 guix openssh
sed
- shepherd)))))
+ (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"))
@@ -77,9 +81,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
@@ -87,15 +102,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")
@@ -113,7 +126,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)
@@ -121,6 +134,7 @@ menuentry \"GNU\" {
;; TODO: Create those during activation, eventually.
(directory "/root")
+ ("/root/.profile" -> ,profile)
("/etc/fstab" -> ,fstab)
("/etc/passwd" -> ,passwd)
("/etc/shadow" -> ,shadow)
@@ -133,16 +147,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)
@@ -154,6 +168,7 @@ menuentry \"GNU\" {
("grub.cfg" ,grub.cfg)
("fstab" ,fstab)
("passwd" ,passwd)
+ ("profile" ,profile)
("shadow" ,shadow))
#:copy-inputs? #t
#:os hurd-os
- 33/52: gnu: libdaemon: Allow cross-compilation., (continued)
- 33/52: gnu: libdaemon: Allow cross-compilation., guix-commits, 2020/04/09
- 21/52: gnu: hurd: Install the UTF-8 motd., guix-commits, 2020/04/09
- 31/52: gnu: guix: Fix cross-compilation., guix-commits, 2020/04/09
- 27/52: gnu: openssl: Support cross-compilation to the Hurd., guix-commits, 2020/04/09
- 35/52: gnu: hurd: Add dependency on libdaemon., guix-commits, 2020/04/09
- 38/52: system: hurd: Add openssh, shepherd., guix-commits, 2020/04/09
- 37/52: gnu: openssh: Build fix for the Hurd., guix-commits, 2020/04/09
- 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 <=
- 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, 2020/04/09
- 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