[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/04: Revert "system: hurd: Remove bash from boot process."
From: |
guix-commits |
Subject: |
02/04: Revert "system: hurd: Remove bash from boot process." |
Date: |
Sun, 24 May 2020 07:07:58 -0400 (EDT) |
janneke pushed a commit to branch wip-hurd-vm
in repository guix.
commit 6169cb6396e666a2b39ad413fe7fd70e80b7a972
Author: Jan (janneke) Nieuwenhuizen <address@hidden>
AuthorDate: Sun May 24 11:56:53 2020 +0200
Revert "system: hurd: Remove bash from boot process."
Using disk-image, make-hurd-device-nodes now runs on the host linux, which
needs to be be patched for the xattr gnu.* translator namespace.
This reverts commit cd57c138bf19d9fc84979d1fefffad3d5c410a93.
---
gnu/bootloader/grub.scm | 1 -
gnu/build/linux-boot.scm | 9 +++------
gnu/packages/hurd.scm | 33 ++++++++++++++++++++++++++++++---
gnu/system/vm.scm | 2 +-
4 files changed, 34 insertions(+), 11 deletions(-)
diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm
index ab490dc..a013f9e 100644
--- a/gnu/bootloader/grub.scm
+++ b/gnu/bootloader/grub.scm
@@ -388,7 +388,6 @@ menuentry ~s {
--device-master-port='${device-port}' \\
--exec-server-task='${exec-task}' \\
--store-type=typed \\
- --x-xattr-translator-records \\
'${root}' '$(task-create)' '$(task-resume)'
module ~a/lib/ld.so.1 exec ~a/hurd/exec '$(exec-task=task-create)'
}~%"
diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm
index 93a0b93..f08bb11 100644
--- a/gnu/build/linux-boot.scm
+++ b/gnu/build/linux-boot.scm
@@ -348,13 +348,10 @@ one specific hardware device. These we have to create."
(mkdir (scope "servers"))
(mkdir (scope "servers/socket"))
+ ;; Don't create /servers/socket/1 & co: runsystem does that on first boot.
- ;; Guile's finalizer thread needs pipe support
- (with-output-to-file (scope "servers/socket/1")
- (lambda _ (display "")))
-
- (setxattr (scope "servers/socket/1") "gnu.translator" "/hurd/pflocal\0")
- ;; Don't create other /servers/socket/; RC does that upon boot
+ ;; TODO: Set the 'gnu.translator' extended attribute for passive translator
+ ;; settings?
)
(define %host-qemu-ipv4-address
diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index d8b12fc..9f3e945 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -33,7 +33,6 @@
#:use-module (guix build-system trivial)
#:use-module (gnu packages autotools)
#:use-module (gnu packages compression)
- #:use-module (gnu packages attr)
#:use-module (gnu packages flex)
#:use-module (gnu packages gawk)
#:use-module (gnu packages gnupg)
@@ -319,6 +318,7 @@ boot, since this cannot be done from GNU/Linux."
("/servers/crash-kill" ("/hurd/crash" "--kill"))
("/servers/crash-suspend" ("/hurd/crash" "--suspend"))
("/servers/password" ("/hurd/password"))
+ ("/servers/socket/1" ("/hurd/pflocal"))
("/servers/socket/2" ("/hurd/pfinet" "--interface" "eth0"
"--address" "10.0.2.15" ;the default QEMU guest IP
"--netmask" "255.255.255.0"
@@ -346,6 +346,11 @@ boot, since this cannot be done from GNU/Linux."
(unless (zero? (system* "fsysopts" "/" "--update" "--writable"))
(format #t "FAILED...Good luck!\n"))
+ (format #t "settrans pflocal...\n")
+ (mkdir-p "/servers/socket")
+ (unless (zero? (system* "settrans" "-c" "/servers/socket/1"
"/hurd/pflocal"))
+ (format #t "FAILED...Good luck!\n"))
+
(for-each (match-lambda
((node command)
(unless (translated? node)
@@ -359,6 +364,7 @@ boot, since this cannot be done from GNU/Linux."
(invoke "MAKEDEV" "--devdir=/dev" "vcs")
(invoke "MAKEDEV" "--devdir=/dev" "tty1""tty2" "tty3" "tty4"
"tty5" "tty6")
(invoke "MAKEDEV" "--devdir=/dev" "ptyp0" "ptyp1" "ptyp2")
+ (invoke "MAKEDEV" "--devdir=/dev" "std")
(invoke "MAKEDEV" "--devdir=/dev" "console"))
;; Setting current system
@@ -473,6 +479,26 @@ boot, since this cannot be done from GNU/Linux."
(substitute* '("daemons/Makefile" "utils/Makefile")
(("-o root -m 4755") ""))
#t))
+ (add-after 'unpack 'create-runsystem
+ (lambda _
+ ;; XXX Work towards having startup.c invoke the Guile rc
+ (delete-file "daemons/runsystem.sh")
+ (with-output-to-file "daemons/runsystem.sh"
+ (lambda _
+ (display "#! /bin/bash
+
+# XXX Guile needs pipe support for its finalizer thread, to start.
+# Remove this script when Linux and the Hurd have xattr patches.
+PATH=@PATH@
+
+fsck --yes --force /
+fsysopts / --writable
+settrans -c /servers/socket/1 /hurd/pflocal
+echo Starting /libexec/rc ...
+exec /libexec/rc
+")))
+ ))
+
(add-before 'build 'set-file-names
(lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
@@ -493,7 +519,8 @@ boot, since this cannot be done from GNU/Linux."
(substitute* "daemons/console-run.c"
(("/hurd/")
(string-append out "/hurd/")))
- (substitute* "sutils/MAKEDEV.sh"
+ (substitute* '("daemons/runsystem.sh"
+ "sutils/MAKEDEV.sh")
(("^PATH=.*")
(string-append "PATH=" out "/bin"
":" out "/sbin"
@@ -537,7 +564,7 @@ boot, since this cannot be done from GNU/Linux."
(add-after 'install 'install-rc-file
(lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
- (file (string-append out "/libexec/runsystem"))
+ (file (string-append out "/libexec/rc"))
(rc (assoc-ref inputs "hurd-rc"))
(coreutils (assoc-ref inputs "coreutils")))
(delete-file file)
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index b98b3d1..c894c02 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -308,7 +308,7 @@ substitutable."
(disk-image-format "qcow2")
(file-system-type (if (hurd-target?) "ext2" "ext4"))
(file-system-options
- (if (hurd-target?) '("-o" "hurd" "-O" "ext_attr") '()))
+ (if (hurd-target?) '("-o" "hurd") '()))
(device-nodes (if (hurd-target?) 'hurd 'linux))
(extra-directives '())
file-system-label