[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [BLOG] On migration to the Hurd
From: |
Jan Nieuwenhuizen |
Subject: |
Re: [BLOG] On migration to the Hurd |
Date: |
Sat, 04 Apr 2020 12:05:33 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) |
Rene writes:
> Hello Ludovic, Jan,
>
> About the bootstrap ext2fs.static server, it seems that it is also
> required to create a link in /libexec, attached a patch.
Ah...great!
> and now it shows another error:
> --
> Hurd server bootstrap: ext2fs[device:hd0s1] exec startup proc auth.
> /libexec/console-run: /dev/console: Permission denied
> /libexec/console-run: cannot execute /libexec/runsystem: Exec format
> error
> --
>
> I'll keep checking ..
With the attached patches (I added a copyright line for you), I now get
a prompt!
Greetings,
janneke
PS: you can also pull wip-hurd-vm from https://gitlab.com/janneke/guix.git
>From 56f67343c4108da8c8f0a91844aebd28181dc912 Mon Sep 17 00:00:00 2001
From: Rene Saavedra <address@hidden>
Date: Fri, 3 Apr 2020 19:31:01 -0600
Subject: [PATCH 1/3] system: hurd: Add symlink for `../hurd/libexec.`
* /gnu/system/hurd.scm (hurd-directives): Add symlink in
`/libexec/console-run` for `../hurd/libexec`.
---
gnu/system/hurd.scm | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm
index 586bfa0fca..97c54a2992 100644
--- a/gnu/system/hurd.scm
+++ b/gnu/system/hurd.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2020 Ludovic Courtès <address@hidden>
+;;; Copyright © 2020 Rene Saavedra <address@hidden>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -94,7 +95,11 @@ menuentry \"GNU\" {
("/hurd" -> ,(file-append (with-parameters ((%current-target-system
"i586-pc-gnu"))
hurd)
- "/hurd"))))
+ "/hurd"))
+ ("/libexec" -> ,(file-append (with-parameters ((%current-target-system
+ "i586-pc-gnu"))
+ hurd)
+ "/libexec"))))
(qemu-image #:file-system-type "ext2"
#:file-system-options '("-o" "hurd")
--
2.26.0
>From 248e44e7f42312c92b23d2bc3d10a80a5bb2eadf Mon Sep 17 00:00:00 2001
From: "Jan (janneke) Nieuwenhuizen" <address@hidden>
Date: Sat, 4 Apr 2020 10:32:22 +0200
Subject: [PATCH 2/3] gnu: hurd: Have scripts use store file names.
* gnu/packages/hurd.scm (hurd)[inputs]: Add bash-minimal, coreutils, sed.
[arguments]: Use them in new `use-store-file-names' stage.
---
gnu/packages/hurd.scm | 38 ++++++++++++++++++++++++++++++++++++--
1 file changed, 36 insertions(+), 2 deletions(-)
diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index 8f087172de..09b09b6397 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -30,6 +30,7 @@
#:use-module (guix build-system gnu)
#:use-module (guix build-system trivial)
#:use-module (gnu packages autotools)
+ #:use-module (gnu packages bash)
#:use-module (gnu packages flex)
#:use-module (gnu packages bison)
#:use-module (gnu packages perl)
@@ -361,6 +362,36 @@ boot, since this cannot be done from GNU/Linux."
(copy-file rc file)
(substitute* file
(("@HURD@") out))
+ #t)))
+ (add-after 'install 'use-store-file-names
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (bash (assoc-ref inputs "bash"))
+ (coreutils (assoc-ref inputs "coreutils"))
+ (sed (assoc-ref inputs "sed")))
+ (substitute* (list (string-append out "/libexec/runsystem")
+ (string-append out
"/libexec/runsystem.hurd") ; Hmm?
+ (string-append out "/sbin/MAKEDEV")
+ (string-append out "/bin/fakeroot")
+ (string-append out "/bin/remap")
+ (string-append out "/bin/sush"))
+ ;; huh, why are shebangs using the build system's bash?
+ (("^#!.*/bash") (string-append "#! " bash "/bin/bash"))
+ (("^#!.*/sh") (string-append "#! " bash "/bin/bash"))
+ (("=/libexec") (string-append "=" out "/libexec"))
+ (("^SHELL=/bin/sh")
+ (string-append "SHELL=" bash "/bin/bash"))
+ (("^PATH=")
+ (string-append "PATH=" out "/bin"
+ ":" out "/sbin"
+ ":" coreutils "/bin"
+ ":" sed "/bin"
+ ":/run/current-system/profile/bin"
+ ":/run/current-system/profile/sbin"))
+ )
+ (substitute* (string-append out "/bin/sush")
+ (("-/bin/fmt") (string-append "-/" coreutils "/bin/fmt"))
+ (("-/bin/login") (string-append "-/" coreutils "/bin/legin")))
#t))))
#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
%output "/lib")
@@ -370,8 +401,11 @@ boot, since this cannot be done from GNU/Linux."
"--without-parted")))
(build-system gnu-build-system)
(inputs
- `(("glibc-hurd-headers" ,glibc/hurd-headers)
- ("hurd-rc" ,(hurd-rc-script))))
+ `(("bash" ,bash-minimal)
+ ("coreutils" ,coreutils)
+ ("glibc-hurd-headers" ,glibc/hurd-headers)
+ ("hurd-rc" ,(hurd-rc-script))
+ ("sed" ,sed)))
(native-inputs
`(("autoconf" ,autoconf)
("automake" ,automake)
--
2.26.0
>From 293e2c316005f2674b3cad32a2127c27a70b8ff6 Mon Sep 17 00:00:00 2001
From: "Jan (janneke) Nieuwenhuizen" <address@hidden>
Date: Sat, 4 Apr 2020 11:53:13 +0200
Subject: [PATCH 3/3] system: hurd: Add /bin/sh symlink.
* gnu/system/hurd.scm (cross-hurd-image): Create /bin/sh symlink.
---
gnu/system/hurd.scm | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm
index 97c54a2992..82a9d94d5c 100644
--- a/gnu/system/hurd.scm
+++ b/gnu/system/hurd.scm
@@ -1,6 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2020 Ludovic Courtès <address@hidden>
;;; Copyright © 2020 Rene Saavedra <address@hidden>
+;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <address@hidden>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -22,6 +23,7 @@
#:use-module (guix utils)
#:use-module (gnu bootloader grub)
#:use-module (gnu packages base)
+ #:use-module (gnu packages bash)
#:use-module (gnu packages cross-base)
#:use-module (gnu packages hurd)
#:use-module (gnu system vm)
@@ -45,7 +47,7 @@
(directory-union "gnu+hurd"
(cons (with-parameters ((%current-system "i686-linux"))
gnumach)
- (for-hurd hurd coreutils grep sed)))))
+ (for-hurd hurd bash-minimal coreutils grep
sed)))))
(define grub.cfg
(let ((hurd (with-parameters ((%current-target-system "i586-pc-gnu"))
@@ -99,7 +101,11 @@ menuentry \"GNU\" {
("/libexec" -> ,(file-append (with-parameters ((%current-target-system
"i586-pc-gnu"))
hurd)
- "/libexec"))))
+ "/libexec"))
+ ("/bin/sh" -> ,(file-append (with-parameters ((%current-target-system
+ "i586-pc-gnu"))
+ bash-minimal)
+ "/bin/sh"))))
(qemu-image #:file-system-type "ext2"
#:file-system-options '("-o" "hurd")
--
2.26.0
--
Jan Nieuwenhuizen <address@hidden> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com