[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
10/52: gnu: hurd: Ensure startup scripts refer to the right programs.
From: |
guix-commits |
Subject: |
10/52: gnu: hurd: Ensure startup scripts refer to the right programs. |
Date: |
Thu, 9 Apr 2020 13:29:03 -0400 (EDT) |
janneke pushed a commit to branch wip-hurd-vm
in repository guix.
commit 2f4abe8952a9ef187e2c8d5fef3e233d79170e24
Author: Ludovic Courtès <address@hidden>
AuthorDate: Sun Apr 5 01:49:37 2020 +0200
gnu: hurd: Ensure startup scripts refer to the right programs.
* gnu/packages/hurd.scm (hurd)[arguments]: In 'set-file-names' phase, patch
startup.c, init.c, login.c, and daemons/runsystem/*. Add
'patch-libexec-shebangs' phase. Subtitute /libexec and /sbin, so that we
may
run RC!
[inputs]: Add BASH-MINIMAL, SED, and GREP.
* gnu/packages/hurd.scm (hurd):
---
gnu/packages/hurd.scm | 64 +++++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 60 insertions(+), 4 deletions(-)
diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index 9f398e0..f96d120 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -34,6 +34,7 @@
#:use-module (gnu packages bison)
#:use-module (gnu packages perl)
#:use-module (gnu packages base)
+ #:use-module (gnu packages bash)
#:use-module (gnu packages texinfo)
#:use-module (guix git-download)
#:export (hurd-system?
@@ -349,10 +350,60 @@ boot, since this cannot be done from GNU/Linux."
#t))
(add-before 'build 'set-file-names
(lambda* (#:key inputs outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out")))
- (substitute* '("daemons/runttys.c" "daemons/getty.c")
+ (let* ((out (assoc-ref outputs "out"))
+ (bash (assoc-ref inputs "bash-minimal"))
+ (sed (assoc-ref inputs "sed"))
+ (grep (assoc-ref inputs "grep"))
+ (util-linux (assoc-ref inputs "util-linux")))
+ (substitute* '("daemons/runttys.c" "daemons/getty.c"
"utils/login.c")
(("/bin/login")
- (string-append out "/bin/login")))
+ (string-append out "/bin/login"))
+ (("/bin/bash") (string-append bash "/bin/bash")))
+ (substitute* '("startup/startup.c" "init/init.c" "config/ttys")
+ (("/libexec/")
+ (string-append out "/libexec/")))
+ (substitute* "daemons/console-run.c"
+ (("/hurd/")
+ (string-append out "/hurd/")))
+
+ (substitute* '("daemons/runsystem.sh"
+ "daemons/runsystem.hurd.sh"
+ "sutils/MAKEDEV.sh")
+ (("^PATH=.*")
+ (string-append "PATH=" out "/bin:"
+ sed "/bin:" grep "/bin\n"))
+ (("^SHELL=.*")
+ (string-append "SHELL=" bash "/bin/bash\n"))
+ (("/sbin/") (string-append out "/sbin/"))
+ (("/libexec/") (string-append out "/libexec/"))
+ (("/hurd/") (string-append out "/hurd/")))
+
+ (substitute* "daemons/runsystem.sh"
+ (("export PATH")
+ (string-append "export PATH\n"
+ "\
+fsysopts / --writable
+
+# MAKEDEV relies on pipes so this needs to be set up.
+settrans -c /servers/socket/1 /hurd/pflocal
+
+(cd /dev; MAKEDEV -D /dev std vcs tty{1,2,3,4,5,6})\n")))
+
+ (substitute* "daemons/runsystem.hurd.sh"
+ (("export PATH")
+ "export PATH
+fsysopts / --writable\n"))
+ #t)))
+ (add-after 'patch-shebangs 'patch-libexec-shebangs
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ ;; XXX: Since the 'patch-shebangs' phase doesn't traverse
+ ;; /libexec, do it here.
+ (let* ((out (assoc-ref outputs "out"))
+ (bash (assoc-ref inputs "bash-minimal"))
+ (path (list (string-append bash "/bin"))))
+ (for-each (lambda (file)
+ (patch-shebang file path))
+ (find-files (string-append out "/libexec")))
#t)))
(add-after 'install 'install-rc-file
(lambda* (#:key inputs outputs #:allow-other-keys)
@@ -373,7 +424,12 @@ boot, since this cannot be done from GNU/Linux."
(build-system gnu-build-system)
(inputs
`(("glibc-hurd-headers" ,glibc/hurd-headers)
- ("hurd-rc" ,(hurd-rc-script))))
+ ("hurd-rc" ,(hurd-rc-script))
+
+ ;; Tools for the /libexec/* scripts.
+ ("bash-minimal" ,bash-minimal)
+ ("sed" ,sed)
+ ("grep" ,grep)))
(native-inputs
`(("autoconf" ,autoconf)
("automake" ,automake)
- 01/52: install: 'populate-root-file-system' can be passed extra directives., (continued)
- 01/52: install: 'populate-root-file-system' can be passed extra directives., guix-commits, 2020/04/09
- 05/52: gnu: hurd: Provide our own /libexec/rc script., guix-commits, 2020/04/09
- 07/52: gnu: hurd: Use a 32-bit MiG when cross-compiling., guix-commits, 2020/04/09
- 09/52: gnu: hurd: Record the right file name of 'login'., guix-commits, 2020/04/09
- 12/52: gnu: hurd: Add coreutils to startup scripts., guix-commits, 2020/04/09
- 06/52: gnu: cross-libc: Add patch to add 'mach_print' symbol on GNU/Hurd., guix-commits, 2020/04/09
- 14/52: system: hurd: Add "/etc/fstab"., guix-commits, 2020/04/09
- 08/52: DRAFT: Add (gnu system hurd)., guix-commits, 2020/04/09
- 03/52: vm: 'qemu-image' can pass options to the 'mkfs' command., guix-commits, 2020/04/09
- 13/52: gnu: hurd: Add util-linux to startup scripts., guix-commits, 2020/04/09
- 10/52: gnu: hurd: Ensure startup scripts refer to the right programs.,
guix-commits <=
- 11/52: gnu: guile@3: Disable JIT on GNU/Hurd., guix-commits, 2020/04/09
- 17/52: system: hurd: Add "/etc/passwd"., guix-commits, 2020/04/09
- 15/52: gnu: hurd: Add "hurd/sbin" to PATH., guix-commits, 2020/04/09
- 18/52: gnu: cross-libc: Add patch to allow 'gettyent' reading store file names., guix-commits, 2020/04/09
- 20/52: system: hurd: Add "/etc/shadow"., guix-commits, 2020/04/09
- 24/52: vm: Preserve file permissions on /dev., guix-commits, 2020/04/09
- 25/52: linux-boot: 'make-essential-device-nodes' root parameter is optional., guix-commits, 2020/04/09
- 19/52: system: hurd: Add "/bin/sh" symlink., guix-commits, 2020/04/09
- 16/52: system: hurd: Add ttys symlink in "/etc/ttys"., guix-commits, 2020/04/09
- 30/52: vm: Make the device node procedure a parameter., guix-commits, 2020/04/09