unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Jan Nieuwenhuizen <janneke@gnu.org>
To: Mathieu Othacehe <othacehe@gnu.org>
Cc: 41541@debbugs.gnu.org
Subject: bug#41541: merge wip-hurd-vm
Date: Wed, 27 May 2020 13:11:12 +0200	[thread overview]
Message-ID: <87pnap7hv3.fsf@gnu.org> (raw)
In-Reply-To: <87tv01vgqy.fsf@gnu.org> (Mathieu Othacehe's message of "Wed, 27 May 2020 12:01:25 +0200")

Mathieu Othacehe writes:

Hello Mathieu,

> That's a good summary of the (complex) situation, thank you!

Yeah...well sorry for helping create such a mess :-)

>> Mattieu is looking into cleaning up of
>>
>> b605a36031 * origin/wip-hurd-vm WIP hurd-directives
>
> About that, I'd like to limit at maximum the (if hurd ...) conditionals
> in (gnu system image).

Yes, please!

> So for the "make-device-node", I would propose to "link" it to the
> image definition, as proposed in the attached patch.
>
> I'll see if we can do something similar for the "extra-directives" and
> the "boot-activation".

This looks beautiful!  It works for me when using this extra ugly patch
(yes, it contains an IF that has to go :-)

diff --git a/gnu/build/image.scm b/gnu/build/image.scm
index 70f1a61b9d..f4727b8bf5 100644
--- a/gnu/build/image.scm
+++ b/gnu/build/image.scm
@@ -67,7 +67,8 @@ take the partition metadata size into account, take a 25% margin."
 (define* (make-ext-image partition target root
                          #:key
                          (owner-uid 0)
-                         (owner-gid 0))
+                         (owner-gid 0)
+                         (options '()))
   "Handle the creation of EXT2/3/4 partition images. See
 'make-partition-image'."
   (let ((size (partition-size partition))
@@ -82,6 +83,7 @@ take the partition metadata size into account, take a 25% margin."
              "-E" ,(format #f "root_owner=~a:~a,~a"
                            owner-uid owner-gid journal-options)
              ,@fs-options
+             ,@options
              ,target
              ,(format #f "~ak"
                       (size-in-kib
@@ -105,14 +107,14 @@ take the partition metadata size into account, take a 25% margin."
                           (string-append "::" file))))
               (scandir root))))
 
-(define* (make-partition-image partition-sexp target root)
+(define* (make-partition-image partition-sexp target root #:key (options '()))
   "Create and return the image of PARTITION-SEXP as TARGET.  Use the given
 ROOT directory to populate the image."
   (let* ((partition (sexp->partition partition-sexp))
          (type (partition-file-system partition)))
     (cond
      ((string-prefix? "ext" type)
-      (make-ext-image partition target root))
+      (make-ext-image partition target root #:options options))
      ((string=? type "vfat")
       (make-vfat-image partition target root))
      (else
diff --git a/gnu/system/image.scm b/gnu/system/image.scm
index db12a40cb4..3400e01b1a 100644
--- a/gnu/system/image.scm
+++ b/gnu/system/image.scm
@@ -277,13 +277,15 @@ used in the image."
               (computed-file "partition-image-root" root-builder
                              #:options `(#:references-graphs ,inputs)))
              (type (partition-file-system partition))
+             (options (if (hurd-target?) '("-o" "hurd" "-O" "ext_attr") '()))
              (image-builder
               (with-imported-modules*
                (let ((inputs '#+(list e2fsprogs dosfstools mtools)))
                  (set-path-environment-variable "PATH" '("bin" "sbin") inputs)
                  (make-partition-image #$(partition->gexp partition)
                                        #$output
-                                       #$image-root)))))
+                                       #$image-root
+                                       #:options '#$options)))))
         (computed-file "partition.img" image-builder)))
 
     (define (partition->config partition)

until the point where it lacks the "/hurd" symlink from the directives.

So, apart from removing the IF above in a nice way, we (you?) could try
to find a nice way to insert extra-directives

> @@ -168,6 +170,9 @@ of the directory of the 'system' derivation."
>    (populate-root-file-system system-directory root)

                                                     ^ here 
I guess...and then we'd be done.

I'm not sure as to what extent the extra-directives is/was a kludge?

Janneke

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




  reply	other threads:[~2020-05-27 11:12 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-26 14:21 bug#41541: merge wip-hurd-vm Jan Nieuwenhuizen
2020-05-27 10:01 ` Mathieu Othacehe
2020-05-27 11:11   ` Jan Nieuwenhuizen [this message]
2020-05-30 14:40   ` Jan Nieuwenhuizen
2020-06-02  8:48     ` Mathieu Othacehe
2020-06-02  9:24       ` Jan Nieuwenhuizen
2020-06-02 10:16         ` Mathieu Othacehe
2020-06-02 12:23           ` Jan Nieuwenhuizen
2020-06-02 12:40             ` Ludovic Courtès
2020-06-02 13:39               ` Jan Nieuwenhuizen
2020-06-03  9:18                 ` Ludovic Courtès
2020-06-03 15:22                   ` Jan Nieuwenhuizen
2020-06-03 15:38                     ` Mathieu Othacehe
2020-06-03 20:27                       ` Jan Nieuwenhuizen
2020-06-04  9:32                         ` Ludovic Courtès
2020-06-04 11:33                           ` Jan Nieuwenhuizen
2020-06-05 16:08                             ` Ludovic Courtès
2020-06-05 16:24                               ` Jan Nieuwenhuizen
2020-06-04 13:59 ` bug#41541: [PATCH 0/9] Merge wip-hurd-vm "last review round" Jan (janneke) Nieuwenhuizen
2020-06-04 13:59   ` bug#41541: [PATCH 1/8] system: Add 'hurd' field to <operating-system> Jan (janneke) Nieuwenhuizen
2020-06-06  7:21     ` Mathieu Othacehe
2020-06-06  8:26       ` Jan Nieuwenhuizen
2020-06-04 13:59   ` bug#41541: [PATCH 2/8] bootloader: Extend `<menu-entry>' for multiboot Jan (janneke) Nieuwenhuizen
2020-06-04 13:59   ` bug#41541: [PATCH 3/8] system: Add 'multiboot-modules' field to <boot-parameters> Jan (janneke) Nieuwenhuizen
2020-06-06  7:32     ` Mathieu Othacehe
2020-06-06 10:13       ` Jan Nieuwenhuizen
2020-06-04 13:59   ` bug#41541: [PATCH 4/8] bootloader: grub: Add support for multiboot Jan (janneke) Nieuwenhuizen
2020-06-06  7:47     ` Mathieu Othacehe
2020-06-06  8:46       ` Jan Nieuwenhuizen
2020-06-04 13:59   ` bug#41541: [PATCH 5/8] system: Use 'hurd' package in label Jan (janneke) Nieuwenhuizen
2020-06-04 13:59   ` bug#41541: [PATCH 6/8] system: examples: Add bare-hurd.tmpl Jan (janneke) Nieuwenhuizen
2020-06-06  7:56     ` Mathieu Othacehe
2020-06-04 13:59   ` bug#41541: [PATCH 7/8] services: hurd: Add `hurd-etc-service' Jan (janneke) Nieuwenhuizen
2020-06-04 13:59   ` bug#41541: [PATCH 8/8] system: Add `hurd-activation' Jan (janneke) Nieuwenhuizen
2020-06-06  8:03     ` Mathieu Othacehe
2020-06-06  8:54       ` Jan Nieuwenhuizen

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=87pnap7hv3.fsf@gnu.org \
    --to=janneke@gnu.org \
    --cc=41541@debbugs.gnu.org \
    --cc=othacehe@gnu.org \
    /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).