[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
09/18: gnu: hurd: Ensure startup scripts refer to the right programs.
From: |
guix-commits |
Subject: |
09/18: gnu: hurd: Ensure startup scripts refer to the right programs. |
Date: |
Sat, 11 Apr 2020 13:26:08 -0400 (EDT) |
civodul pushed a commit to branch core-updates
in repository guix.
commit 29505c7d1eb08afc14a881d84705cde54b12192f
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, COREUTILS, SED, GREP, and UTIL-LINUX.
---
gnu/packages/hurd.scm | 70 ++++++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 66 insertions(+), 4 deletions(-)
diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index 9f398e0..45e1b21 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -32,8 +32,10 @@
#:use-module (gnu packages autotools)
#:use-module (gnu packages flex)
#:use-module (gnu packages bison)
+ #:use-module (gnu packages linux)
#: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 +351,63 @@ 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"))
+ (coreutils (assoc-ref inputs "coreutils"))
+ (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:" out "/sbin:"
+ coreutils "/bin:"
+ sed "/bin:" grep "/bin:"
+ util-linux "/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 +428,14 @@ 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)
+ ("coreutils" ,coreutils)
+ ("sed" ,sed)
+ ("grep" ,grep)
+ ("util-linux" ,util-linux)))
(native-inputs
`(("autoconf" ,autoconf)
("automake" ,automake)
- 01/18: install: 'populate-root-file-system' can be passed extra directives., (continued)
- 01/18: install: 'populate-root-file-system' can be passed extra directives., guix-commits, 2020/04/11
- 02/18: vm: 'qemu-image' accepts a list of extra populate directives., guix-commits, 2020/04/11
- 04/18: gnu: gnumach: Enable kernel debugger (kbd)., guix-commits, 2020/04/11
- 03/18: vm: 'qemu-image' can pass options to the 'mkfs' command., guix-commits, 2020/04/11
- 08/18: gnu: hurd: Record the right file name of 'login'., guix-commits, 2020/04/11
- 05/18: gnu: hurd: Provide our own /libexec/rc script., guix-commits, 2020/04/11
- 06/18: gnu: cross-libc: Add patch to add 'mach_print' symbol on GNU/Hurd., guix-commits, 2020/04/11
- 13/18: gnu: libdaemon: Allow cross-compilation., guix-commits, 2020/04/11
- 14/18: gnu: libdaemon: Cross-build with --localstatedir=/var., guix-commits, 2020/04/11
- 07/18: gnu: hurd: Use a 32-bit MiG when cross-compiling., guix-commits, 2020/04/11
- 09/18: gnu: hurd: Ensure startup scripts refer to the right programs.,
guix-commits <=
- 10/18: gnu: hurd: Install the UTF-8 motd., guix-commits, 2020/04/11
- 15/18: gnu: hurd: Add dependency on libdaemon., guix-commits, 2020/04/11
- 12/18: gnu: hurd: Add dependency on libgcrypt., guix-commits, 2020/04/11
- 16/18: gnu: hurd: Install a BDF font., guix-commits, 2020/04/11
- 11/18: gnu: libgcrypt: Fix cross-compilation., guix-commits, 2020/04/11
- 17/18: gnu: cross-libc: Add patch to allow 'gettyent' reading store file names., guix-commits, 2020/04/11
- 18/18: gnu: guile@3: Disable JIT on GNU/Hurd., guix-commits, 2020/04/11