unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Jan Nieuwenhuizen <janneke@gnu.org>
To: Rene <pacoon@protonmail.com>
Cc: "guix-devel@gnu.org" <guix-devel@gnu.org>
Subject: Re: [BLOG] On migration to the Hurd
Date: Sat, 04 Apr 2020 12:05:33 +0200	[thread overview]
Message-ID: <87a73ra7ma.fsf@gnu.org> (raw)
In-Reply-To: <gc21pZbQusTdAgbP_MKq-Eius2XsszBldI4AR-3Hy0mgwlGyjMJOFFHyo8R4PuWwBuOiHfCpjgE1SlkISvQjnRsUxDMZK35EY58_FJVD94Y=@protonmail.com> (Rene's message of "Sat, 04 Apr 2020 01:47:43 +0000")

[-- Attachment #1: Type: text/plain, Size: 648 bytes --]

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


[-- Attachment #2: 0001-system-hurd-Add-symlink-for-.-hurd-libexec.patch --]
[-- Type: text/x-patch, Size: 1489 bytes --]

From 56f67343c4108da8c8f0a91844aebd28181dc912 Mon Sep 17 00:00:00 2001
From: Rene Saavedra <pacoon@protonmail.com>
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 <ludo@gnu.org>
+;;; Copyright © 2020 Rene Saavedra <pacoon@protonmail.com>
 ;;;
 ;;; 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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-gnu-hurd-Have-scripts-use-store-file-names.patch --]
[-- Type: text/x-patch, Size: 3594 bytes --]

From 248e44e7f42312c92b23d2bc3d10a80a5bb2eadf Mon Sep 17 00:00:00 2001
From: "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org>
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


[-- Attachment #4: 0003-system-hurd-Add-bin-sh-symlink.patch --]
[-- Type: text/x-patch, Size: 2255 bytes --]

From 293e2c316005f2674b3cad32a2127c27a70b8ff6 Mon Sep 17 00:00:00 2001
From: "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org>
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 <ludo@gnu.org>
 ;;; Copyright © 2020 Rene Saavedra <pacoon@protonmail.com>
+;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; 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


[-- Attachment #5: Type: text/plain, Size: 154 bytes --]



-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com

  parent reply	other threads:[~2020-04-04 10:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-04  1:47 [BLOG] On migration to the Hurd Rene
2020-04-04  7:38 ` Rene
2020-04-04 10:05 ` Jan Nieuwenhuizen [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-04-01 21:39 Jan Nieuwenhuizen
2020-04-02  0:56 ` Bengt Richter
2020-04-02  6:32 ` Tanguy Le Carrour
2020-04-02 10:55   ` Ludovic Courtès
2020-04-03 11:59     ` Tanguy Le Carrour
2020-04-06  7:53       ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a73ra7ma.fsf@gnu.org \
    --to=janneke@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=pacoon@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).