mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
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.
This commit is contained in:
parent
5fbf4f85e1
commit
da987ece8f
1 changed files with 37 additions and 22 deletions
|
@ -23,6 +23,8 @@
|
||||||
#:use-module (gnu packages base)
|
#:use-module (gnu packages base)
|
||||||
#:use-module (gnu packages bash)
|
#:use-module (gnu packages bash)
|
||||||
#:use-module (gnu packages cross-base)
|
#: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 hurd)
|
||||||
#:use-module (gnu system vm)
|
#:use-module (gnu system vm)
|
||||||
#:export (cross-hurd-image))
|
#:export (cross-hurd-image))
|
||||||
|
@ -34,18 +36,20 @@
|
||||||
;;;
|
;;;
|
||||||
;;; Code:
|
;;; 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))
|
(define* (cross-hurd-image #:key (hurd hurd) (gnumach gnumach))
|
||||||
"Return a cross-built GNU/Hurd image."
|
"Return a cross-built GNU/Hurd image."
|
||||||
|
|
||||||
|
(define (for-hurd p)
|
||||||
|
(with-parameters ((%current-target-system "i586-pc-gnu")) p))
|
||||||
|
|
||||||
(define hurd-os
|
(define hurd-os
|
||||||
(let-syntax ((for-hurd (syntax-rules ()
|
(directory-union "gnu+hurd"
|
||||||
((_ things ...)
|
(cons (with-parameters ((%current-system "i686-linux"))
|
||||||
(list (with-parameters ((%current-target-system
|
gnumach)
|
||||||
"i586-pc-gnu"))
|
(map for-hurd %base-packages/hurd))))
|
||||||
things) ...)))))
|
|
||||||
(directory-union "gnu+hurd"
|
|
||||||
(cons (with-parameters ((%current-system "i686-linux"))
|
|
||||||
gnumach)
|
|
||||||
(for-hurd hurd bash coreutils grep sed)))))
|
|
||||||
|
|
||||||
(define grub.cfg
|
(define grub.cfg
|
||||||
(let ((hurd (with-parameters ((%current-target-system "i586-pc-gnu"))
|
(let ((hurd (with-parameters ((%current-target-system "i586-pc-gnu"))
|
||||||
|
@ -73,9 +77,20 @@ menuentry \"GNU\" {
|
||||||
#+mach #+mach #+hurd
|
#+mach #+mach #+hurd
|
||||||
#+libc #+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
|
(define fstab
|
||||||
(plain-file "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.
|
# will be lost upon reboot or reconfiguration.
|
||||||
|
|
||||||
/dev/hd0s1 / ext2 defaults
|
/dev/hd0s1 / ext2 defaults
|
||||||
|
@ -83,15 +98,13 @@ menuentry \"GNU\" {
|
||||||
|
|
||||||
(define passwd
|
(define passwd
|
||||||
(plain-file "passwd"
|
(plain-file "passwd"
|
||||||
"root:x:0:0:root:/root:/bin/sh
|
"root:x:0:0:root:/root:/bin/sh
|
||||||
"
|
"))
|
||||||
))
|
|
||||||
|
|
||||||
(define shadow
|
(define shadow
|
||||||
(plain-file "shadow"
|
(plain-file "shadow"
|
||||||
"root::0:0:0:0:::
|
"root::0:0:0:0:::
|
||||||
"
|
"))
|
||||||
))
|
|
||||||
|
|
||||||
(define hurd-directives
|
(define hurd-directives
|
||||||
`((directory "/servers")
|
`((directory "/servers")
|
||||||
|
@ -109,7 +122,7 @@ menuentry \"GNU\" {
|
||||||
("/servers/socket/inet" -> "2")
|
("/servers/socket/inet" -> "2")
|
||||||
("/servers/socket/inet6" -> "16")
|
("/servers/socket/inet6" -> "16")
|
||||||
(directory "/boot")
|
(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
|
("/hurd" -> ,(file-append (with-parameters ((%current-target-system
|
||||||
"i586-pc-gnu"))
|
"i586-pc-gnu"))
|
||||||
hurd)
|
hurd)
|
||||||
|
@ -117,6 +130,7 @@ menuentry \"GNU\" {
|
||||||
|
|
||||||
;; TODO: Create those during activation, eventually.
|
;; TODO: Create those during activation, eventually.
|
||||||
(directory "/root")
|
(directory "/root")
|
||||||
|
("/root/.profile" -> ,profile)
|
||||||
("/etc/fstab" -> ,fstab)
|
("/etc/fstab" -> ,fstab)
|
||||||
("/etc/passwd" -> ,passwd)
|
("/etc/passwd" -> ,passwd)
|
||||||
("/etc/shadow" -> ,shadow)
|
("/etc/shadow" -> ,shadow)
|
||||||
|
@ -129,16 +143,16 @@ menuentry \"GNU\" {
|
||||||
hurd)
|
hurd)
|
||||||
"/etc/motd"))
|
"/etc/motd"))
|
||||||
("/etc/login" -> ,(file-append (with-parameters ((%current-target-system
|
("/etc/login" -> ,(file-append (with-parameters ((%current-target-system
|
||||||
"i586-pc-gnu"))
|
"i586-pc-gnu"))
|
||||||
hurd)
|
hurd)
|
||||||
"/etc/login"))
|
"/etc/login"))
|
||||||
|
|
||||||
|
|
||||||
;; XXX can we instead, harmlessly set _PATH_TTYS (from glibc) in runttys.c?
|
;; XXX can we instead, harmlessly set _PATH_TTYS (from glibc) in runttys.c?
|
||||||
("/etc/ttys" -> ,(file-append (with-parameters ((%current-target-system
|
("/etc/ttys" -> ,(file-append (with-parameters ((%current-target-system
|
||||||
"i586-pc-gnu"))
|
"i586-pc-gnu"))
|
||||||
hurd)
|
hurd)
|
||||||
"/etc/ttys"))
|
"/etc/ttys"))
|
||||||
("/bin/sh" -> ,(file-append (with-parameters ((%current-target-system
|
("/bin/sh" -> ,(file-append (with-parameters ((%current-target-system
|
||||||
"i586-pc-gnu"))
|
"i586-pc-gnu"))
|
||||||
bash)
|
bash)
|
||||||
|
@ -151,6 +165,7 @@ menuentry \"GNU\" {
|
||||||
("grub.cfg" ,grub.cfg)
|
("grub.cfg" ,grub.cfg)
|
||||||
("fstab" ,fstab)
|
("fstab" ,fstab)
|
||||||
("passwd" ,passwd)
|
("passwd" ,passwd)
|
||||||
|
("profile" ,profile)
|
||||||
("shadow" ,shadow))
|
("shadow" ,shadow))
|
||||||
#:copy-inputs? #t
|
#:copy-inputs? #t
|
||||||
#:os hurd-os
|
#:os hurd-os
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue