Subject: [bug#41785] [PATCH v4] services: Add 'hurd-in-vm service-type'.

From: Jan Nieuwenhuizen <[email-masked]>
Date: Sun, 14 Jun 2020 15:18:18 +0200

Mathieu Othacehe writes:

Hey Mathieu,

>> (define (hurd-vm-disk-image config)
>>   "Return a disk-image for the Hurd according to CONFIG."
>>   (with-parameters ((%current-target-system "i586-pc-gnu"))
>>     (let ((os (hurd-vm-configuration-os config))
>>           (disk-size (hurd-vm-configuration-disk-size config)))
>>       (system-image
>>        (image
>>         (inherit hurd-disk-image)
>>         (size disk-size)
>>         (operating-system os))))))
>
> Nice! I'm not sure why we still need the "with-parameters" call because,
> it's done first thing in "system-image". I'd like to understand this
> before proceeding, do you have a branch where I could test it?

It's on my gitlab master...almost ready to push ;-)

Initially I did not have this "with-parameters", but then in
gnu/system.scm:

--8<---------------cut here---------------start------------->8---
(define (hurd-multiboot-modules os)
...
         (libc (if target
                   (with-parameters ((%current-target-system #f))
                     ;; TODO: cross-libc has extra patches for the Hurd;
                     ;; remove in next rebuild cycle
                     (cross-libc target))
                   glibc))
--8<---------------cut here---------------end--------------->8---

we take the ELSE branch here -- and that does not work.  AIUI, this is
really a temporary kludge until the next rebuild cycle we can move some
hurd-specific glibc patches from cross-libc to glibc-proper.

...but it's tricky to see how this all plays together, not entirely
clear to me anyway...

>> -  ;; FIXME: %current-target-system may not be bound <https://bugs.gnu.org/29296>
>> -  (let ((target (%current-target-system)))
>> +  (let-system (system target)
>>      (with-extensions (list shepherd)
>>        (computed-file (string-append (basename (scheme-file-name file) ".scm")
>>                                      ".go")
>>
>> produces a working hurd-vm service!
>
> Good catch!

:-)
Almost there...

Janneke

-- 
Jan Nieuwenhuizen <[email-masked]> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com