unofficial mirror of guix-patches@gnu.org 
 help / color / Atom feed
* [bug#41350] [PATCH 0/3] Use native qemu to build vm-image.
@ 2020-05-17 10:01 Jan Nieuwenhuizen
  2020-05-17 10:03 ` [bug#41350] [PATCH 1/3] utils: Move 'reset-timestamps' out of database Jan (janneke) Nieuwenhuizen
                   ` (5 more replies)
  0 siblings, 6 replies; 48+ messages in thread
From: Jan Nieuwenhuizen @ 2020-05-17 10:01 UTC (permalink / raw)
  To: 41350

Hi!

Cross-building a vm-image used to be done using a cross-qemu, e.g, qemu-ARM.
That does not work for the Hurd, as there is no qemu-HURD.

This patch switches to cross building vm-images using a native qemu vm.  If
there a reason for using qemu-TARGET we may want to make this switch
conditional for cross building to the Hurd?

There is a tricky aspect to this: the "user-builder" includes all the
cross-built packages for TARGET, but we need to hard the native qemu a
native #+LOADER, loading native #+LINUX and #+INITRD.

To accomplish this NATIVE/CROSS mixt, the builder is then run with a native
guile, like so

--8<---------------cut here---------------start------------->8---
(system* #+(file-append (default-guile) "/bin/guile")
         "--no-auto-compile"
         #$(preserve-target user-builder))
--8<---------------cut here---------------end--------------->8---

while the packages in USER-BUILDER will still be cross-built.  However,
because the builder has

    (with-extensions gcrypt-sqlite3&co
         (use-modules (gnu store database))
      ...)

this makes the native guile "see" the cross-built .GO files.  That would
"only" be a secondary problem except that loading (sqlite3) throws an
exception when dynamic-loading the .SO fails.  Seeing it like this I am not so
sure anymore this is a bug, WDYT?  ...so instead

...the problem is now avoided by removing the sqlite dependency when
cross-building by not registering closures and postponing the loading of (gnu
store database) and thus (sqlite3).

I have reset wip-hurd-vm onto these changes, so you can also look there.
Doing

    ./pre-inst-env guix system vm-image --target=i586-pc-gnu --no-grafts \
        gnu/system/examples/bare-hurd.tmpl

now produces a pretty nice hurd VM :-)

Greetings,
Janneke

Jan (janneke) Nieuwenhuizen (3):
  utils: Move 'reset-timestamps' out of database.
  system: vm: Do not register-closures when cross-building.
  system: vm: Build vm-image using native qemu.

 gnu/bootloader/grub.scm |  4 +--
 gnu/build/vm.scm        |  3 ++-
 gnu/system/vm.scm       | 54 ++++++++++++++++++++++++++---------------
 guix/store/database.scm | 41 +++----------------------------
 guix/utils.scm          | 41 ++++++++++++++++++++++++++++---
 5 files changed, 79 insertions(+), 64 deletions(-)

-- 
2.26.0

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




^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH 1/3] utils: Move 'reset-timestamps' out of database.
  2020-05-17 10:01 [bug#41350] [PATCH 0/3] Use native qemu to build vm-image Jan Nieuwenhuizen
@ 2020-05-17 10:03 ` Jan (janneke) Nieuwenhuizen
  2020-05-17 10:03   ` [bug#41350] [PATCH 2/3] system: vm: Do not register-closures when cross-building Jan (janneke) Nieuwenhuizen
  2020-05-17 10:03   ` [bug#41350] [PATCH 3/3] system: vm: Build vm-image using native qemu Jan (janneke) Nieuwenhuizen
  2020-05-18  9:10 ` [bug#41350] [PATCH 0/3] Use native qemu to build vm-image Mathieu Othacehe
                   ` (4 subsequent siblings)
  5 siblings, 2 replies; 48+ messages in thread
From: Jan (janneke) Nieuwenhuizen @ 2020-05-17 10:03 UTC (permalink / raw)
  To: 41350

This supports calling reset-timestamps without loading sqlite3.

* guix/store/database.scm (reset-timestamps): Move to...
* guix/utils.scm (reset-timestamps): ... here.
* gnu/build/vm.scm: Include it.
---
 gnu/build/vm.scm        |  1 +
 guix/store/database.scm | 41 +++--------------------------------------
 guix/utils.scm          | 41 ++++++++++++++++++++++++++++++++++++++---
 3 files changed, 42 insertions(+), 41 deletions(-)

diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm
index 433b5a7e8d..c751e6b0e2 100644
--- a/gnu/build/vm.scm
+++ b/gnu/build/vm.scm
@@ -26,6 +26,7 @@
   #:use-module (guix build utils)
   #:use-module (guix build store-copy)
   #:use-module (guix build syscalls)
+  #:use-module ((guix utils) #:select (reset-timestamps))
   #:use-module (guix store database)
   #:use-module (gnu build bootloader)
   #:use-module (gnu build linux-boot)
diff --git a/guix/store/database.scm b/guix/store/database.scm
index ef52036ede..b8fe313c3d 100644
--- a/guix/store/database.scm
+++ b/guix/store/database.scm
@@ -24,9 +24,8 @@
   #:use-module (guix store deduplication)
   #:use-module (guix base16)
   #:use-module (guix progress)
-  #:use-module (guix build syscalls)
-  #:use-module ((guix build utils)
-                #:select (mkdir-p executable-file?))
+  #:use-module ((guix build utils) #:select (mkdir-p))
+  #:use-module ((guix utils) #:select (reset-timestamps))
   #:use-module (guix build store-copy)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-11)
@@ -42,8 +41,7 @@
             sqlite-register
             register-path
             register-items
-            %epoch
-            reset-timestamps))
+            %epoch))
 
 ;;; Code for working with the store database directly.
 
@@ -227,39 +225,6 @@ Every store item in REFERENCES must already be registered."
 ;;;
 ;;; High-level interface.
 ;;;
-
-(define* (reset-timestamps file #:key preserve-permissions?)
-  "Reset the modification time on FILE and on all the files it contains, if
-it's a directory.  Canonicalize file permissions unless PRESERVE-PERMISSIONS?
-is true."
-  ;; Note: We're resetting to one second after the Epoch like 'guix-daemon'
-  ;; has always done.
-  (let loop ((file file)
-             (type (stat:type (lstat file))))
-    (case type
-      ((directory)
-       (unless preserve-permissions?
-         (chmod file #o555))
-       (utime file 1 1 0 0)
-       (let ((parent file))
-         (for-each (match-lambda
-                     (("." . _) #f)
-                     ((".." . _) #f)
-                     ((file . properties)
-                      (let ((file (string-append parent "/" file)))
-                        (loop file
-                              (match (assoc-ref properties 'type)
-                                ((or 'unknown #f)
-                                 (stat:type (lstat file)))
-                                (type type))))))
-                   (scandir* parent))))
-      ((symlink)
-       (utime file 1 1 0 0 AT_SYMLINK_NOFOLLOW))
-      (else
-       (unless preserve-permissions?
-         (chmod file (if (executable-file? file) #o555 #o444)))
-       (utime file 1 1 0 0)))))
-
 (define* (register-path path
                         #:key (references '()) deriver prefix
                         state-directory (deduplicate? #t)
diff --git a/guix/utils.scm b/guix/utils.scm
index d7b197fa44..812617dd61 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -35,8 +35,10 @@
   #:use-module (rnrs io ports)                    ;need 'port-position' etc.
   #:use-module ((rnrs bytevectors) #:select (bytevector-u8-set!))
   #:use-module (guix memoization)
-  #:use-module ((guix build utils) #:select (dump-port mkdir-p delete-file-recursively))
-  #:use-module ((guix build syscalls) #:select (mkdtemp! fdatasync))
+  #:use-module ((guix build utils)
+                #:select (dump-port mkdir-p delete-file-recursively
+                                    executable-file?))
+  #:use-module ((guix build syscalls) #:select (mkdtemp! fdatasync scandir*))
   #:use-module (ice-9 format)
   #:use-module (ice-9 regex)
   #:use-module (ice-9 match)
@@ -109,7 +111,8 @@
             call-with-decompressed-port
             compressed-output-port
             call-with-compressed-output-port
-            canonical-newline-port))
+            canonical-newline-port
+            reset-timestamps))
 
 \f
 ;;;
@@ -843,6 +846,38 @@ a location object."
   fix-hint?
   (hint condition-fix-hint))                      ;string
 
+(define* (reset-timestamps file #:key preserve-permissions?)
+  "Reset the modification time on FILE and on all the files it contains, if
+it's a directory.  Canonicalize file permissions unless PRESERVE-PERMISSIONS?
+is true."
+  ;; Note: We're resetting to one second after the Epoch like 'guix-daemon'
+  ;; has always done.
+  (let loop ((file file)
+             (type (stat:type (lstat file))))
+    (case type
+      ((directory)
+       (unless preserve-permissions?
+         (chmod file #o555))
+       (utime file 1 1 0 0)
+       (let ((parent file))
+         (for-each (match-lambda
+                     (("." . _) #f)
+                     ((".." . _) #f)
+                     ((file . properties)
+                      (let ((file (string-append parent "/" file)))
+                        (loop file
+                              (match (assoc-ref properties 'type)
+                                ((or 'unknown #f)
+                                 (stat:type (lstat file)))
+                                (type type))))))
+                   (scandir* parent))))
+      ((symlink)
+       (utime file 1 1 0 0 AT_SYMLINK_NOFOLLOW))
+      (else
+       (unless preserve-permissions?
+         (chmod file (if (executable-file? file) #o555 #o444)))
+       (utime file 1 1 0 0)))))
+
 ;;; Local Variables:
 ;;; eval: (put 'call-with-progress-reporter 'scheme-indent-function 1)
 ;;; End:
-- 
2.26.0





^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH 2/3] system: vm: Do not register-closures when cross-building.
  2020-05-17 10:03 ` [bug#41350] [PATCH 1/3] utils: Move 'reset-timestamps' out of database Jan (janneke) Nieuwenhuizen
@ 2020-05-17 10:03   ` Jan (janneke) Nieuwenhuizen
  2020-05-17 10:03   ` [bug#41350] [PATCH 3/3] system: vm: Build vm-image using native qemu Jan (janneke) Nieuwenhuizen
  1 sibling, 0 replies; 48+ messages in thread
From: Jan (janneke) Nieuwenhuizen @ 2020-05-17 10:03 UTC (permalink / raw)
  To: 41350

This supports cross-building building a vm-image, running a native qemu.

* gnu/system/vm.scm (qemu-image)[register-closures?]: Default to #f when
cross-compiling.  Only create sql-schema when actually registering closures.
---
 gnu/build/vm.scm  | 2 +-
 gnu/system/vm.scm | 8 +++++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm
index c751e6b0e2..2b36dd29ce 100644
--- a/gnu/build/vm.scm
+++ b/gnu/build/vm.scm
@@ -27,7 +27,7 @@
   #:use-module (guix build store-copy)
   #:use-module (guix build syscalls)
   #:use-module ((guix utils) #:select (reset-timestamps))
-  #:use-module (guix store database)
+  #:autoload (guix store database) (%epoch register-items sql-schema)
   #:use-module (gnu build bootloader)
   #:use-module (gnu build linux-boot)
   #:use-module (gnu build install)
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index 3e483fd86c..97b0bf461b 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -286,7 +286,8 @@ substitutable."
                      os
                      bootcfg-drv
                      bootloader
-                     (register-closures? (has-guix-service-type? os))
+                     (register-closures? (and (has-guix-service-type? os)
+                                              (not target)))
                      (inputs '())
                      copy-inputs?
                      (substitutable? #t))
@@ -333,12 +334,13 @@ system that is passed to 'populate-root-file-system'."
                         ((gnu build linux-boot)
                          #:select (make-essential-device-nodes
                                    make-hurd-device-nodes))
-                        (guix store database)
                         (guix build utils)
                         (srfi srfi-26)
                         (ice-9 binary-ports))
 
-           (sql-schema #$schema)
+           (when #$register-closures?
+             (use-modules (guix store database))
+             (sql-schema #$schema))
 
            ;; Allow non-ASCII file names--e.g., 'nss-certs'--to be decoded.
            (setenv "GUIX_LOCPATH"
-- 
2.26.0





^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH 3/3] system: vm: Build vm-image using native qemu.
  2020-05-17 10:03 ` [bug#41350] [PATCH 1/3] utils: Move 'reset-timestamps' out of database Jan (janneke) Nieuwenhuizen
  2020-05-17 10:03   ` [bug#41350] [PATCH 2/3] system: vm: Do not register-closures when cross-building Jan (janneke) Nieuwenhuizen
@ 2020-05-17 10:03   ` Jan (janneke) Nieuwenhuizen
  1 sibling, 0 replies; 48+ messages in thread
From: Jan (janneke) Nieuwenhuizen @ 2020-05-17 10:03 UTC (permalink / raw)
  To: 41350; +Cc: Ludovic Courtès

Cross-building a vm-image used to be done using a cross-qemu, e.g, qemu-ARM.
That does not work for the Hurd, as there is no qemu-HURD.

This patch switches to cross building vm-images using a native qemu vm.

* gnu/system/vm.scm (expression->derivation-in-linux-vm): Run native
qemu-command; use native linux, initrd, bootloader-package and
bootloader-installer.
[preserve-target]: New helper to install cross-packages into the native vm.
* gnu/bootloader/grub.scm (eye-candy): Use native font.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
---
 gnu/bootloader/grub.scm |  4 ++--
 gnu/system/vm.scm       | 46 ++++++++++++++++++++++++++---------------
 2 files changed, 31 insertions(+), 19 deletions(-)

diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm
index 8c5b5eac0c..842592ccc9 100644
--- a/gnu/bootloader/grub.scm
+++ b/gnu/bootloader/grub.scm
@@ -211,8 +211,8 @@ else
   set menu_color_highlight=white/blue
 fi~%"
                  #$setup-gfxterm-body
-                 #$(grub-root-search store-device font-file)
-                 #$(setup-gfxterm config font-file)
+                 #+(grub-root-search store-device font-file)
+                 #+(setup-gfxterm config font-file)
                  #$(grub-setup-io config)
 
                  #$(strip-mount-point store-mount-point image)
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index 97b0bf461b..aa094b0a06 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2018 Chris Marusich <cmmarusich@gmail.com>
+;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -180,19 +181,30 @@ made available under the /xchg CIFS share.
 SUBSTITUTABLE? determines whether the returned derivation should be marked as
 substitutable."
   (define user-builder
-    (program-file "builder-in-linux-vm" exp))
+    (scheme-file "builder-in-linux-vm" exp))
+
+  (define (preserve-target obj)
+    (if target
+        (with-parameters ((%current-target-system target))
+          obj)
+        obj))
 
   (define loader
-    ;; Invoke USER-BUILDER instead using 'primitive-load'.  The reason for
-    ;; this is to allow USER-BUILDER to dlopen stuff by using a full-featured
-    ;; Guile, which it couldn't do using the statically-linked guile used in
-    ;; the initrd.  See example at
+    ;; Instead of using 'primitive-load', evaluate USER-BUILDER in a
+    ;; full-featured Guile so it can use dlopen stuff, which it couldn't do
+    ;; using the statically-linked guile used in the initrd.  See example at
     ;; <https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00233.html>.
     (program-file "linux-vm-loader"
-                  ;; Communicate USER-BUILDER's exit status via /xchg so that
-                  ;; the host can distinguish between success, failure, and
-                  ;; kernel panic.
-                  #~(let ((status (system* #$user-builder)))
+                  ;; When cross-compiling, USER-BUILDER refers to the target
+                  ;; (cross-compiled) system.  Preserve that, even though
+                  ;; LOADER itself is executed as a native program.
+                  #~(let ((status (system* #+(file-append (default-guile)
+                                                          "/bin/guile")
+                                           "--no-auto-compile"
+                                           #$(preserve-target user-builder))))
+                      ;; Communicate USER-BUILDER's exit status via /xchg so
+                      ;; that the host can distinguish between success,
+                      ;; failure, and kernel panic.
                       (call-with-output-file "/xchg/.exit-status"
                         (lambda (port)
                           (write status port)))
@@ -226,10 +238,10 @@ substitutable."
 
               (let* ((native-inputs
                       '#+(list qemu (canonical-package coreutils)))
-                     (linux   (string-append #$linux "/"
-                                             #$(system-linux-image-file-name)))
-                     (initrd  #$initrd)
-                     (loader  #$loader)
+                     (linux   (string-append #+linux "/"
+                                             #+(system-linux-image-file-name)))
+                     (initrd  #+initrd)
+                     (loader  #+loader)
                      (graphs  '#$(match references-graphs
                                    (((graph-files . _) ...) graph-files)
                                    (_ #f)))
@@ -245,7 +257,7 @@ substitutable."
                 (load-in-linux-vm loader
                                   #:output #$output
                                   #:linux linux #:initrd initrd
-                                  #:qemu (qemu-command target)
+                                  #:qemu (qemu-command)
                                   #:memory-size #$memory-size
                                   #:make-disk-image? #$make-disk-image?
                                   #:single-file-output? #$single-file-output?
@@ -348,7 +360,7 @@ system that is passed to 'populate-root-file-system'."
            (setlocale LC_ALL "en_US.utf8")
 
            (let ((inputs
-                  '#$(append (list parted e2fsprogs dosfstools)
+                  '#+(append (list parted e2fsprogs dosfstools)
                              (map canonical-package
                                   (list sed grep coreutils findutils gawk))))
 
@@ -425,12 +437,12 @@ system that is passed to 'populate-root-file-system'."
                                      #:partitions partitions
                                      #:grub-efi grub-efi
                                      #:bootloader-package
-                                     #$(bootloader-package bootloader)
+                                     #+(bootloader-package bootloader)
                                      #:bootcfg #$bootcfg-drv
                                      #:bootcfg-location
                                      #$(bootloader-configuration-file bootloader)
                                      #:bootloader-installer
-                                     #$(bootloader-installer bootloader)))))))
+                                     #+(bootloader-installer bootloader)))))))
    #:system system
    #:target target
    #:make-disk-image? #t
-- 
2.26.0





^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH 0/3] Use native qemu to build vm-image.
  2020-05-17 10:01 [bug#41350] [PATCH 0/3] Use native qemu to build vm-image Jan Nieuwenhuizen
  2020-05-17 10:03 ` [bug#41350] [PATCH 1/3] utils: Move 'reset-timestamps' out of database Jan (janneke) Nieuwenhuizen
@ 2020-05-18  9:10 ` Mathieu Othacehe
  2020-05-19  7:22   ` Jan Nieuwenhuizen
  2020-05-19  7:23 ` [bug#41350] [PATCH v2 1/3] utils: Move 'reset-timestamps' out of database Jan (janneke) Nieuwenhuizen
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 48+ messages in thread
From: Mathieu Othacehe @ 2020-05-18  9:10 UTC (permalink / raw)
  To: Jan Nieuwenhuizen; +Cc: 41350


Hello Jan,

> Cross-building a vm-image used to be done using a cross-qemu, e.g, qemu-ARM.
> That does not work for the Hurd, as there is no qemu-HURD.

Yes that's an issue.

>
> This patch switches to cross building vm-images using a native qemu vm.  If
> there a reason for using qemu-TARGET we may want to make this switch
> conditional for cross building to the Hurd?

Well first this 'vm-image' thing should be done in (gnu system image) as
soon as I have sorted out the bootloader issue. So the solution we will
find to overcome this Hurd issue will be temporary I hope.

About using qemu-TARGET, let say you are on an armhf machine and you
want to cross-build an x86-64 image. I fear that using a native, armhf
Grub to install an x86-64 Grub won't work.

So maybe, it would be better to do that only for the architectures
without an available qemu-TARGET (only the Hurd for now)?

> ...the problem is now avoided by removing the sqlite dependency when
> cross-building by not registering closures and postponing the loading of (gnu
> store database) and thus (sqlite3).

When I produce a system without register closures, once booted, "guix
build" something does not work. I don't know if its possible for
guix-daemon to work without its database. An option could be to generate
this database if its absent, at first boot?

>     ./pre-inst-env guix system vm-image --target=i586-pc-gnu --no-grafts \
>         gnu/system/examples/bare-hurd.tmpl
>
> now produces a pretty nice hurd VM :-)

Great to see you so close :)

Thanks,

Mathieu




^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH 0/3] Use native qemu to build vm-image.
  2020-05-18  9:10 ` [bug#41350] [PATCH 0/3] Use native qemu to build vm-image Mathieu Othacehe
@ 2020-05-19  7:22   ` Jan Nieuwenhuizen
  2020-05-19 10:02     ` Mathieu Othacehe
  0 siblings, 1 reply; 48+ messages in thread
From: Jan Nieuwenhuizen @ 2020-05-19  7:22 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: 41350

Mathieu Othacehe writes:

Hello Mathieu,

Thanks for chiming in, I meant to CC you...  :-)

>> Cross-building a vm-image used to be done using a cross-qemu, e.g, qemu-ARM.
>> That does not work for the Hurd, as there is no qemu-HURD.
>
> Yes that's an issue.

Yes...luckily I think we found a way to use qemu-NATIVE to build
packages for the Hurd.  Now to see if this can be put into digestible
form.

>> This patch switches to cross building vm-images using a native qemu vm.  If
>> there a reason for using qemu-TARGET we may want to make this switch
>> conditional for cross building to the Hurd?
>
> Well first this 'vm-image' thing should be done in (gnu system image) as
> soon as I have sorted out the bootloader issue. So the solution we will
> find to overcome this Hurd issue will be temporary I hope.

Can you elaborate a bit on that?  Do you think it makes sense to continue
this temporary path some more (as it starts to work right now), or can we
better abandon it and work the permanent solution?  How could I contribute?

> About using qemu-TARGET, let say you are on an armhf machine and you
> want to cross-build an x86-64 image. I fear that using a native, armhf
> Grub to install an x86-64 Grub won't work.

Ah...right, that's helpful information.

> So maybe, it would be better to do that only for the architectures
> without an available qemu-TARGET (only the Hurd for now)?

OK -- I have changed patch 2 and 3, and am sending a new patch set.

>> ...the problem is now avoided by removing the sqlite dependency when
>> cross-building by not registering closures and postponing the loading of (gnu
>> store database) and thus (sqlite3).
>
> When I produce a system without register closures, once booted, "guix
> build" something does not work. I don't know if its possible for
> guix-daemon to work without its database. An option could be to generate
> this database if its absent, at first boot?

Ah, OK.  I'm using this "solution" to use #:register-closures? #f now
for the Hurd only and we'll hit the problem that causes later.  We can
then, s discussed on IRC, sqlite3 databases are indeed platform
independent and we could use something like guix/scripts/pack.scm's
store-database.  WDYT?

>>     ./pre-inst-env guix system vm-image --target=i586-pc-gnu --no-grafts \
>>         gnu/system/examples/bare-hurd.tmpl
>>
>> now produces a pretty nice hurd VM :-)
>
> Great to see you so close :)

Yes...

Greetings,
janneke

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




^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH v2 1/3] utils: Move 'reset-timestamps' out of database.
  2020-05-17 10:01 [bug#41350] [PATCH 0/3] Use native qemu to build vm-image Jan Nieuwenhuizen
  2020-05-17 10:03 ` [bug#41350] [PATCH 1/3] utils: Move 'reset-timestamps' out of database Jan (janneke) Nieuwenhuizen
  2020-05-18  9:10 ` [bug#41350] [PATCH 0/3] Use native qemu to build vm-image Mathieu Othacehe
@ 2020-05-19  7:23 ` Jan (janneke) Nieuwenhuizen
  2020-05-19  7:23   ` [bug#41350] [PATCH v2 2/3] system: vm: Do not register-closures when cross-building to the Hurd Jan (janneke) Nieuwenhuizen
  2020-05-19  7:23   ` [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for " Jan (janneke) Nieuwenhuizen
  2020-05-22 19:24 ` Mathieu Othacehe
                   ` (2 subsequent siblings)
  5 siblings, 2 replies; 48+ messages in thread
From: Jan (janneke) Nieuwenhuizen @ 2020-05-19  7:23 UTC (permalink / raw)
  To: 41350, Mathieu Othacehe

This supports calling reset-timestamps without loading sqlite3.

* guix/store/database.scm (reset-timestamps): Move to...
* guix/utils.scm (reset-timestamps): ... here.
* gnu/build/vm.scm: Include it.
---
 gnu/build/vm.scm        |  1 +
 guix/store/database.scm | 41 +++--------------------------------------
 guix/utils.scm          | 41 ++++++++++++++++++++++++++++++++++++++---
 3 files changed, 42 insertions(+), 41 deletions(-)

diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm
index 433b5a7e8d..c751e6b0e2 100644
--- a/gnu/build/vm.scm
+++ b/gnu/build/vm.scm
@@ -26,6 +26,7 @@
   #:use-module (guix build utils)
   #:use-module (guix build store-copy)
   #:use-module (guix build syscalls)
+  #:use-module ((guix utils) #:select (reset-timestamps))
   #:use-module (guix store database)
   #:use-module (gnu build bootloader)
   #:use-module (gnu build linux-boot)
diff --git a/guix/store/database.scm b/guix/store/database.scm
index ef52036ede..b8fe313c3d 100644
--- a/guix/store/database.scm
+++ b/guix/store/database.scm
@@ -24,9 +24,8 @@
   #:use-module (guix store deduplication)
   #:use-module (guix base16)
   #:use-module (guix progress)
-  #:use-module (guix build syscalls)
-  #:use-module ((guix build utils)
-                #:select (mkdir-p executable-file?))
+  #:use-module ((guix build utils) #:select (mkdir-p))
+  #:use-module ((guix utils) #:select (reset-timestamps))
   #:use-module (guix build store-copy)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-11)
@@ -42,8 +41,7 @@
             sqlite-register
             register-path
             register-items
-            %epoch
-            reset-timestamps))
+            %epoch))
 
 ;;; Code for working with the store database directly.
 
@@ -227,39 +225,6 @@ Every store item in REFERENCES must already be registered."
 ;;;
 ;;; High-level interface.
 ;;;
-
-(define* (reset-timestamps file #:key preserve-permissions?)
-  "Reset the modification time on FILE and on all the files it contains, if
-it's a directory.  Canonicalize file permissions unless PRESERVE-PERMISSIONS?
-is true."
-  ;; Note: We're resetting to one second after the Epoch like 'guix-daemon'
-  ;; has always done.
-  (let loop ((file file)
-             (type (stat:type (lstat file))))
-    (case type
-      ((directory)
-       (unless preserve-permissions?
-         (chmod file #o555))
-       (utime file 1 1 0 0)
-       (let ((parent file))
-         (for-each (match-lambda
-                     (("." . _) #f)
-                     ((".." . _) #f)
-                     ((file . properties)
-                      (let ((file (string-append parent "/" file)))
-                        (loop file
-                              (match (assoc-ref properties 'type)
-                                ((or 'unknown #f)
-                                 (stat:type (lstat file)))
-                                (type type))))))
-                   (scandir* parent))))
-      ((symlink)
-       (utime file 1 1 0 0 AT_SYMLINK_NOFOLLOW))
-      (else
-       (unless preserve-permissions?
-         (chmod file (if (executable-file? file) #o555 #o444)))
-       (utime file 1 1 0 0)))))
-
 (define* (register-path path
                         #:key (references '()) deriver prefix
                         state-directory (deduplicate? #t)
diff --git a/guix/utils.scm b/guix/utils.scm
index d7b197fa44..812617dd61 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -35,8 +35,10 @@
   #:use-module (rnrs io ports)                    ;need 'port-position' etc.
   #:use-module ((rnrs bytevectors) #:select (bytevector-u8-set!))
   #:use-module (guix memoization)
-  #:use-module ((guix build utils) #:select (dump-port mkdir-p delete-file-recursively))
-  #:use-module ((guix build syscalls) #:select (mkdtemp! fdatasync))
+  #:use-module ((guix build utils)
+                #:select (dump-port mkdir-p delete-file-recursively
+                                    executable-file?))
+  #:use-module ((guix build syscalls) #:select (mkdtemp! fdatasync scandir*))
   #:use-module (ice-9 format)
   #:use-module (ice-9 regex)
   #:use-module (ice-9 match)
@@ -109,7 +111,8 @@
             call-with-decompressed-port
             compressed-output-port
             call-with-compressed-output-port
-            canonical-newline-port))
+            canonical-newline-port
+            reset-timestamps))
 
 \f
 ;;;
@@ -843,6 +846,38 @@ a location object."
   fix-hint?
   (hint condition-fix-hint))                      ;string
 
+(define* (reset-timestamps file #:key preserve-permissions?)
+  "Reset the modification time on FILE and on all the files it contains, if
+it's a directory.  Canonicalize file permissions unless PRESERVE-PERMISSIONS?
+is true."
+  ;; Note: We're resetting to one second after the Epoch like 'guix-daemon'
+  ;; has always done.
+  (let loop ((file file)
+             (type (stat:type (lstat file))))
+    (case type
+      ((directory)
+       (unless preserve-permissions?
+         (chmod file #o555))
+       (utime file 1 1 0 0)
+       (let ((parent file))
+         (for-each (match-lambda
+                     (("." . _) #f)
+                     ((".." . _) #f)
+                     ((file . properties)
+                      (let ((file (string-append parent "/" file)))
+                        (loop file
+                              (match (assoc-ref properties 'type)
+                                ((or 'unknown #f)
+                                 (stat:type (lstat file)))
+                                (type type))))))
+                   (scandir* parent))))
+      ((symlink)
+       (utime file 1 1 0 0 AT_SYMLINK_NOFOLLOW))
+      (else
+       (unless preserve-permissions?
+         (chmod file (if (executable-file? file) #o555 #o444)))
+       (utime file 1 1 0 0)))))
+
 ;;; Local Variables:
 ;;; eval: (put 'call-with-progress-reporter 'scheme-indent-function 1)
 ;;; End:
-- 
2.26.2





^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH v2 2/3] system: vm: Do not register-closures when cross-building to the Hurd.
  2020-05-19  7:23 ` [bug#41350] [PATCH v2 1/3] utils: Move 'reset-timestamps' out of database Jan (janneke) Nieuwenhuizen
@ 2020-05-19  7:23   ` Jan (janneke) Nieuwenhuizen
  2020-05-19  7:23   ` [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for " Jan (janneke) Nieuwenhuizen
  1 sibling, 0 replies; 48+ messages in thread
From: Jan (janneke) Nieuwenhuizen @ 2020-05-19  7:23 UTC (permalink / raw)
  To: 41350, Mathieu Othacehe

This supports cross-building building a vm-image for the Hurd, running a
native qemu.

* gnu/system/vm.scm (qemu-image)[register-closures?]: Default to #f when
cross-compiling to the Hurd.  Only create sql-schema when actually registering
closures.
---
 gnu/build/vm.scm  | 2 +-
 gnu/system/vm.scm | 9 ++++++---
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm
index c751e6b0e2..2b36dd29ce 100644
--- a/gnu/build/vm.scm
+++ b/gnu/build/vm.scm
@@ -27,7 +27,7 @@
   #:use-module (guix build store-copy)
   #:use-module (guix build syscalls)
   #:use-module ((guix utils) #:select (reset-timestamps))
-  #:use-module (guix store database)
+  #:autoload (guix store database) (%epoch register-items sql-schema)
   #:use-module (gnu build bootloader)
   #:use-module (gnu build linux-boot)
   #:use-module (gnu build install)
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index 3e483fd86c..b343141c18 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -51,6 +51,7 @@
   #:use-module (gnu packages zile)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages admin)
+  #:use-module (gnu packages hurd)
 
   #:use-module (gnu bootloader)
   #:use-module (gnu bootloader grub)
@@ -286,7 +287,8 @@ substitutable."
                      os
                      bootcfg-drv
                      bootloader
-                     (register-closures? (has-guix-service-type? os))
+                     (register-closures? (and (has-guix-service-type? os)
+                                              (not (hurd-target?))))
                      (inputs '())
                      copy-inputs?
                      (substitutable? #t))
@@ -333,12 +335,13 @@ system that is passed to 'populate-root-file-system'."
                         ((gnu build linux-boot)
                          #:select (make-essential-device-nodes
                                    make-hurd-device-nodes))
-                        (guix store database)
                         (guix build utils)
                         (srfi srfi-26)
                         (ice-9 binary-ports))
 
-           (sql-schema #$schema)
+           (when #$register-closures?
+             (use-modules (guix store database))
+             (sql-schema #$schema))
 
            ;; Allow non-ASCII file names--e.g., 'nss-certs'--to be decoded.
            (setenv "GUIX_LOCPATH"
-- 
2.26.2





^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd.
  2020-05-19  7:23 ` [bug#41350] [PATCH v2 1/3] utils: Move 'reset-timestamps' out of database Jan (janneke) Nieuwenhuizen
  2020-05-19  7:23   ` [bug#41350] [PATCH v2 2/3] system: vm: Do not register-closures when cross-building to the Hurd Jan (janneke) Nieuwenhuizen
@ 2020-05-19  7:23   ` Jan (janneke) Nieuwenhuizen
  2020-05-19  9:14     ` Mathieu Othacehe
  2020-05-20 21:58     ` Ludovic Courtès
  1 sibling, 2 replies; 48+ messages in thread
From: Jan (janneke) Nieuwenhuizen @ 2020-05-19  7:23 UTC (permalink / raw)
  To: 41350, Mathieu Othacehe; +Cc: Ludovic Courtès

Cross-building a vm-image is usually done using a cross-qemu, e.g, qemu-ARM,
because, e.g., a native, x86_64 Grub cannot install an armhf-Grub.  That
solution does not work for the Hurd, as there is no qemu-HURD.

This patch enables cross building vm-images for the Hurd using a native qemu
vm.

* gnu/system/vm.scm (expression->derivation-in-linux-vm): Run native
qemu-command; use native linux, initrd, bootloader-package and
bootloader-installer, for the Hurd.
[preserve-target]: New helper to install cross-packages into the native vm.
* gnu/bootloader/grub.scm (eye-candy): Use native font, for the Hurd.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
---
 gnu/bootloader/grub.scm |  9 +++--
 gnu/system/vm.scm       | 78 +++++++++++++++++++++++++++++++----------
 2 files changed, 66 insertions(+), 21 deletions(-)

diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm
index 8c5b5eac0c..cee4c9f6c5 100644
--- a/gnu/bootloader/grub.scm
+++ b/gnu/bootloader/grub.scm
@@ -31,6 +31,7 @@
   #:use-module (gnu system file-systems)
   #:use-module (gnu system keyboard)
   #:use-module (gnu packages bootloaders)
+  #:use-module (gnu packages hurd)
   #:autoload   (gnu packages gtk) (guile-cairo guile-rsvg)
   #:autoload   (gnu packages xorg) (xkeyboard-config)
   #:use-module (ice-9 match)
@@ -211,8 +212,12 @@ else
   set menu_color_highlight=white/blue
 fi~%"
                  #$setup-gfxterm-body
-                 #$(grub-root-search store-device font-file)
-                 #$(setup-gfxterm config font-file)
+                 #$(if (hurd-target?)
+                       #~#+(grub-root-search store-device font-file)
+                       (grub-root-search store-device font-file))
+                 #$(if (hurd-target?)
+                       #~#+(setup-gfxterm config font-file)
+                       (setup-gfxterm config font-file))
                  #$(grub-setup-io config)
 
                  #$(strip-mount-point store-mount-point image)
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index b343141c18..527596421d 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2018 Chris Marusich <cmmarusich@gmail.com>
+;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -181,19 +182,36 @@ made available under the /xchg CIFS share.
 SUBSTITUTABLE? determines whether the returned derivation should be marked as
 substitutable."
   (define user-builder
-    (program-file "builder-in-linux-vm" exp))
+    (scheme-file "builder-in-linux-vm" exp))
+
+  (define (preserve-target obj)
+    (if target
+        (with-parameters ((%current-target-system target))
+          obj)
+        obj))
 
   (define loader
-    ;; Invoke USER-BUILDER instead using 'primitive-load'.  The reason for
-    ;; this is to allow USER-BUILDER to dlopen stuff by using a full-featured
-    ;; Guile, which it couldn't do using the statically-linked guile used in
-    ;; the initrd.  See example at
+    ;; Instead of using 'primitive-load', evaluate USER-BUILDER in a
+    ;; full-featured Guile so it can use dlopen stuff, which it couldn't do
+    ;; using the statically-linked guile used in the initrd.  See example at
     ;; <https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00233.html>.
     (program-file "linux-vm-loader"
-                  ;; Communicate USER-BUILDER's exit status via /xchg so that
-                  ;; the host can distinguish between success, failure, and
-                  ;; kernel panic.
-                  #~(let ((status (system* #$user-builder)))
+                  ;; When cross-compiling, USER-BUILDER refers to the target
+                  ;; (cross-compiled) system.  Preserve that, even though
+                  ;; LOADER itself is executed as a native program.
+                  #~(let* ((guile #$(if (hurd-target?)
+                                        #~#+(file-append (default-guile)
+                                                         "/bin/guile")
+                                        (file-append (default-guile)
+                                                     "/bin/guile")))
+                           (status (system* guile "--no-auto-compile"
+                                            #$(if (hurd-target?)
+                                                  (preserve-target user-builder)
+                                                  user-builder))))
+
+                      ;; Communicate USER-BUILDER's exit status via /xchg so
+                      ;; that the host can distinguish between success,
+                      ;; failure, and kernel panic.
                       (call-with-output-file "/xchg/.exit-status"
                         (lambda (port)
                           (write status port)))
@@ -227,10 +245,16 @@ substitutable."
 
               (let* ((native-inputs
                       '#+(list qemu (canonical-package coreutils)))
-                     (linux   (string-append #$linux "/"
-                                             #$(system-linux-image-file-name)))
-                     (initrd  #$initrd)
-                     (loader  #$loader)
+
+                     (loader  #$(if (hurd-target?) #~#+loader loader))
+                     (linux   #$(if (hurd-target?)
+                                    #~(string-append
+                                       #+linux "/"
+                                       #+(system-linux-image-file-name))
+                                    #~(string-append
+                                       #$linux "/"
+                                       #$(system-linux-image-file-name))))
+                     (initrd #$(if (hurd-target?) #~#+initrd initrd))
                      (graphs  '#$(match references-graphs
                                    (((graph-files . _) ...) graph-files)
                                    (_ #f)))
@@ -246,7 +270,9 @@ substitutable."
                 (load-in-linux-vm loader
                                   #:output #$output
                                   #:linux linux #:initrd initrd
-                                  #:qemu (qemu-command target)
+                                  #:qemu #$(if (hurd-target?)
+                                               (qemu-command)
+                                               (qemu-command target))
                                   #:memory-size #$memory-size
                                   #:make-disk-image? #$make-disk-image?
                                   #:single-file-output? #$single-file-output?
@@ -288,7 +314,9 @@ substitutable."
                      bootcfg-drv
                      bootloader
                      (register-closures? (and (has-guix-service-type? os)
-                                              (not (hurd-target?))))
+                                              (not target)
+                                        ;(not (hurd-target?))
+                     ))
                      (inputs '())
                      copy-inputs?
                      (substitutable? #t))
@@ -349,9 +377,17 @@ system that is passed to 'populate-root-file-system'."
            (setlocale LC_ALL "en_US.utf8")
 
            (let ((inputs
-                  '#$(append (list parted e2fsprogs dosfstools)
+                  '#+(append (list parted e2fsprogs dosfstools)
                              (map canonical-package
-                                  (list sed grep coreutils findutils gawk))))
+                                  (list sed grep coreutils findutils gawk)))
+                  ;; (if #$(hurd-target?)
+                  ;;     '#+(append (list parted e2fsprogs dosfstools)
+                  ;;                    (map canonical-package
+                  ;;                         (list sed grep coreutils findutils gawk)))
+                  ;;     '#$(append (list parted e2fsprogs dosfstools)
+                  ;;                (map canonical-package
+                  ;;                     (list sed grep coreutils findutils gawk))))
+                  )
 
                  ;; This variable is unused but allows us to add INPUTS-TO-COPY
                  ;; as inputs.
@@ -426,12 +462,16 @@ system that is passed to 'populate-root-file-system'."
                                      #:partitions partitions
                                      #:grub-efi grub-efi
                                      #:bootloader-package
-                                     #$(bootloader-package bootloader)
+                                     (if #$(hurd-target?)
+                                         #+(bootloader-package bootloader)
+                                         #$(bootloader-package bootloader))
                                      #:bootcfg #$bootcfg-drv
                                      #:bootcfg-location
                                      #$(bootloader-configuration-file bootloader)
                                      #:bootloader-installer
-                                     #$(bootloader-installer bootloader)))))))
+                                     (if #$(hurd-target?)
+                                         #+(bootloader-installer bootloader)
+                                         #$(bootloader-installer bootloader))))))))
    #:system system
    #:target target
    #:make-disk-image? #t
-- 
2.26.2





^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd.
  2020-05-19  7:23   ` [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for " Jan (janneke) Nieuwenhuizen
@ 2020-05-19  9:14     ` Mathieu Othacehe
  2020-05-20 21:49       ` Ludovic Courtès
  2020-05-23  9:28       ` Jan Nieuwenhuizen
  2020-05-20 21:58     ` Ludovic Courtès
  1 sibling, 2 replies; 48+ messages in thread
From: Mathieu Othacehe @ 2020-05-19  9:14 UTC (permalink / raw)
  To: Jan (janneke) Nieuwenhuizen; +Cc: Ludovic Courtès, 41350


Hello Janneke,

> +                 #$(if (hurd-target?)
> +                       #~#+(grub-root-search store-device font-file)
> +                       (grub-root-search store-device font-file))
> +                 #$(if (hurd-target?)
> +                       #~#+(setup-gfxterm config font-file)
> +                       (setup-gfxterm config font-file))

I'm not certain that hurd-target? always return the expected answer
here. Now that we have let-system, the safer way to check for the target
system could be to write:

--8<---------------cut here---------------start------------->8---
#$(let-system (system target)
              (hurd-target? system target))
--8<---------------cut here---------------end--------------->8---

Ludo, is this correct? Furthermore, if you make sure that
"grub-root-search" and "setup-gfxterm" return #+, you could maybe drop
this part?

> +
> +                     (loader  #$(if (hurd-target?) #~#+loader loader))
> +                     (linux   #$(if (hurd-target?)
> +                                    #~(string-append
> +                                       #+linux "/"
> +                                       #+(system-linux-image-file-name))
> +                                    #~(string-append
> +                                       #$linux "/"
> +                                       #$(system-linux-image-file-name))))

Same concern as above about "hurd-target?".

> +                  ;; (if #$(hurd-target?)
> +                  ;;     '#+(append (list parted e2fsprogs dosfstools)
> +                  ;;                    (map canonical-package
> +                  ;;                         (list sed grep coreutils findutils gawk)))
> +                  ;;     '#$(append (list parted e2fsprogs dosfstools)
> +                  ;;                (map canonical-package
> +                  ;;                     (list sed grep coreutils findutils gawk))))
> +                  )

Is this needed?

Thanks,

Mathieu




^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH 0/3] Use native qemu to build vm-image.
  2020-05-19  7:22   ` Jan Nieuwenhuizen
@ 2020-05-19 10:02     ` Mathieu Othacehe
  2020-05-20 14:03       ` Mathieu Othacehe
  0 siblings, 1 reply; 48+ messages in thread
From: Mathieu Othacehe @ 2020-05-19 10:02 UTC (permalink / raw)
  To: Jan Nieuwenhuizen; +Cc: 41350


Hello Jan,

>> Well first this 'vm-image' thing should be done in (gnu system image) as
>> soon as I have sorted out the bootloader issue. So the solution we will
>> find to overcome this Hurd issue will be temporary I hope.
>
> Can you elaborate a bit on that?  Do you think it makes sense to continue
> this temporary path some more (as it starts to work right now), or can we
> better abandon it and work the permanent solution?  How could I contribute?

Yes. Besides offering a more modular image creation API, the vocation of
(gnu system image) is to offer a way to generate all kind of Guix system
images (raw disk-images, ISO9660 images, Qemu images) without resorting
to VM for image creation.

Dropping VM, means that the image need to be build on the host, without
root permissions. This brings several limitations. If is no longer
possible to use "mount" for instance, or to call "grub-install".

To get around these limitations, I used the same strategy as Buildroot,
Yocto and OpenWrt that do not require root permissions to generate
disk-images.

For ISO9660 images:

* I first build the "image-root" derivation. It's a store directory that
contains the root file-system.

* Then, I call make-iso9660-image that, run GNU Xorriso on this
directory.

For raw disk-images:

* For each partition, I build the "partition-image-root"
  derivation. This is very similar to "image-root" but for the specified
  partition.

* For each partition root directory, I create the corresponding
  partition image, using tools such as mke2fs or mkdosfs depending on
  the partition file-system type.
  
* Then, I need to "assemble" the partitions in a disk-image. For that, I
  use "genimage" that will roughly use 'dd' to create a final disk-image
  with the partitions copied at the right offsets.
  
* The missing part here is the bootloader installation. As I mentioned,
  grub-install refuses to take a disk-image as argument (it requires a
  mounted partition). For EFI systems there's a work-around. The idea is
  to call grub-mkstandalone to create a Grub binary in the ESP
  partition. This Grub is configured to load the Grub configuration file
  located on the root file-system at /boot/grub/grub.cfg path.

Now back to the Hurd. I see that Debian is producing Hurd ISO images. We
could try to call `guix system disk-image --target=i586-pc-gnu
--file-system-type=iso9660 hurd.scm` and see if it works.

Regarding raw disk-image, I think we could try to produce EFI compatible
Hurd images. We could set the bootloader to grub-efi-bootloader in
%hurd-default-operating-system.

Finally, to produce raw disk-images with grub-minimal-bootloader or
grub-bootloader (what you are trying to do), we need to find a way to
make grub-install work on disk-images (MBR installation and so on). That
true for the Hurd but that's also true for Linux.

Sorry for the long explanation. Please tell me if something is not
clear.

The conclusion here is that, I think that we very few adaptations to
your branch, we should be able to produce Hurd ISO images or Hurd EFI
compatible disk-images. Maybe it would be a first step.

Then, we could find a way to create "MBR compatible" Hurd and Linux
disk-images in (gnu system image).

WDYT?

Thanks,

Mathieu




^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH 0/3] Use native qemu to build vm-image.
  2020-05-19 10:02     ` Mathieu Othacehe
@ 2020-05-20 14:03       ` Mathieu Othacehe
  2020-05-20 15:09         ` Jan Nieuwenhuizen
  0 siblings, 1 reply; 48+ messages in thread
From: Mathieu Othacehe @ 2020-05-20 14:03 UTC (permalink / raw)
  To: Jan Nieuwenhuizen; +Cc: 41350


Hey,

> The conclusion here is that, I think that we very few adaptations to
> your branch, we should be able to produce Hurd ISO images or Hurd EFI
> compatible disk-images. Maybe it would be a first step.
>
> Then, we could find a way to create "MBR compatible" Hurd and Linux
> disk-images in (gnu system image).

Ok, I made further progress. Turns out the Hurd EFI solution was a
dead-end, because I have a "no console will be available to os" message
in Qemu, instead of Hurd console output. I don't feel like debugging
this.

So, back to the MBR solution. I had another look to what OpenWrt is
doing. They found a really nice work-around! As I stated, we cannot use
"grub-install", but this command is in reality a wrapper around
"grub-mkimage" and "grub-bios-setup".

--8<---------------cut here---------------start------------->8---
#######################################
#     #            #                  #
# MBR # MBR-GAP    # FIRST PARTITION  #
#     #            #                  #
#######################################
--8<---------------cut here---------------end--------------->8---

grub-mkimage generates a Grub image, small enough so that it can fit in
the MBR-GAP (the space between the MBR and the first partition).

It cannot contain all Grub modules, but that's not an issue, because
Grub will be able to find missing modules from the first partition when
started.

They also patched grub-bios-setup[1] so that it can work on a raw
disk-image, and install the previously generated "grub.img".

So with the following commands:

--8<---------------cut here---------------start------------->8---
grub-mkimage -O i386-pc -o core.img  biosdisk part_msdos ext2
echo "(hd0) /tmp/my-disk-image" > device.map
grub-bios-setup -m device.map -r "hd0,msdos1" -d tmp /tmp/qemu-image2
--8<---------------cut here---------------end--------------->8---

I'm able to make a Guix system image bootable, without root
permissions. It then starts the Hurd kernel and crashes, but that's
another story :p

So, if it's ok for you, I can integrate this stuff cleanly, and we won't
need the vm-image stuff anymore.

WDYT?

Thanks,

Mathieu

[1]:
https://github.com/openwrt/openwrt/blob/master/package/boot/grub2/patches/100-grub_setup_root.patch




^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH 0/3] Use native qemu to build vm-image.
  2020-05-20 14:03       ` Mathieu Othacehe
@ 2020-05-20 15:09         ` Jan Nieuwenhuizen
  0 siblings, 0 replies; 48+ messages in thread
From: Jan Nieuwenhuizen @ 2020-05-20 15:09 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: Ludovic Courtès, 41350

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

Mathieu Othacehe writes:

Hello Mathieu!

>> The conclusion here is that, I think that we very few adaptations to
>> your branch, we should be able to produce Hurd ISO images or Hurd EFI
>> compatible disk-images. Maybe it would be a first step.
>>
>> Then, we could find a way to create "MBR compatible" Hurd and Linux
>> disk-images in (gnu system image).
>
> Ok, I made further progress. Turns out the Hurd EFI solution was a
> dead-end, because I have a "no console will be available to os" message
> in Qemu, instead of Hurd console output. I don't feel like debugging
> this.

Ah, well that's the only result that I also came up with and wanted to
share.  Maybe Ludo has an idea how to fix that; I could not find
anything helpful yet.

> So, back to the MBR solution. I had another look to what OpenWrt is
> doing. They found a really nice work-around! As I stated, we cannot use
> "grub-install", but this command is in reality a wrapper around
> "grub-mkimage" and "grub-bios-setup".

Ah!  That's good to know.

> #######################################
> #     #            #                  #
> # MBR # MBR-GAP    # FIRST PARTITION  #
> #     #            #                  #
> #######################################
>
>
> grub-mkimage generates a Grub image, small enough so that it can fit in
> the MBR-GAP (the space between the MBR and the first partition).

Okay...

> It cannot contain all Grub modules, but that's not an issue, because
> Grub will be able to find missing modules from the first partition when
> started.

aha...

> They also patched grub-bios-setup[1] so that it can work on a raw
> disk-image, and install the previously generated "grub.img".

So, this is one aspect of what we're avoiding by running grub-install
in a qemu vm, right?  Any idea on the upstream status of this patch?
(I don't think it matters all that much for us, let's use it :-)

> So with the following commands:
>
> grub-mkimage -O i386-pc -o core.img  biosdisk part_msdos ext2
> echo "(hd0) /tmp/my-disk-image" > device.map
> grub-bios-setup -m device.map -r "hd0,msdos1" -d tmp /tmp/qemu-image2
>
> I'm able to make a Guix system image bootable, without root
> permissions. It then starts the Hurd kernel and crashes, but that's
> another story :p

Thats *great*, no really!

> So, if it's ok for you, I can integrate this stuff cleanly, and we won't
> need the vm-image stuff anymore.
>
> WDYT?

That seems a very good idea, I'm cc'ing Ludo to ping him about this.

I'm attaching some hacky work that I did on the patch that you paste'd
to me via IRC, adding som Hurd'y things.  Maybe the pointers are
helpful, but it's all pretty obvious.

Greetings,
Janneke

> [1]:
> https://github.com/openwrt/openwrt/blob/master/package/boot/grub2/patches/100-grub_setup_root.patch


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-WIP-disk-image.patch --]
[-- Type: text/x-patch, Size: 5931 bytes --]

From 9bd218f4d91f79b26ad32cc6c4c1f479febd28de Mon Sep 17 00:00:00 2001
From: "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org>
Date: Tue, 19 May 2020 16:01:42 +0200
Subject: [PATCH] WIP: disk-image

qemu-system-i386 -enable-kvm
            -bios $(guix build ovmf)/share/firmware/ovmf_ia32.bin -hda
            /tmp/qemu-image -m 1024

<mothacehe>  janneke: With this patch on top of your branch:
            https://paste.debian.net/1147629/, I'm able to generate an EFI
            disk-image.  [15:54]
<mothacehe> That I start with this command:  qemu-system-i386 -enable-kvm
            -bios $(guix build ovmf)/share/firmware/ovmf_ia32.bin -hda
            /tmp/qemu-image -m 1024
<mothacehe> janneke: Sadly, just after Grub, the virtual machine restarts,
            nothing is printed.  [15:55]
---
 gnu/build/bootloader.scm           |  2 +-
 gnu/build/image.scm                | 18 ++++++++++--------
 gnu/system/examples/bare-hurd.tmpl |  2 +-
 gnu/system/image.scm               | 10 ++++++----
 4 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/gnu/build/bootloader.scm b/gnu/build/bootloader.scm
index 498022f6db..68b68c4b47 100644
--- a/gnu/build/bootloader.scm
+++ b/gnu/build/bootloader.scm
@@ -56,7 +56,7 @@
          (efi-directory (string-append esp "/EFI/BOOT"))
          ;; Map grub target names to boot file names.
          (efi-targets (cond ((string-prefix? "x86_64" system)
-                             '("x86_64-efi" . "BOOTX64.EFI"))
+                             '("i386-efi" . "BOOTIA32.EFI"))
                             ((string-prefix? "i686" system)
                              '("i386-efi" . "BOOTIA32.EFI"))
                             ((string-prefix? "armhf" system)
diff --git a/gnu/build/image.scm b/gnu/build/image.scm
index fe8e11aa1b..23fc56571f 100644
--- a/gnu/build/image.scm
+++ b/gnu/build/image.scm
@@ -63,16 +63,18 @@
 take the partition metadata size into account, take a 25% margin."
   (* 1.25 (file-size root)))
 
-(define* (make-ext4-image partition target root
-                          #:key
-                          (owner-uid 0)
-                          (owner-gid 0))
-  "Handle the creation of EXT4 partition images. See 'make-partition-image'."
+(define* (make-ext-image partition target root
+                         #:key
+                         (owner-uid 0)
+                         (owner-gid 0))
+  "Handle the creation of EXT2/3/4 partition images. See
+'make-partition-image'."
   (let ((size (partition-size partition))
+        (fs (partition-file-system partition))
         (label (partition-label partition))
         (uuid (partition-uuid partition))
         (options "lazy_itable_init=1,lazy_journal_init=1"))
-    (invoke "mke2fs" "-t" "ext4" "-d" root
+    (invoke "mke2fs" "-t" fs "-d" root
             "-L" label "-U" (uuid->string uuid)
             "-E" (format #f "root_owner=~a:~a,~a"
                          owner-uid owner-gid options)
@@ -105,8 +107,8 @@ ROOT directory to populate the image."
   (let* ((partition (sexp->partition partition-sexp))
          (type (partition-file-system partition)))
     (cond
-     ((string=? type "ext4")
-      (make-ext4-image partition target root))
+     ((string-prefix? "ext" type)
+      (make-ext-image partition target root))
      ((string=? type "vfat")
       (make-vfat-image partition target root))
      (else
diff --git a/gnu/system/examples/bare-hurd.tmpl b/gnu/system/examples/bare-hurd.tmpl
index d4c40e6841..c3adf03a7f 100644
--- a/gnu/system/examples/bare-hurd.tmpl
+++ b/gnu/system/examples/bare-hurd.tmpl
@@ -11,7 +11,7 @@
   (operating-system
     (inherit %hurd-default-operating-system)
     (bootloader (bootloader-configuration
-                 (bootloader grub-minimal-bootloader)
+                 (bootloader grub-efi-bootloader)
                  (target "/dev/sdX")))
     (file-systems (cons (file-system
                           (device (file-system-label "my-root"))
diff --git a/gnu/system/image.scm b/gnu/system/image.scm
index 571b7af5f3..888099dae5 100644
--- a/gnu/system/image.scm
+++ b/gnu/system/image.scm
@@ -79,7 +79,7 @@
   (partition
    (size 'guess)
    (label "Guix_image")
-   (file-system "ext4")
+   (file-system "ext2")
    (flags '(boot))
    (initializer (gexp initialize-root-partition))))
 
@@ -222,7 +222,9 @@ used in the image."
                               #:deduplicate? #f
                               #:system-directory #$os
                               #:bootloader-package
-                              #$(bootloader-package bootloader)
+                              #+(with-parameters
+                                    ((%current-system "i686-linux"))
+                                  (bootloader-package bootloader))
                               #:bootcfg #$bootcfg
                               #:bootcfg-location
                               #$(bootloader-configuration-file bootloader)))))
@@ -232,7 +234,7 @@ used in the image."
              (type (partition-file-system partition))
              (image-builder
               (with-imported-modules*
-               (let ((inputs '#$(list e2fsprogs dosfstools mtools)))
+               (let ((inputs '#+(list e2fsprogs dosfstools mtools)))
                  (set-path-environment-variable "PATH" '("bin" "sbin") inputs)
                  (make-partition-image #$(partition->gexp partition)
                                        #$output
@@ -269,7 +271,7 @@ image ~a {
   (let* ((substitutable? (image-substitutable? image))
          (builder
           (with-imported-modules*
-           (let ((inputs '#$(list genimage coreutils findutils)))
+           (let ((inputs '#+(list genimage coreutils findutils)))
              (set-path-environment-variable "PATH" '("bin" "sbin") inputs)
              (genimage #$(image->genimage-cfg image) #$output))))
          (image-dir (computed-file "image-dir" builder)))
-- 
2.26.2


[-- Attachment #3: Type: text/plain, Size: 152 bytes --]


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

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd.
  2020-05-19  9:14     ` Mathieu Othacehe
@ 2020-05-20 21:49       ` Ludovic Courtès
  2020-05-23  9:28       ` Jan Nieuwenhuizen
  1 sibling, 0 replies; 48+ messages in thread
From: Ludovic Courtès @ 2020-05-20 21:49 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: 41350, Jan (janneke) Nieuwenhuizen

Hi,

Mathieu Othacehe <othacehe@gnu.org> skribis:

>> +                 #$(if (hurd-target?)
>> +                       #~#+(grub-root-search store-device font-file)
>> +                       (grub-root-search store-device font-file))
>> +                 #$(if (hurd-target?)
>> +                       #~#+(setup-gfxterm config font-file)
>> +                       (setup-gfxterm config font-file))
>
> I'm not certain that hurd-target? always return the expected answer
> here. Now that we have let-system, the safer way to check for the target
> system could be to write:
>
> #$(let-system (system target)
>               (hurd-target? system target))
>
> Ludo, is this correct?

Definitely!  Well, modulo indentation.  ;-)

Thanks,
Ludo’.




^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd.
  2020-05-19  7:23   ` [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for " Jan (janneke) Nieuwenhuizen
  2020-05-19  9:14     ` Mathieu Othacehe
@ 2020-05-20 21:58     ` Ludovic Courtès
  1 sibling, 0 replies; 48+ messages in thread
From: Ludovic Courtès @ 2020-05-20 21:58 UTC (permalink / raw)
  To: Jan (janneke) Nieuwenhuizen; +Cc: Mathieu Othacehe, 41350

Howdy!

"Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:

> Cross-building a vm-image is usually done using a cross-qemu, e.g, qemu-ARM,
> because, e.g., a native, x86_64 Grub cannot install an armhf-Grub.  That
> solution does not work for the Hurd, as there is no qemu-HURD.
>
> This patch enables cross building vm-images for the Hurd using a native qemu
> vm.
>
> * gnu/system/vm.scm (expression->derivation-in-linux-vm): Run native
> qemu-command; use native linux, initrd, bootloader-package and
> bootloader-installer, for the Hurd.
> [preserve-target]: New helper to install cross-packages into the native vm.
> * gnu/bootloader/grub.scm (eye-candy): Use native font, for the Hurd.
>
> Co-authored-by: Ludovic Courtès <ludo@gnu.org>

I think the big question here, not Hurd-specific, is about the
abstractions:

  1. When cross-compiling, can the ‘qemu-image’ procedure to its job by
     running exclusively native software (in particular using a native
     QEMU, native kernel, etc.)?

  2. What should ‘expression->derivation-in-linux-vm’ do when
     cross-compiling?

I think the answer to (1) is yes, right?  That is, we can build a QEMU
image for AArch64/EFI from an x86_64 box.  That means we’d run the
x86_64/EFI ‘grub-install’ in the final step, an x86_64 ‘mke2fs’ and
‘parted’ to create the partitions, and so on.  Likewise, we can create a
QEMU GNU/Hurd image without entirely on GNU/Linux.

As for (2), I’d say that when cross-compiling, it should just run native
software but simply preserve references to cross-compiled software,
which is what janneke’s patch does.

How does that sound?  Mathieu?

(I guess I’m rewording what janneke wrote, but my mind became fuzzy last
time I looked at it, so I thought it’s best to double-check.  :-))

Thanks!

Ludo’.




^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd.
  2020-05-17 10:01 [bug#41350] [PATCH 0/3] Use native qemu to build vm-image Jan Nieuwenhuizen
                   ` (2 preceding siblings ...)
  2020-05-19  7:23 ` [bug#41350] [PATCH v2 1/3] utils: Move 'reset-timestamps' out of database Jan (janneke) Nieuwenhuizen
@ 2020-05-22 19:24 ` Mathieu Othacehe
  2020-05-27 22:54   ` Ludovic Courtès
  2020-05-23  9:30 ` [bug#41350] [PATCH v3 1/3] utils: Move 'reset-timestamps' out of database Jan (janneke) Nieuwenhuizen
  2020-05-24 18:11 ` [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd Mathieu Othacehe
  5 siblings, 1 reply; 48+ messages in thread
From: Mathieu Othacehe @ 2020-05-22 19:24 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 41350, Jan (janneke) Nieuwenhuizen


Hey Ludo!

>   1. When cross-compiling, can the ‘qemu-image’ procedure to its job by
>      running exclusively native software (in particular using a native
>      QEMU, native kernel, etc.)?

I think the answer is yes, but I raised a concern about being able to
run grub-install from an ARM system to build a cross-compiled x86-64
system (for instance).

For now, running this command shows:

--8<---------------cut here---------------start------------->8---
ls $(guix build --system=aarch64-linux grub)/lib/grub/
arm64-efi
--8<---------------cut here---------------end--------------->8---

So, the native aarch64-linux is only able to install itself on the same
system. I think can be fixed though (same as for grub-hybrid package).

> As for (2), I’d say that when cross-compiling, it should just run native
> software but simply preserve references to cross-compiled software,
> which is what janneke’s patch does.

Yes, I agree.

However, I think I found a way to install Grub, without root
permissions, from the host system (see:
https://lists.gnu.org/archive/html/guix-patches/2020-05/msg00988.html).

This should allow to deprecate the whole (gnu system vm) module.

Thanks for having a look :)

Mathieu




^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd.
  2020-05-19  9:14     ` Mathieu Othacehe
  2020-05-20 21:49       ` Ludovic Courtès
@ 2020-05-23  9:28       ` Jan Nieuwenhuizen
  2020-05-23 17:45         ` Mathieu Othacehe
  1 sibling, 1 reply; 48+ messages in thread
From: Jan Nieuwenhuizen @ 2020-05-23  9:28 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: Ludovic Courtès, 41350

Mathieu Othacehe writes:

Hello Mathieu,

>> +                 #$(if (hurd-target?)
>> +                       #~#+(grub-root-search store-device font-file)
>> +                       (grub-root-search store-device font-file))
>> +                 #$(if (hurd-target?)
>> +                       #~#+(setup-gfxterm config font-file)
>> +                       (setup-gfxterm config font-file))
>
> I'm not certain that hurd-target? always return the expected answer
> here. Now that we have let-system, the safer way to check for the target
> system could be to write:
>
> #$(let-system (system target)
>               (hurd-target? system target))

Okay...

> Ludo, is this correct? Furthermore, if you make sure that
> "grub-root-search" and "setup-gfxterm" return #+, you could maybe drop
> this part?

...used #+ and dropped the IFs here, but used this insight below.

>> +
>> +                     (loader  #$(if (hurd-target?) #~#+loader loader))
>> +                     (linux   #$(if (hurd-target?)
>> +                                    #~(string-append
>> +                                       #+linux "/"
>> +                                       #+(system-linux-image-file-name))
>> +                                    #~(string-append
>> +                                       #$linux "/"
>> +                                       #$(system-linux-image-file-name))))
>
> Same concern as above about "hurd-target?".

...Ah, that makes sense...that's of course why Ludo already introduced

  (define-syntax-rule (check predicate)
    (let-system (system target)
      (predicate (or target system))))

here.  So, using "(check hurd-triplet?)", as Ludo was already doing in
some other places here.

>> +                  ;; (if #$(hurd-target?)
>> +                  ;;     '#+(append (list parted e2fsprogs dosfstools)
>> +                  ;;                    (map canonical-package
>> +                  ;;                         (list sed grep coreutils findutils gawk)))
>> +                  ;;     '#$(append (list parted e2fsprogs dosfstools)
>> +                  ;;                (map canonical-package
>> +                  ;;                     (list sed grep coreutils findutils gawk))))
>> +                  )
>
> Is this needed?

Oops -- that was unfinished business; that IF did not work yet; possibly
because of not going through LET-SYSTEM.

This helps a lot, I'm now again able to do both

    ./pre-inst-env guix system vm-image --target=i586-pc-gnu --no-grafts gnu/system/examples/bare-bones.tmpl
    ./pre-inst-env guix system vm-image gnu/system/examples/bare-bones.tmpl

again!  Phew... And that's also because I learned to include the full
list of exported symbols in the autoload of (gnu store database).

Mathieu, if it turns out that you are dropping qemu-image next week
altogether then great!, and I have no problem whatsoever dropping this
patch set as well.

For now, I have reset wip-hurd-vm and put your commits towards the
bottom of the wip-hurd-vm stack too.

Sending an updated v3 patch set just because I'm so pleased with this
result.

Greetings,
janneke

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




^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH v3 1/3] utils: Move 'reset-timestamps' out of database.
  2020-05-17 10:01 [bug#41350] [PATCH 0/3] Use native qemu to build vm-image Jan Nieuwenhuizen
                   ` (3 preceding siblings ...)
  2020-05-22 19:24 ` Mathieu Othacehe
@ 2020-05-23  9:30 ` Jan (janneke) Nieuwenhuizen
  2020-05-23  9:30   ` [bug#41350] [PATCH v3 2/3] system: vm: Do not register-closures when cross-building to the Hurd Jan (janneke) Nieuwenhuizen
                     ` (2 more replies)
  2020-05-24 18:11 ` [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd Mathieu Othacehe
  5 siblings, 3 replies; 48+ messages in thread
From: Jan (janneke) Nieuwenhuizen @ 2020-05-23  9:30 UTC (permalink / raw)
  To: 41350

This supports calling reset-timestamps without loading sqlite3.

* guix/store/database.scm (reset-timestamps): Move to...
* guix/utils.scm (reset-timestamps): ... here.
* gnu/build/vm.scm: Include it.
---
 gnu/build/vm.scm        |  1 +
 guix/store/database.scm | 41 +++--------------------------------------
 guix/utils.scm          | 41 ++++++++++++++++++++++++++++++++++++++---
 3 files changed, 42 insertions(+), 41 deletions(-)

diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm
index 433b5a7e8d..c751e6b0e2 100644
--- a/gnu/build/vm.scm
+++ b/gnu/build/vm.scm
@@ -26,6 +26,7 @@
   #:use-module (guix build utils)
   #:use-module (guix build store-copy)
   #:use-module (guix build syscalls)
+  #:use-module ((guix utils) #:select (reset-timestamps))
   #:use-module (guix store database)
   #:use-module (gnu build bootloader)
   #:use-module (gnu build linux-boot)
diff --git a/guix/store/database.scm b/guix/store/database.scm
index ef52036ede..b8fe313c3d 100644
--- a/guix/store/database.scm
+++ b/guix/store/database.scm
@@ -24,9 +24,8 @@
   #:use-module (guix store deduplication)
   #:use-module (guix base16)
   #:use-module (guix progress)
-  #:use-module (guix build syscalls)
-  #:use-module ((guix build utils)
-                #:select (mkdir-p executable-file?))
+  #:use-module ((guix build utils) #:select (mkdir-p))
+  #:use-module ((guix utils) #:select (reset-timestamps))
   #:use-module (guix build store-copy)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-11)
@@ -42,8 +41,7 @@
             sqlite-register
             register-path
             register-items
-            %epoch
-            reset-timestamps))
+            %epoch))
 
 ;;; Code for working with the store database directly.
 
@@ -227,39 +225,6 @@ Every store item in REFERENCES must already be registered."
 ;;;
 ;;; High-level interface.
 ;;;
-
-(define* (reset-timestamps file #:key preserve-permissions?)
-  "Reset the modification time on FILE and on all the files it contains, if
-it's a directory.  Canonicalize file permissions unless PRESERVE-PERMISSIONS?
-is true."
-  ;; Note: We're resetting to one second after the Epoch like 'guix-daemon'
-  ;; has always done.
-  (let loop ((file file)
-             (type (stat:type (lstat file))))
-    (case type
-      ((directory)
-       (unless preserve-permissions?
-         (chmod file #o555))
-       (utime file 1 1 0 0)
-       (let ((parent file))
-         (for-each (match-lambda
-                     (("." . _) #f)
-                     ((".." . _) #f)
-                     ((file . properties)
-                      (let ((file (string-append parent "/" file)))
-                        (loop file
-                              (match (assoc-ref properties 'type)
-                                ((or 'unknown #f)
-                                 (stat:type (lstat file)))
-                                (type type))))))
-                   (scandir* parent))))
-      ((symlink)
-       (utime file 1 1 0 0 AT_SYMLINK_NOFOLLOW))
-      (else
-       (unless preserve-permissions?
-         (chmod file (if (executable-file? file) #o555 #o444)))
-       (utime file 1 1 0 0)))))
-
 (define* (register-path path
                         #:key (references '()) deriver prefix
                         state-directory (deduplicate? #t)
diff --git a/guix/utils.scm b/guix/utils.scm
index d7b197fa44..812617dd61 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -35,8 +35,10 @@
   #:use-module (rnrs io ports)                    ;need 'port-position' etc.
   #:use-module ((rnrs bytevectors) #:select (bytevector-u8-set!))
   #:use-module (guix memoization)
-  #:use-module ((guix build utils) #:select (dump-port mkdir-p delete-file-recursively))
-  #:use-module ((guix build syscalls) #:select (mkdtemp! fdatasync))
+  #:use-module ((guix build utils)
+                #:select (dump-port mkdir-p delete-file-recursively
+                                    executable-file?))
+  #:use-module ((guix build syscalls) #:select (mkdtemp! fdatasync scandir*))
   #:use-module (ice-9 format)
   #:use-module (ice-9 regex)
   #:use-module (ice-9 match)
@@ -109,7 +111,8 @@
             call-with-decompressed-port
             compressed-output-port
             call-with-compressed-output-port
-            canonical-newline-port))
+            canonical-newline-port
+            reset-timestamps))
 
 \f
 ;;;
@@ -843,6 +846,38 @@ a location object."
   fix-hint?
   (hint condition-fix-hint))                      ;string
 
+(define* (reset-timestamps file #:key preserve-permissions?)
+  "Reset the modification time on FILE and on all the files it contains, if
+it's a directory.  Canonicalize file permissions unless PRESERVE-PERMISSIONS?
+is true."
+  ;; Note: We're resetting to one second after the Epoch like 'guix-daemon'
+  ;; has always done.
+  (let loop ((file file)
+             (type (stat:type (lstat file))))
+    (case type
+      ((directory)
+       (unless preserve-permissions?
+         (chmod file #o555))
+       (utime file 1 1 0 0)
+       (let ((parent file))
+         (for-each (match-lambda
+                     (("." . _) #f)
+                     ((".." . _) #f)
+                     ((file . properties)
+                      (let ((file (string-append parent "/" file)))
+                        (loop file
+                              (match (assoc-ref properties 'type)
+                                ((or 'unknown #f)
+                                 (stat:type (lstat file)))
+                                (type type))))))
+                   (scandir* parent))))
+      ((symlink)
+       (utime file 1 1 0 0 AT_SYMLINK_NOFOLLOW))
+      (else
+       (unless preserve-permissions?
+         (chmod file (if (executable-file? file) #o555 #o444)))
+       (utime file 1 1 0 0)))))
+
 ;;; Local Variables:
 ;;; eval: (put 'call-with-progress-reporter 'scheme-indent-function 1)
 ;;; End:
-- 
2.26.2





^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH v3 2/3] system: vm: Do not register-closures when cross-building to the Hurd.
  2020-05-23  9:30 ` [bug#41350] [PATCH v3 1/3] utils: Move 'reset-timestamps' out of database Jan (janneke) Nieuwenhuizen
@ 2020-05-23  9:30   ` Jan (janneke) Nieuwenhuizen
  2020-05-27  8:45     ` Ludovic Courtès
  2020-05-23  9:30   ` [bug#41350] [PATCH v3 3/3] system: vm: Build vm-image using native qemu, for " Jan (janneke) Nieuwenhuizen
  2020-05-27  8:43   ` [bug#41350] [PATCH v3 1/3] utils: Move 'reset-timestamps' out of database Ludovic Courtès
  2 siblings, 1 reply; 48+ messages in thread
From: Jan (janneke) Nieuwenhuizen @ 2020-05-23  9:30 UTC (permalink / raw)
  To: 41350

This supports cross-building building a vm-image for the Hurd, running a
native qemu.

* gnu/system/vm.scm (qemu-image)[register-closures?]: Default to #f when
cross-compiling to the Hurd.  Only create sql-schema when actually registering
closures.
---
 gnu/build/vm.scm  | 9 ++++++++-
 gnu/system/vm.scm | 9 ++++++---
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm
index c751e6b0e2..a1b193134a 100644
--- a/gnu/build/vm.scm
+++ b/gnu/build/vm.scm
@@ -27,7 +27,14 @@
   #:use-module (guix build store-copy)
   #:use-module (guix build syscalls)
   #:use-module ((guix utils) #:select (reset-timestamps))
-  #:use-module (guix store database)
+  #:autoload (guix store database) (sql-schema ;must list all exported symbols
+                                    %default-database-file
+                                    with-database
+                                    path-id
+                                    sqlite-register
+                                    register-path
+                                    register-items
+                                    %epoch)
   #:use-module (gnu build bootloader)
   #:use-module (gnu build linux-boot)
   #:use-module (gnu build install)
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index 3e483fd86c..b343141c18 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -51,6 +51,7 @@
   #:use-module (gnu packages zile)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages admin)
+  #:use-module (gnu packages hurd)
 
   #:use-module (gnu bootloader)
   #:use-module (gnu bootloader grub)
@@ -286,7 +287,8 @@ substitutable."
                      os
                      bootcfg-drv
                      bootloader
-                     (register-closures? (has-guix-service-type? os))
+                     (register-closures? (and (has-guix-service-type? os)
+                                              (not (hurd-target?))))
                      (inputs '())
                      copy-inputs?
                      (substitutable? #t))
@@ -333,12 +335,13 @@ system that is passed to 'populate-root-file-system'."
                         ((gnu build linux-boot)
                          #:select (make-essential-device-nodes
                                    make-hurd-device-nodes))
-                        (guix store database)
                         (guix build utils)
                         (srfi srfi-26)
                         (ice-9 binary-ports))
 
-           (sql-schema #$schema)
+           (when #$register-closures?
+             (use-modules (guix store database))
+             (sql-schema #$schema))
 
            ;; Allow non-ASCII file names--e.g., 'nss-certs'--to be decoded.
            (setenv "GUIX_LOCPATH"
-- 
2.26.2





^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH v3 3/3] system: vm: Build vm-image using native qemu, for the Hurd.
  2020-05-23  9:30 ` [bug#41350] [PATCH v3 1/3] utils: Move 'reset-timestamps' out of database Jan (janneke) Nieuwenhuizen
  2020-05-23  9:30   ` [bug#41350] [PATCH v3 2/3] system: vm: Do not register-closures when cross-building to the Hurd Jan (janneke) Nieuwenhuizen
@ 2020-05-23  9:30   ` Jan (janneke) Nieuwenhuizen
  2020-05-27  8:43   ` [bug#41350] [PATCH v3 1/3] utils: Move 'reset-timestamps' out of database Ludovic Courtès
  2 siblings, 0 replies; 48+ messages in thread
From: Jan (janneke) Nieuwenhuizen @ 2020-05-23  9:30 UTC (permalink / raw)
  To: 41350; +Cc: Ludovic Courtès

Cross-building a vm-image is usually done using a cross-qemu, e.g, qemu-ARM,
because, e.g., a native, x86_64 Grub cannot install an armhf-Grub.  That
solution does not work for the Hurd, as there is no qemu-HURD.

This patch enables cross building vm-images for the Hurd using a native qemu
vm.

* gnu/system/vm.scm (expression->derivation-in-linux-vm): Run native
qemu-command; use native linux, initrd, bootloader-package and
bootloader-installer, for the Hurd.
[preserve-target]: New helper to install cross-packages into the native vm.
* gnu/bootloader/grub.scm (eye-candy): Use native font.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
---
 gnu/bootloader/grub.scm |  4 +-
 gnu/system/vm.scm       | 81 +++++++++++++++++++++++++++++------------
 2 files changed, 60 insertions(+), 25 deletions(-)

diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm
index bb40c551a7..ccf70b3785 100644
--- a/gnu/bootloader/grub.scm
+++ b/gnu/bootloader/grub.scm
@@ -207,8 +207,8 @@ else
   set menu_color_highlight=white/blue
 fi~%"
                  #$setup-gfxterm-body
-                 #$(grub-root-search store-device font-file)
-                 #$(setup-gfxterm config font-file)
+                 #+(grub-root-search store-device font-file)
+                 #+(setup-gfxterm config font-file)
                  #$(grub-setup-io config)
 
                  #$image
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index b343141c18..245ecc73b3 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2018 Chris Marusich <cmmarusich@gmail.com>
+;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -181,29 +182,46 @@ made available under the /xchg CIFS share.
 SUBSTITUTABLE? determines whether the returned derivation should be marked as
 substitutable."
   (define user-builder
-    (program-file "builder-in-linux-vm" exp))
+    (scheme-file "builder-in-linux-vm" exp))
+
+  (define (preserve-target obj)
+    (if target
+        (with-parameters ((%current-target-system target))
+          obj)
+        obj))
+
+  (define-syntax-rule (check predicate)
+    (let-system (system target)
+      (predicate (or target system))))
 
   (define loader
-    ;; Invoke USER-BUILDER instead using 'primitive-load'.  The reason for
-    ;; this is to allow USER-BUILDER to dlopen stuff by using a full-featured
-    ;; Guile, which it couldn't do using the statically-linked guile used in
-    ;; the initrd.  See example at
+    ;; Instead of using 'primitive-load', evaluate USER-BUILDER in a
+    ;; full-featured Guile so it can use dlopen stuff, which it couldn't do
+    ;; using the statically-linked guile used in the initrd.  See example at
     ;; <https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00233.html>.
     (program-file "linux-vm-loader"
-                  ;; Communicate USER-BUILDER's exit status via /xchg so that
-                  ;; the host can distinguish between success, failure, and
-                  ;; kernel panic.
-                  #~(let ((status (system* #$user-builder)))
+                  ;; When cross-compiling, USER-BUILDER refers to the target
+                  ;; (cross-compiled) system.  Preserve that, even though
+                  ;; LOADER itself is executed as a native program.
+                  #~(let* ((guile #$(if (check hurd-triplet?)
+                                        #~#+(file-append (default-guile)
+                                                         "/bin/guile")
+                                        (file-append (default-guile)
+                                                     "/bin/guile")))
+                           (status (system* guile "--no-auto-compile"
+                                            #$(if (check hurd-triplet?)
+                                                  (preserve-target user-builder)
+                                                  user-builder))))
+
+                      ;; Communicate USER-BUILDER's exit status via /xchg so
+                      ;; that the host can distinguish between success,
+                      ;; failure, and kernel panic.
                       (call-with-output-file "/xchg/.exit-status"
                         (lambda (port)
                           (write status port)))
                       (sync)
                       (reboot))))
 
-  (define-syntax-rule (check predicate)
-    (let-system (system target)
-      (predicate (or target system))))
-
   (let ((initrd (or initrd
                     (base-initrd file-systems
                                  #:on-error 'backtrace
@@ -227,10 +245,16 @@ substitutable."
 
               (let* ((native-inputs
                       '#+(list qemu (canonical-package coreutils)))
-                     (linux   (string-append #$linux "/"
-                                             #$(system-linux-image-file-name)))
-                     (initrd  #$initrd)
-                     (loader  #$loader)
+
+                     (loader  #$(if (check hurd-triplet?) #~#+loader loader))
+                     (linux   #$(if (check hurd-triplet?)
+                                    #~(string-append
+                                       #+linux "/"
+                                       #+(system-linux-image-file-name))
+                                    #~(string-append
+                                       #$linux "/"
+                                       #$(system-linux-image-file-name))))
+                     (initrd  #$(if (check hurd-triplet?) #~#+initrd initrd))
                      (graphs  '#$(match references-graphs
                                    (((graph-files . _) ...) graph-files)
                                    (_ #f)))
@@ -246,7 +270,10 @@ substitutable."
                 (load-in-linux-vm loader
                                   #:output #$output
                                   #:linux linux #:initrd initrd
-                                  #:qemu (qemu-command target)
+                                  #:qemu #$(if (or (not target)
+                                                   (check hurd-triplet?))
+                                               (qemu-command)
+                                               (qemu-command target))
                                   #:memory-size #$memory-size
                                   #:make-disk-image? #$make-disk-image?
                                   #:single-file-output? #$single-file-output?
@@ -349,9 +376,13 @@ system that is passed to 'populate-root-file-system'."
            (setlocale LC_ALL "en_US.utf8")
 
            (let ((inputs
-                  '#$(append (list parted e2fsprogs dosfstools)
-                             (map canonical-package
-                                  (list sed grep coreutils findutils gawk))))
+                  '#$(if (hurd-target?)
+                         #~#+(append (list parted e2fsprogs dosfstools)
+                                     (map canonical-package
+                                          (list sed grep coreutils findutils gawk)))
+                         (append (list parted e2fsprogs dosfstools)
+                                 (map canonical-package
+                                      (list sed grep coreutils findutils gawk)))))
 
                  ;; This variable is unused but allows us to add INPUTS-TO-COPY
                  ;; as inputs.
@@ -426,12 +457,16 @@ system that is passed to 'populate-root-file-system'."
                                      #:partitions partitions
                                      #:grub-efi grub-efi
                                      #:bootloader-package
-                                     #$(bootloader-package bootloader)
+                                     #$(if (hurd-target?)
+                                         #~#+(bootloader-package bootloader)
+                                         (bootloader-package bootloader))
                                      #:bootcfg #$bootcfg-drv
                                      #:bootcfg-location
                                      #$(bootloader-configuration-file bootloader)
                                      #:bootloader-installer
-                                     #$(bootloader-installer bootloader)))))))
+                                     #$(if (hurd-target?)
+                                           #~#+(bootloader-installer bootloader)
+                                           (bootloader-installer bootloader))))))))
    #:system system
    #:target target
    #:make-disk-image? #t
-- 
2.26.2





^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd.
  2020-05-23  9:28       ` Jan Nieuwenhuizen
@ 2020-05-23 17:45         ` Mathieu Othacehe
  2020-05-23 19:07           ` Jan Nieuwenhuizen
  0 siblings, 1 reply; 48+ messages in thread
From: Mathieu Othacehe @ 2020-05-23 17:45 UTC (permalink / raw)
  To: Jan Nieuwenhuizen; +Cc: Ludovic Courtès, 41350


Hello Jan,

> Mathieu, if it turns out that you are dropping qemu-image next week
> altogether then great!, and I have no problem whatsoever dropping this
> patch set as well.
>
> For now, I have reset wip-hurd-vm and put your commits towards the
> bottom of the wip-hurd-vm stack too.

I just pushed a few commits to your branch. I'm now able to run:

--8<---------------cut here---------------start------------->8---
guix system disk-image --target=i586-pc-gnu  gnu/system/examples/bare-hurd.tmpl
--8<---------------cut here---------------end--------------->8---

no VM inside.

We now have to backport some of your work to (gnu system image), but
the good news is that closure registration is now working, and the Hurd
boots.

> Sending an updated v3 patch set just because I'm so pleased with this
> result.

I'll have a look :)

Thanks,

Mathieu




^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd.
  2020-05-23 17:45         ` Mathieu Othacehe
@ 2020-05-23 19:07           ` Jan Nieuwenhuizen
  2020-05-24  9:18             ` Mathieu Othacehe
                               ` (2 more replies)
  0 siblings, 3 replies; 48+ messages in thread
From: Jan Nieuwenhuizen @ 2020-05-23 19:07 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: Ludovic Courtès, 41350

Mathieu Othacehe writes:

> Hello Jan,
>
>> Mathieu, if it turns out that you are dropping qemu-image next week
>> altogether then great!, and I have no problem whatsoever dropping this
>> patch set as well.
>>
>> For now, I have reset wip-hurd-vm and put your commits towards the
>> bottom of the wip-hurd-vm stack too.
>
> I just pushed a few commits to your branch. I'm now able to run:
>
> guix system disk-image --target=i586-pc-gnu  gnu/system/examples/bare-hurd.tmpl
>
> no VM inside.

Whoa, that's 10 commits -- great!  I do need to use --no-grafts, if I
don't I get

    guix system: error: gnu/packages/glib.scm:406:2: gobject-introspection@1.62.0: build system `meson' does not support cross builds

Do you see that too?

> We now have to backport some of your work to (gnu system image), but

Just build and started it -- beautiful.  I'll have a stab later
tomorrow, unless someone beats me to it ;)

> the good news is that closure registration is now working, and the Hurd
> boots.

very nice, that's already one ahead!

> I'll have a look :)

Thanks :-)

Greetings,
Janneke

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




^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd.
  2020-05-23 19:07           ` Jan Nieuwenhuizen
@ 2020-05-24  9:18             ` Mathieu Othacehe
  2020-05-27  9:30               ` Ludovic Courtès
  2020-05-24 11:19             ` Jan Nieuwenhuizen
  2020-05-24 16:36             ` Ludovic Courtès
  2 siblings, 1 reply; 48+ messages in thread
From: Mathieu Othacehe @ 2020-05-24  9:18 UTC (permalink / raw)
  To: Jan Nieuwenhuizen; +Cc: Ludovic Courtès, 41350


Hey!

>     guix system: error: gnu/packages/glib.scm:406:2: gobject-introspection@1.62.0: build system `meson' does not support cross builds
>
> Do you see that too?

Yes, same issue. When grafting is enabled, we try to cross-built the
native extension "guile-rsvg" in (gnu bootloader grub).

Taking inspiration from f52fbf709, I tried:

--8<---------------cut here---------------start------------->8---
diff --git a/guix/packages.scm b/guix/packages.scm
index 3d9988d836..e74ac882cb 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -1276,13 +1276,14 @@ to (see 'graft-derivation'.)"
   (define target (bag-target bag))
 
   (define native-grafts
-    (let ((->graft (input-graft store system)))
-      (fold-bag-dependencies (lambda (package grafts)
-                               (match (->graft package)
-                                 (#f    grafts)
-                                 (graft (cons graft grafts))))
-                             '()
-                             bag)))
+    (parameterize ((%current-target-system target))
+      (let ((->graft (input-graft store system)))
+        (fold-bag-dependencies (lambda (package grafts)
+                                 (match (->graft package)
+                                   (#f    grafts)
+                                   (graft (cons graft grafts))))
+                               '()
+                               bag))))
--8<---------------cut here---------------end--------------->8---
 
which, by pure luck, fixes the issue for me. Maybe, I should also do
that for "target-grafts". Ludo, WDYT?

Thanks,

Mathieu




^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd.
  2020-05-23 19:07           ` Jan Nieuwenhuizen
  2020-05-24  9:18             ` Mathieu Othacehe
@ 2020-05-24 11:19             ` Jan Nieuwenhuizen
  2020-05-24 12:07               ` Mathieu Othacehe
  2020-05-24 16:36             ` Ludovic Courtès
  2 siblings, 1 reply; 48+ messages in thread
From: Jan Nieuwenhuizen @ 2020-05-24 11:19 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: Ludovic Courtès, 41350

Jan Nieuwenhuizen writes:

Hello Mathieu,

> Mathieu Othacehe writes:
>> We now have to backport some of your work to (gnu system image), but
>
> Just build and started it -- beautiful.  I'll have a stab later
> tomorrow, unless someone beats me to it ;)

I have just pushed a few commits to wip-hurd-vm.

    b0df9b0c6b squash! bootloader: grub: Add support for '<hurd-menu-entry>'.

We were using a cross-built gnumach, which does not work.  This did not
happen with "vm-image" because "qemu-image" of how qemu-image built
grub.  Best to squash that later.

    6169cb6396 Revert "system: hurd: Remove bash from boot process."

As mentioned in the commit, where we used to run patched linux in the
VM, the "Remove bash from boot process" patch would now rely on the
host's linux being patched.  It's a bit early times/inconvenient to
demand this, I suppose...

    c378a2beec linux-boot: Update 'make-hurd-device-nodes'.

Moved a part of the Hurd stuff here, and the rest

    b605a36031 WIP hurd-directives

here.  It does not work and I don't understand that I had to add a call
to make-device-nodes...that's probably not how you want it to work?

Anyway...no real luck yet.  I'm stuck at:

start ext2fs: Hurd server bootstrap: ext2fs[device:hd0s1] exec startup proc auth
/hurd/startup: Failed to bind to /servers/startup: Device or resource busy
.
/gnu/store/5m6m1ic2m4m43nv4wl7nfa5ab9p76b2g-hurd-0.9-1.91a5167/hurd/exec: main.c:358: S_exec_init: Unexpected error: (ipc/mig) bad request message ID.

Ideas? ... Ludo perhaps?

Greetings,
janneke

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




^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd.
  2020-05-24 11:19             ` Jan Nieuwenhuizen
@ 2020-05-24 12:07               ` Mathieu Othacehe
  2020-05-24 14:20                 ` Jan Nieuwenhuizen
  0 siblings, 1 reply; 48+ messages in thread
From: Mathieu Othacehe @ 2020-05-24 12:07 UTC (permalink / raw)
  To: Jan Nieuwenhuizen; +Cc: Ludovic Courtès, 41350


Hello Jan,

> here.  It does not work and I don't understand that I had to add a call
> to make-device-nodes...that's probably not how you want it to work?

No its more an omission, and for Linux, it seems that it works without
make-device-nodes call.

>
> Anyway...no real luck yet.  I'm stuck at:
>
> start ext2fs: Hurd server bootstrap: ext2fs[device:hd0s1] exec startup proc auth
> /hurd/startup: Failed to bind to /servers/startup: Device or resource busy
> .
> /gnu/store/5m6m1ic2m4m43nv4wl7nfa5ab9p76b2g-hurd-0.9-1.91a5167/hurd/exec: main.c:358: S_exec_init: Unexpected error: (ipc/mig) bad request message ID.
>
> Ideas? ... Ludo perhaps?

Running the following commands:

--8<---------------cut here---------------start------------->8---
./pre-inst-env guix system disk-image  --target=i586-pc-gnu  gnu/system/examples/bare-hurd.tmpl
cp /gnu/store/the-image /tmp/img_ko

./pre-inst-env guix system vm-image  --target=i586-pc-gnu  gnu/system/examples/bare-hurd.tmpl
cp /gnu/store/the-vm-image /tmp/img_ok.qcow2
qemu-img convert -f qcow2 -O raw /tmp/img_ok.qcow2 /tmp/img_ok.raw

sudo losetup -P /dev/loop1 /tmp/img_ko
sudo losetup -P /dev/loop2 /tmp/img_ok.raw

sudo mount /dev/loop1p1 /mnt/img/
sudo mount /dev/loop2p1 /mnt/img2/

diff -r /mnt/img /mnt/img
--8<---------------cut here---------------end--------------->8---

I get:

--8<---------------cut here---------------start------------->8---
Only in /mnt/img2/dev: cons
Only in /mnt/img2/dev: console
Only in /mnt/img2/dev: fd
Only in /mnt/img2/dev: klog
Only in /mnt/img2/dev: kmsg
Only in /mnt/img2/dev: log
Only in /mnt/img2/dev: mem
Only in /mnt/img2/dev: ptyp0
Only in /mnt/img2/dev: ptyp1
Only in /mnt/img2/dev: ptyp2
Only in /mnt/img2/dev: shm
Only in /mnt/img2/dev: stderr
Only in /mnt/img2/dev: stdin
Only in /mnt/img2/dev: stdout
Only in /mnt/img2/dev: time
Only in /mnt/img2/dev: tty
Only in /mnt/img2/dev: tty1
Only in /mnt/img2/dev: tty12
Only in /mnt/img2/dev: tty2
Only in /mnt/img2/dev: tty3
Only in /mnt/img2/dev: tty4
Only in /mnt/img2/dev: tty5
Only in /mnt/img2/dev: tty6
Only in /mnt/img2/dev: ttyp0
Only in /mnt/img2/dev: ttyp1
Only in /mnt/img2/dev: ttyp2
diff: /mnt/img2/dev/urandom: Structure needs cleaning
Only in /mnt/img2/dev: vcs
Only in /mnt/img2/etc: fstab
Only in /mnt/img2/etc: group
Only in /mnt/img2/etc: hostname
Only in /mnt/img2/etc: login
Only in /mnt/img2/etc: motd
Only in /mnt/img2/etc: pam.d
Only in /mnt/img2/etc: passwd
Only in /mnt/img2/etc: profile
Only in /mnt/img2/etc: protocols
Only in /mnt/img2/etc: .pwd.lock
Only in /mnt/img2/etc: services
Only in /mnt/img2/etc: shadow
Only in /mnt/img2/etc: shells
Only in /mnt/img2/etc: skel
Only in /mnt/img2/etc: ssh
Only in /mnt/img2/etc: ssl
Only in /mnt/img2/etc: static
--8<---------------cut here---------------end--------------->8---

It seems that at least etc and dev directories are not correctly
populated using disk-image. To be continued!

Mathieu




^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd.
  2020-05-24 12:07               ` Mathieu Othacehe
@ 2020-05-24 14:20                 ` Jan Nieuwenhuizen
  0 siblings, 0 replies; 48+ messages in thread
From: Jan Nieuwenhuizen @ 2020-05-24 14:20 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: Ludovic Courtès, 41350

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

Mathieu Othacehe writes:

Helo Mathieu,

>> Ideas? ... Ludo perhaps?
>
> Running the following commands:
>
> ./pre-inst-env guix system disk-image  --target=i586-pc-gnu  gnu/system/examples/bare-hurd.tmpl
> cp /gnu/store/the-image /tmp/img_ko
>
> ./pre-inst-env guix system vm-image  --target=i586-pc-gnu  gnu/system/examples/bare-hurd.tmpl
> cp /gnu/store/the-vm-image /tmp/img_ok.qcow2
> qemu-img convert -f qcow2 -O raw /tmp/img_ok.qcow2 /tmp/img_ok.raw

Ah, qemu-img convert -- nice.  So, we get different type of images.
Wonder if that could play some role?

> sudo losetup -P /dev/loop1 /tmp/img_ko
> sudo losetup -P /dev/loop2 /tmp/img_ok.raw
>
> sudo mount /dev/loop1p1 /mnt/img/
> sudo mount /dev/loop2p1 /mnt/img2/
>
> diff -r /mnt/img /mnt/img
>
>
> I get:
>
> Only in /mnt/img2/dev: cons
> Only in /mnt/img2/dev: console
> Only in /mnt/img2/dev: fd
> Only in /mnt/img2/dev: klog
> Only in /mnt/img2/dev: kmsg

That's weird; I only have

/mnt/dev/null
/mnt/dev/urandom
/mnt/dev/full
/mnt/dev/zero
/mnt/dev/random

on both...

> It seems that at least etc and dev directories are not correctly
> populated using disk-image. To be continued!

Hmm.  I compared a file listing between these

    ./pre-inst-env guix system disk-image --no-grafts --target=i586-pc-gnu gnu/system/examples/bare-hurd.tmpl
    ./pre-inst-env guix system vm-image --no-grafts --target=i586-pc-gnu gnu/system/examples/bare-hurd.tmpl

and the differences are pretty minimal (see attached).  The vm-image
fully works, the disk-image shows "/servers/startup: Device or resource
busy"

I used something like

--8<---------------cut here---------------start------------->8---
modprobe nbd max_part=63
qemu-nbd -c /dev/nbd0 vm-image.img
mount /dev/nbd0p1 /mnt
--8<---------------cut here---------------end--------------->8---

The most interesting differences I see are wrt Grub, e.g.

-/mnt/boot/grub/fonts
-/mnt/boot/grub/fonts/unicode.pf2

could that still play a role?  I'm having a look why this could be missing.

Greetings,
janneke


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: vm-to-disk.diff --]
[-- Type: text/x-patch, Size: 31176 bytes --]

--- vm-image.lst-s	2020-05-24 15:41:02.051314009 +0200
+++ disk-image.lst-s	2020-05-24 15:41:08.407414141 +0200
@@ -3,293 +3,577 @@
 /mnt/boot
 /mnt/boot/activation
 /mnt/boot/grub
-/mnt/boot/grub/fonts
-/mnt/boot/grub/fonts/unicode.pf2
 /mnt/boot/grub/grub.cfg
-/mnt/boot/grub/grubenv
 /mnt/boot/grub/i386-pc
 /mnt/boot/grub/i386-pc/acpi.mod
+/mnt/boot/grub/i386-pc/acpi.module
 /mnt/boot/grub/i386-pc/adler32.mod
+/mnt/boot/grub/i386-pc/adler32.module
 /mnt/boot/grub/i386-pc/affs.mod
+/mnt/boot/grub/i386-pc/affs.module
 /mnt/boot/grub/i386-pc/afs.mod
+/mnt/boot/grub/i386-pc/afs.module
 /mnt/boot/grub/i386-pc/ahci.mod
+/mnt/boot/grub/i386-pc/ahci.module
 /mnt/boot/grub/i386-pc/all_video.mod
+/mnt/boot/grub/i386-pc/all_video.module
 /mnt/boot/grub/i386-pc/aout.mod
+/mnt/boot/grub/i386-pc/aout.module
 /mnt/boot/grub/i386-pc/archelp.mod
+/mnt/boot/grub/i386-pc/archelp.module
 /mnt/boot/grub/i386-pc/ata.mod
+/mnt/boot/grub/i386-pc/ata.module
 /mnt/boot/grub/i386-pc/at_keyboard.mod
+/mnt/boot/grub/i386-pc/at_keyboard.module
 /mnt/boot/grub/i386-pc/backtrace.mod
+/mnt/boot/grub/i386-pc/backtrace.module
 /mnt/boot/grub/i386-pc/bfs.mod
+/mnt/boot/grub/i386-pc/bfs.module
 /mnt/boot/grub/i386-pc/biosdisk.mod
+/mnt/boot/grub/i386-pc/biosdisk.module
 /mnt/boot/grub/i386-pc/bitmap.mod
+/mnt/boot/grub/i386-pc/bitmap.module
 /mnt/boot/grub/i386-pc/bitmap_scale.mod
+/mnt/boot/grub/i386-pc/bitmap_scale.module
 /mnt/boot/grub/i386-pc/blocklist.mod
+/mnt/boot/grub/i386-pc/blocklist.module
+/mnt/boot/grub/i386-pc/boot_hybrid.image
+/mnt/boot/grub/i386-pc/boot_hybrid.img
+/mnt/boot/grub/i386-pc/boot.image
 /mnt/boot/grub/i386-pc/boot.img
 /mnt/boot/grub/i386-pc/boot.mod
+/mnt/boot/grub/i386-pc/boot.module
 /mnt/boot/grub/i386-pc/bsd.mod
+/mnt/boot/grub/i386-pc/bsd.module
 /mnt/boot/grub/i386-pc/bswap_test.mod
+/mnt/boot/grub/i386-pc/bswap_test.module
 /mnt/boot/grub/i386-pc/btrfs.mod
+/mnt/boot/grub/i386-pc/btrfs.module
 /mnt/boot/grub/i386-pc/bufio.mod
+/mnt/boot/grub/i386-pc/bufio.module
 /mnt/boot/grub/i386-pc/cat.mod
+/mnt/boot/grub/i386-pc/cat.module
 /mnt/boot/grub/i386-pc/cbfs.mod
+/mnt/boot/grub/i386-pc/cbfs.module
 /mnt/boot/grub/i386-pc/cbls.mod
+/mnt/boot/grub/i386-pc/cbls.module
 /mnt/boot/grub/i386-pc/cbmemc.mod
+/mnt/boot/grub/i386-pc/cbmemc.module
 /mnt/boot/grub/i386-pc/cbtable.mod
+/mnt/boot/grub/i386-pc/cbtable.module
 /mnt/boot/grub/i386-pc/cbtime.mod
+/mnt/boot/grub/i386-pc/cbtime.module
+/mnt/boot/grub/i386-pc/cdboot.image
+/mnt/boot/grub/i386-pc/cdboot.img
 /mnt/boot/grub/i386-pc/chain.mod
+/mnt/boot/grub/i386-pc/chain.module
 /mnt/boot/grub/i386-pc/cmdline_cat_test.mod
+/mnt/boot/grub/i386-pc/cmdline_cat_test.module
 /mnt/boot/grub/i386-pc/cmosdump.mod
+/mnt/boot/grub/i386-pc/cmosdump.module
 /mnt/boot/grub/i386-pc/cmostest.mod
+/mnt/boot/grub/i386-pc/cmostest.module
 /mnt/boot/grub/i386-pc/cmp.mod
+/mnt/boot/grub/i386-pc/cmp.module
 /mnt/boot/grub/i386-pc/cmp_test.mod
+/mnt/boot/grub/i386-pc/cmp_test.module
 /mnt/boot/grub/i386-pc/command.lst
 /mnt/boot/grub/i386-pc/configfile.mod
-/mnt/boot/grub/i386-pc/core.img
+/mnt/boot/grub/i386-pc/configfile.module
+/mnt/boot/grub/i386-pc/config.h
 /mnt/boot/grub/i386-pc/cpio_be.mod
+/mnt/boot/grub/i386-pc/cpio_be.module
 /mnt/boot/grub/i386-pc/cpio.mod
+/mnt/boot/grub/i386-pc/cpio.module
 /mnt/boot/grub/i386-pc/cpuid.mod
+/mnt/boot/grub/i386-pc/cpuid.module
 /mnt/boot/grub/i386-pc/crc64.mod
+/mnt/boot/grub/i386-pc/crc64.module
 /mnt/boot/grub/i386-pc/cryptodisk.mod
+/mnt/boot/grub/i386-pc/cryptodisk.module
 /mnt/boot/grub/i386-pc/crypto.lst
 /mnt/boot/grub/i386-pc/crypto.mod
+/mnt/boot/grub/i386-pc/crypto.module
 /mnt/boot/grub/i386-pc/cs5536.mod
+/mnt/boot/grub/i386-pc/cs5536.module
 /mnt/boot/grub/i386-pc/ctz_test.mod
+/mnt/boot/grub/i386-pc/ctz_test.module
 /mnt/boot/grub/i386-pc/datehook.mod
+/mnt/boot/grub/i386-pc/datehook.module
 /mnt/boot/grub/i386-pc/date.mod
+/mnt/boot/grub/i386-pc/date.module
 /mnt/boot/grub/i386-pc/datetime.mod
+/mnt/boot/grub/i386-pc/datetime.module
+/mnt/boot/grub/i386-pc/diskboot.image
+/mnt/boot/grub/i386-pc/diskboot.img
 /mnt/boot/grub/i386-pc/diskfilter.mod
+/mnt/boot/grub/i386-pc/diskfilter.module
 /mnt/boot/grub/i386-pc/disk.mod
+/mnt/boot/grub/i386-pc/disk.module
 /mnt/boot/grub/i386-pc/div.mod
+/mnt/boot/grub/i386-pc/div.module
 /mnt/boot/grub/i386-pc/div_test.mod
+/mnt/boot/grub/i386-pc/div_test.module
 /mnt/boot/grub/i386-pc/dm_nv.mod
+/mnt/boot/grub/i386-pc/dm_nv.module
 /mnt/boot/grub/i386-pc/drivemap.mod
+/mnt/boot/grub/i386-pc/drivemap.module
 /mnt/boot/grub/i386-pc/echo.mod
+/mnt/boot/grub/i386-pc/echo.module
 /mnt/boot/grub/i386-pc/efiemu32.o
 /mnt/boot/grub/i386-pc/efiemu64.o
 /mnt/boot/grub/i386-pc/efiemu.mod
+/mnt/boot/grub/i386-pc/efiemu.module
 /mnt/boot/grub/i386-pc/ehci.mod
+/mnt/boot/grub/i386-pc/ehci.module
 /mnt/boot/grub/i386-pc/elf.mod
+/mnt/boot/grub/i386-pc/elf.module
 /mnt/boot/grub/i386-pc/eval.mod
+/mnt/boot/grub/i386-pc/eval.module
 /mnt/boot/grub/i386-pc/exfat.mod
+/mnt/boot/grub/i386-pc/exfat.module
 /mnt/boot/grub/i386-pc/exfctest.mod
+/mnt/boot/grub/i386-pc/exfctest.module
 /mnt/boot/grub/i386-pc/ext2.mod
+/mnt/boot/grub/i386-pc/ext2.module
 /mnt/boot/grub/i386-pc/extcmd.mod
+/mnt/boot/grub/i386-pc/extcmd.module
 /mnt/boot/grub/i386-pc/f2fs.mod
+/mnt/boot/grub/i386-pc/f2fs.module
 /mnt/boot/grub/i386-pc/fat.mod
+/mnt/boot/grub/i386-pc/fat.module
+/mnt/boot/grub/i386-pc/fdt.lst
 /mnt/boot/grub/i386-pc/file.mod
+/mnt/boot/grub/i386-pc/file.module
 /mnt/boot/grub/i386-pc/font.mod
+/mnt/boot/grub/i386-pc/font.module
 /mnt/boot/grub/i386-pc/freedos.mod
+/mnt/boot/grub/i386-pc/freedos.module
 /mnt/boot/grub/i386-pc/fshelp.mod
+/mnt/boot/grub/i386-pc/fshelp.module
 /mnt/boot/grub/i386-pc/fs.lst
 /mnt/boot/grub/i386-pc/functional_test.mod
+/mnt/boot/grub/i386-pc/functional_test.module
 /mnt/boot/grub/i386-pc/gcry_arcfour.mod
+/mnt/boot/grub/i386-pc/gcry_arcfour.module
 /mnt/boot/grub/i386-pc/gcry_blowfish.mod
+/mnt/boot/grub/i386-pc/gcry_blowfish.module
 /mnt/boot/grub/i386-pc/gcry_camellia.mod
+/mnt/boot/grub/i386-pc/gcry_camellia.module
 /mnt/boot/grub/i386-pc/gcry_cast5.mod
+/mnt/boot/grub/i386-pc/gcry_cast5.module
 /mnt/boot/grub/i386-pc/gcry_crc.mod
+/mnt/boot/grub/i386-pc/gcry_crc.module
 /mnt/boot/grub/i386-pc/gcry_des.mod
+/mnt/boot/grub/i386-pc/gcry_des.module
 /mnt/boot/grub/i386-pc/gcry_dsa.mod
+/mnt/boot/grub/i386-pc/gcry_dsa.module
 /mnt/boot/grub/i386-pc/gcry_idea.mod
+/mnt/boot/grub/i386-pc/gcry_idea.module
 /mnt/boot/grub/i386-pc/gcry_md4.mod
+/mnt/boot/grub/i386-pc/gcry_md4.module
 /mnt/boot/grub/i386-pc/gcry_md5.mod
+/mnt/boot/grub/i386-pc/gcry_md5.module
 /mnt/boot/grub/i386-pc/gcry_rfc2268.mod
+/mnt/boot/grub/i386-pc/gcry_rfc2268.module
 /mnt/boot/grub/i386-pc/gcry_rijndael.mod
+/mnt/boot/grub/i386-pc/gcry_rijndael.module
 /mnt/boot/grub/i386-pc/gcry_rmd160.mod
+/mnt/boot/grub/i386-pc/gcry_rmd160.module
 /mnt/boot/grub/i386-pc/gcry_rsa.mod
+/mnt/boot/grub/i386-pc/gcry_rsa.module
 /mnt/boot/grub/i386-pc/gcry_seed.mod
+/mnt/boot/grub/i386-pc/gcry_seed.module
 /mnt/boot/grub/i386-pc/gcry_serpent.mod
+/mnt/boot/grub/i386-pc/gcry_serpent.module
 /mnt/boot/grub/i386-pc/gcry_sha1.mod
+/mnt/boot/grub/i386-pc/gcry_sha1.module
 /mnt/boot/grub/i386-pc/gcry_sha256.mod
+/mnt/boot/grub/i386-pc/gcry_sha256.module
 /mnt/boot/grub/i386-pc/gcry_sha512.mod
+/mnt/boot/grub/i386-pc/gcry_sha512.module
 /mnt/boot/grub/i386-pc/gcry_tiger.mod
+/mnt/boot/grub/i386-pc/gcry_tiger.module
 /mnt/boot/grub/i386-pc/gcry_twofish.mod
+/mnt/boot/grub/i386-pc/gcry_twofish.module
 /mnt/boot/grub/i386-pc/gcry_whirlpool.mod
+/mnt/boot/grub/i386-pc/gcry_whirlpool.module
+/mnt/boot/grub/i386-pc/gdb_grub
 /mnt/boot/grub/i386-pc/gdb.mod
+/mnt/boot/grub/i386-pc/gdb.module
 /mnt/boot/grub/i386-pc/geli.mod
+/mnt/boot/grub/i386-pc/geli.module
 /mnt/boot/grub/i386-pc/gettext.mod
+/mnt/boot/grub/i386-pc/gettext.module
 /mnt/boot/grub/i386-pc/gfxmenu.mod
+/mnt/boot/grub/i386-pc/gfxmenu.module
 /mnt/boot/grub/i386-pc/gfxterm_background.mod
+/mnt/boot/grub/i386-pc/gfxterm_background.module
 /mnt/boot/grub/i386-pc/gfxterm_menu.mod
+/mnt/boot/grub/i386-pc/gfxterm_menu.module
 /mnt/boot/grub/i386-pc/gfxterm.mod
+/mnt/boot/grub/i386-pc/gfxterm.module
+/mnt/boot/grub/i386-pc/gmodule.pl
 /mnt/boot/grub/i386-pc/gptsync.mod
+/mnt/boot/grub/i386-pc/gptsync.module
 /mnt/boot/grub/i386-pc/gzio.mod
+/mnt/boot/grub/i386-pc/gzio.module
 /mnt/boot/grub/i386-pc/halt.mod
+/mnt/boot/grub/i386-pc/halt.module
 /mnt/boot/grub/i386-pc/hashsum.mod
+/mnt/boot/grub/i386-pc/hashsum.module
 /mnt/boot/grub/i386-pc/hdparm.mod
+/mnt/boot/grub/i386-pc/hdparm.module
 /mnt/boot/grub/i386-pc/hello.mod
+/mnt/boot/grub/i386-pc/hello.module
 /mnt/boot/grub/i386-pc/help.mod
+/mnt/boot/grub/i386-pc/help.module
 /mnt/boot/grub/i386-pc/hexdump.mod
+/mnt/boot/grub/i386-pc/hexdump.module
 /mnt/boot/grub/i386-pc/hfs.mod
+/mnt/boot/grub/i386-pc/hfs.module
 /mnt/boot/grub/i386-pc/hfspluscomp.mod
+/mnt/boot/grub/i386-pc/hfspluscomp.module
 /mnt/boot/grub/i386-pc/hfsplus.mod
+/mnt/boot/grub/i386-pc/hfsplus.module
 /mnt/boot/grub/i386-pc/http.mod
+/mnt/boot/grub/i386-pc/http.module
 /mnt/boot/grub/i386-pc/iorw.mod
+/mnt/boot/grub/i386-pc/iorw.module
 /mnt/boot/grub/i386-pc/iso9660.mod
+/mnt/boot/grub/i386-pc/iso9660.module
 /mnt/boot/grub/i386-pc/jfs.mod
+/mnt/boot/grub/i386-pc/jfs.module
 /mnt/boot/grub/i386-pc/jpeg.mod
+/mnt/boot/grub/i386-pc/jpeg.module
+/mnt/boot/grub/i386-pc/kernel.exec
+/mnt/boot/grub/i386-pc/kernel.img
 /mnt/boot/grub/i386-pc/keylayouts.mod
+/mnt/boot/grub/i386-pc/keylayouts.module
 /mnt/boot/grub/i386-pc/keystatus.mod
+/mnt/boot/grub/i386-pc/keystatus.module
 /mnt/boot/grub/i386-pc/ldm.mod
+/mnt/boot/grub/i386-pc/ldm.module
 /mnt/boot/grub/i386-pc/legacycfg.mod
+/mnt/boot/grub/i386-pc/legacycfg.module
 /mnt/boot/grub/i386-pc/legacy_password_test.mod
+/mnt/boot/grub/i386-pc/legacy_password_test.module
 /mnt/boot/grub/i386-pc/linux16.mod
+/mnt/boot/grub/i386-pc/linux16.module
 /mnt/boot/grub/i386-pc/linux.mod
+/mnt/boot/grub/i386-pc/linux.module
+/mnt/boot/grub/i386-pc/lnxboot.image
+/mnt/boot/grub/i386-pc/lnxboot.img
 /mnt/boot/grub/i386-pc/loadenv.mod
+/mnt/boot/grub/i386-pc/loadenv.module
 /mnt/boot/grub/i386-pc/loopback.mod
+/mnt/boot/grub/i386-pc/loopback.module
 /mnt/boot/grub/i386-pc/lsacpi.mod
+/mnt/boot/grub/i386-pc/lsacpi.module
 /mnt/boot/grub/i386-pc/lsapm.mod
+/mnt/boot/grub/i386-pc/lsapm.module
 /mnt/boot/grub/i386-pc/lsmmap.mod
+/mnt/boot/grub/i386-pc/lsmmap.module
 /mnt/boot/grub/i386-pc/ls.mod
+/mnt/boot/grub/i386-pc/ls.module
 /mnt/boot/grub/i386-pc/lspci.mod
+/mnt/boot/grub/i386-pc/lspci.module
 /mnt/boot/grub/i386-pc/luks.mod
+/mnt/boot/grub/i386-pc/luks.module
 /mnt/boot/grub/i386-pc/lvm.mod
+/mnt/boot/grub/i386-pc/lvm.module
+/mnt/boot/grub/i386-pc/lzma_decompress.image
+/mnt/boot/grub/i386-pc/lzma_decompress.img
 /mnt/boot/grub/i386-pc/lzopio.mod
+/mnt/boot/grub/i386-pc/lzopio.module
 /mnt/boot/grub/i386-pc/macbless.mod
+/mnt/boot/grub/i386-pc/macbless.module
 /mnt/boot/grub/i386-pc/macho.mod
+/mnt/boot/grub/i386-pc/macho.module
 /mnt/boot/grub/i386-pc/mda_text.mod
+/mnt/boot/grub/i386-pc/mda_text.module
 /mnt/boot/grub/i386-pc/mdraid09_be.mod
+/mnt/boot/grub/i386-pc/mdraid09_be.module
 /mnt/boot/grub/i386-pc/mdraid09.mod
+/mnt/boot/grub/i386-pc/mdraid09.module
 /mnt/boot/grub/i386-pc/mdraid1x.mod
+/mnt/boot/grub/i386-pc/mdraid1x.module
 /mnt/boot/grub/i386-pc/memdisk.mod
+/mnt/boot/grub/i386-pc/memdisk.module
 /mnt/boot/grub/i386-pc/memrw.mod
+/mnt/boot/grub/i386-pc/memrw.module
 /mnt/boot/grub/i386-pc/minicmd.mod
+/mnt/boot/grub/i386-pc/minicmd.module
 /mnt/boot/grub/i386-pc/minix2_be.mod
+/mnt/boot/grub/i386-pc/minix2_be.module
 /mnt/boot/grub/i386-pc/minix2.mod
+/mnt/boot/grub/i386-pc/minix2.module
 /mnt/boot/grub/i386-pc/minix3_be.mod
+/mnt/boot/grub/i386-pc/minix3_be.module
 /mnt/boot/grub/i386-pc/minix3.mod
+/mnt/boot/grub/i386-pc/minix3.module
 /mnt/boot/grub/i386-pc/minix_be.mod
+/mnt/boot/grub/i386-pc/minix_be.module
 /mnt/boot/grub/i386-pc/minix.mod
+/mnt/boot/grub/i386-pc/minix.module
 /mnt/boot/grub/i386-pc/mmap.mod
+/mnt/boot/grub/i386-pc/mmap.module
 /mnt/boot/grub/i386-pc/moddep.lst
 /mnt/boot/grub/i386-pc/modinfo.sh
 /mnt/boot/grub/i386-pc/morse.mod
+/mnt/boot/grub/i386-pc/morse.module
 /mnt/boot/grub/i386-pc/mpi.mod
+/mnt/boot/grub/i386-pc/mpi.module
 /mnt/boot/grub/i386-pc/msdospart.mod
+/mnt/boot/grub/i386-pc/msdospart.module
 /mnt/boot/grub/i386-pc/mul_test.mod
+/mnt/boot/grub/i386-pc/mul_test.module
 /mnt/boot/grub/i386-pc/multiboot2.mod
+/mnt/boot/grub/i386-pc/multiboot2.module
 /mnt/boot/grub/i386-pc/multiboot.mod
+/mnt/boot/grub/i386-pc/multiboot.module
 /mnt/boot/grub/i386-pc/nativedisk.mod
+/mnt/boot/grub/i386-pc/nativedisk.module
 /mnt/boot/grub/i386-pc/net.mod
+/mnt/boot/grub/i386-pc/net.module
 /mnt/boot/grub/i386-pc/newc.mod
+/mnt/boot/grub/i386-pc/newc.module
 /mnt/boot/grub/i386-pc/nilfs2.mod
+/mnt/boot/grub/i386-pc/nilfs2.module
 /mnt/boot/grub/i386-pc/normal.mod
+/mnt/boot/grub/i386-pc/normal.module
 /mnt/boot/grub/i386-pc/ntfscomp.mod
+/mnt/boot/grub/i386-pc/ntfscomp.module
 /mnt/boot/grub/i386-pc/ntfs.mod
+/mnt/boot/grub/i386-pc/ntfs.module
 /mnt/boot/grub/i386-pc/ntldr.mod
+/mnt/boot/grub/i386-pc/ntldr.module
 /mnt/boot/grub/i386-pc/odc.mod
+/mnt/boot/grub/i386-pc/odc.module
 /mnt/boot/grub/i386-pc/offsetio.mod
+/mnt/boot/grub/i386-pc/offsetio.module
 /mnt/boot/grub/i386-pc/ohci.mod
+/mnt/boot/grub/i386-pc/ohci.module
 /mnt/boot/grub/i386-pc/part_acorn.mod
+/mnt/boot/grub/i386-pc/part_acorn.module
 /mnt/boot/grub/i386-pc/part_amiga.mod
+/mnt/boot/grub/i386-pc/part_amiga.module
 /mnt/boot/grub/i386-pc/part_apple.mod
+/mnt/boot/grub/i386-pc/part_apple.module
 /mnt/boot/grub/i386-pc/part_bsd.mod
+/mnt/boot/grub/i386-pc/part_bsd.module
 /mnt/boot/grub/i386-pc/part_dfly.mod
+/mnt/boot/grub/i386-pc/part_dfly.module
 /mnt/boot/grub/i386-pc/part_dvh.mod
+/mnt/boot/grub/i386-pc/part_dvh.module
 /mnt/boot/grub/i386-pc/part_gpt.mod
+/mnt/boot/grub/i386-pc/part_gpt.module
 /mnt/boot/grub/i386-pc/partmap.lst
 /mnt/boot/grub/i386-pc/part_msdos.mod
+/mnt/boot/grub/i386-pc/part_msdos.module
 /mnt/boot/grub/i386-pc/part_plan.mod
+/mnt/boot/grub/i386-pc/part_plan.module
 /mnt/boot/grub/i386-pc/part_sun.mod
+/mnt/boot/grub/i386-pc/part_sun.module
 /mnt/boot/grub/i386-pc/part_sunpc.mod
+/mnt/boot/grub/i386-pc/part_sunpc.module
 /mnt/boot/grub/i386-pc/parttool.lst
 /mnt/boot/grub/i386-pc/parttool.mod
+/mnt/boot/grub/i386-pc/parttool.module
 /mnt/boot/grub/i386-pc/password.mod
+/mnt/boot/grub/i386-pc/password.module
 /mnt/boot/grub/i386-pc/password_pbkdf2.mod
+/mnt/boot/grub/i386-pc/password_pbkdf2.module
 /mnt/boot/grub/i386-pc/pata.mod
+/mnt/boot/grub/i386-pc/pata.module
 /mnt/boot/grub/i386-pc/pbkdf2.mod
+/mnt/boot/grub/i386-pc/pbkdf2.module
 /mnt/boot/grub/i386-pc/pbkdf2_test.mod
+/mnt/boot/grub/i386-pc/pbkdf2_test.module
 /mnt/boot/grub/i386-pc/pcidump.mod
+/mnt/boot/grub/i386-pc/pcidump.module
 /mnt/boot/grub/i386-pc/pci.mod
+/mnt/boot/grub/i386-pc/pci.module
 /mnt/boot/grub/i386-pc/pgp.mod
+/mnt/boot/grub/i386-pc/pgp.module
 /mnt/boot/grub/i386-pc/plan9.mod
+/mnt/boot/grub/i386-pc/plan9.module
 /mnt/boot/grub/i386-pc/play.mod
+/mnt/boot/grub/i386-pc/play.module
 /mnt/boot/grub/i386-pc/png.mod
+/mnt/boot/grub/i386-pc/png.module
 /mnt/boot/grub/i386-pc/priority_queue.mod
+/mnt/boot/grub/i386-pc/priority_queue.module
 /mnt/boot/grub/i386-pc/probe.mod
+/mnt/boot/grub/i386-pc/probe.module
 /mnt/boot/grub/i386-pc/procfs.mod
+/mnt/boot/grub/i386-pc/procfs.module
 /mnt/boot/grub/i386-pc/progress.mod
+/mnt/boot/grub/i386-pc/progress.module
+/mnt/boot/grub/i386-pc/pxeboot.image
+/mnt/boot/grub/i386-pc/pxeboot.img
 /mnt/boot/grub/i386-pc/pxechain.mod
+/mnt/boot/grub/i386-pc/pxechain.module
 /mnt/boot/grub/i386-pc/pxe.mod
+/mnt/boot/grub/i386-pc/pxe.module
 /mnt/boot/grub/i386-pc/raid5rec.mod
+/mnt/boot/grub/i386-pc/raid5rec.module
 /mnt/boot/grub/i386-pc/raid6rec.mod
+/mnt/boot/grub/i386-pc/raid6rec.module
 /mnt/boot/grub/i386-pc/random.mod
+/mnt/boot/grub/i386-pc/random.module
 /mnt/boot/grub/i386-pc/rdmsr.mod
+/mnt/boot/grub/i386-pc/rdmsr.module
 /mnt/boot/grub/i386-pc/read.mod
+/mnt/boot/grub/i386-pc/read.module
 /mnt/boot/grub/i386-pc/reboot.mod
+/mnt/boot/grub/i386-pc/reboot.module
 /mnt/boot/grub/i386-pc/regexp.mod
+/mnt/boot/grub/i386-pc/regexp.module
 /mnt/boot/grub/i386-pc/reiserfs.mod
+/mnt/boot/grub/i386-pc/reiserfs.module
 /mnt/boot/grub/i386-pc/relocator.mod
+/mnt/boot/grub/i386-pc/relocator.module
 /mnt/boot/grub/i386-pc/romfs.mod
+/mnt/boot/grub/i386-pc/romfs.module
 /mnt/boot/grub/i386-pc/scsi.mod
+/mnt/boot/grub/i386-pc/scsi.module
 /mnt/boot/grub/i386-pc/search_fs_file.mod
+/mnt/boot/grub/i386-pc/search_fs_file.module
 /mnt/boot/grub/i386-pc/search_fs_uuid.mod
+/mnt/boot/grub/i386-pc/search_fs_uuid.module
 /mnt/boot/grub/i386-pc/search_label.mod
+/mnt/boot/grub/i386-pc/search_label.module
 /mnt/boot/grub/i386-pc/search.mod
+/mnt/boot/grub/i386-pc/search.module
 /mnt/boot/grub/i386-pc/sendkey.mod
+/mnt/boot/grub/i386-pc/sendkey.module
 /mnt/boot/grub/i386-pc/serial.mod
+/mnt/boot/grub/i386-pc/serial.module
 /mnt/boot/grub/i386-pc/setjmp.mod
+/mnt/boot/grub/i386-pc/setjmp.module
 /mnt/boot/grub/i386-pc/setjmp_test.mod
+/mnt/boot/grub/i386-pc/setjmp_test.module
 /mnt/boot/grub/i386-pc/setpci.mod
+/mnt/boot/grub/i386-pc/setpci.module
 /mnt/boot/grub/i386-pc/sfs.mod
+/mnt/boot/grub/i386-pc/sfs.module
 /mnt/boot/grub/i386-pc/shift_test.mod
+/mnt/boot/grub/i386-pc/shift_test.module
 /mnt/boot/grub/i386-pc/signature_test.mod
+/mnt/boot/grub/i386-pc/signature_test.module
 /mnt/boot/grub/i386-pc/sleep.mod
+/mnt/boot/grub/i386-pc/sleep.module
 /mnt/boot/grub/i386-pc/sleep_test.mod
+/mnt/boot/grub/i386-pc/sleep_test.module
 /mnt/boot/grub/i386-pc/spkmodem.mod
+/mnt/boot/grub/i386-pc/spkmodem.module
 /mnt/boot/grub/i386-pc/squash4.mod
+/mnt/boot/grub/i386-pc/squash4.module
 /mnt/boot/grub/i386-pc/strtoull_test.mod
+/mnt/boot/grub/i386-pc/strtoull_test.module
 /mnt/boot/grub/i386-pc/syslinuxcfg.mod
+/mnt/boot/grub/i386-pc/syslinuxcfg.module
 /mnt/boot/grub/i386-pc/tar.mod
+/mnt/boot/grub/i386-pc/tar.module
 /mnt/boot/grub/i386-pc/terminal.lst
 /mnt/boot/grub/i386-pc/terminal.mod
+/mnt/boot/grub/i386-pc/terminal.module
 /mnt/boot/grub/i386-pc/terminfo.mod
+/mnt/boot/grub/i386-pc/terminfo.module
 /mnt/boot/grub/i386-pc/test_blockarg.mod
+/mnt/boot/grub/i386-pc/test_blockarg.module
 /mnt/boot/grub/i386-pc/testload.mod
+/mnt/boot/grub/i386-pc/testload.module
 /mnt/boot/grub/i386-pc/test.mod
+/mnt/boot/grub/i386-pc/test.module
 /mnt/boot/grub/i386-pc/testspeed.mod
+/mnt/boot/grub/i386-pc/testspeed.module
 /mnt/boot/grub/i386-pc/tftp.mod
+/mnt/boot/grub/i386-pc/tftp.module
 /mnt/boot/grub/i386-pc/tga.mod
+/mnt/boot/grub/i386-pc/tga.module
 /mnt/boot/grub/i386-pc/time.mod
+/mnt/boot/grub/i386-pc/time.module
 /mnt/boot/grub/i386-pc/trig.mod
+/mnt/boot/grub/i386-pc/trig.module
 /mnt/boot/grub/i386-pc/tr.mod
+/mnt/boot/grub/i386-pc/tr.module
 /mnt/boot/grub/i386-pc/truecrypt.mod
+/mnt/boot/grub/i386-pc/truecrypt.module
 /mnt/boot/grub/i386-pc/true.mod
+/mnt/boot/grub/i386-pc/true.module
 /mnt/boot/grub/i386-pc/udf.mod
+/mnt/boot/grub/i386-pc/udf.module
 /mnt/boot/grub/i386-pc/ufs1_be.mod
+/mnt/boot/grub/i386-pc/ufs1_be.module
 /mnt/boot/grub/i386-pc/ufs1.mod
+/mnt/boot/grub/i386-pc/ufs1.module
 /mnt/boot/grub/i386-pc/ufs2.mod
+/mnt/boot/grub/i386-pc/ufs2.module
 /mnt/boot/grub/i386-pc/uhci.mod
+/mnt/boot/grub/i386-pc/uhci.module
 /mnt/boot/grub/i386-pc/usb_keyboard.mod
+/mnt/boot/grub/i386-pc/usb_keyboard.module
 /mnt/boot/grub/i386-pc/usb.mod
+/mnt/boot/grub/i386-pc/usb.module
 /mnt/boot/grub/i386-pc/usbms.mod
+/mnt/boot/grub/i386-pc/usbms.module
 /mnt/boot/grub/i386-pc/usbserial_common.mod
+/mnt/boot/grub/i386-pc/usbserial_common.module
 /mnt/boot/grub/i386-pc/usbserial_ftdi.mod
+/mnt/boot/grub/i386-pc/usbserial_ftdi.module
 /mnt/boot/grub/i386-pc/usbserial_pl2303.mod
+/mnt/boot/grub/i386-pc/usbserial_pl2303.module
 /mnt/boot/grub/i386-pc/usbserial_usbdebug.mod
+/mnt/boot/grub/i386-pc/usbserial_usbdebug.module
 /mnt/boot/grub/i386-pc/usbtest.mod
+/mnt/boot/grub/i386-pc/usbtest.module
 /mnt/boot/grub/i386-pc/vbe.mod
+/mnt/boot/grub/i386-pc/vbe.module
 /mnt/boot/grub/i386-pc/verifiers.mod
+/mnt/boot/grub/i386-pc/verifiers.module
 /mnt/boot/grub/i386-pc/vga.mod
+/mnt/boot/grub/i386-pc/vga.module
 /mnt/boot/grub/i386-pc/vga_text.mod
+/mnt/boot/grub/i386-pc/vga_text.module
 /mnt/boot/grub/i386-pc/video_bochs.mod
+/mnt/boot/grub/i386-pc/video_bochs.module
 /mnt/boot/grub/i386-pc/video_cirrus.mod
+/mnt/boot/grub/i386-pc/video_cirrus.module
 /mnt/boot/grub/i386-pc/video_colors.mod
+/mnt/boot/grub/i386-pc/video_colors.module
 /mnt/boot/grub/i386-pc/video_fb.mod
+/mnt/boot/grub/i386-pc/video_fb.module
 /mnt/boot/grub/i386-pc/videoinfo.mod
+/mnt/boot/grub/i386-pc/videoinfo.module
 /mnt/boot/grub/i386-pc/video.lst
 /mnt/boot/grub/i386-pc/video.mod
+/mnt/boot/grub/i386-pc/video.module
 /mnt/boot/grub/i386-pc/videotest_checksum.mod
+/mnt/boot/grub/i386-pc/videotest_checksum.module
 /mnt/boot/grub/i386-pc/videotest.mod
+/mnt/boot/grub/i386-pc/videotest.module
 /mnt/boot/grub/i386-pc/wrmsr.mod
+/mnt/boot/grub/i386-pc/wrmsr.module
 /mnt/boot/grub/i386-pc/xfs.mod
+/mnt/boot/grub/i386-pc/xfs.module
 /mnt/boot/grub/i386-pc/xnu.mod
+/mnt/boot/grub/i386-pc/xnu.module
 /mnt/boot/grub/i386-pc/xnu_uuid.mod
+/mnt/boot/grub/i386-pc/xnu_uuid.module
 /mnt/boot/grub/i386-pc/xnu_uuid_test.mod
+/mnt/boot/grub/i386-pc/xnu_uuid_test.module
 /mnt/boot/grub/i386-pc/xzio.mod
+/mnt/boot/grub/i386-pc/xzio.module
 /mnt/boot/grub/i386-pc/zfscrypt.mod
+/mnt/boot/grub/i386-pc/zfscrypt.module
 /mnt/boot/grub/i386-pc/zfsinfo.mod
+/mnt/boot/grub/i386-pc/zfsinfo.module
 /mnt/boot/grub/i386-pc/zfs.mod
+/mnt/boot/grub/i386-pc/zfs.module
 /mnt/boot/grub/i386-pc/zstd.mod
+/mnt/boot/grub/i386-pc/zstd.module
 /mnt/dev
 /mnt/dev/full
 /mnt/dev/null
@@ -3870,7 +4154,7 @@
 /mnt/gnu/store/0xkbwx77kpf3m703xb3a4dw5ymgrbb9l-ncurses-6.2/share/terminfo/z/ztx
 /mnt/gnu/store/0xkbwx77kpf3m703xb3a4dw5ymgrbb9l-ncurses-6.2/share/terminfo/z/ztx11
 /mnt/gnu/store/0xkbwx77kpf3m703xb3a4dw5ymgrbb9l-ncurses-6.2/share/terminfo/z/ztx-1-a
-/mnt/gnu/store/14wx42560538zrfgcfzpfrb1amc5sd5n-fstab
+/mnt/gnu/store/1a4kjfrz3b2irlhqxwqc247yb112y9ay-grub.cfg
 /mnt/gnu/store/1qiic9c00a3aipsfpvs207q52kxzidc0-inetutils-1.9.4
 /mnt/gnu/store/1qiic9c00a3aipsfpvs207q52kxzidc0-inetutils-1.9.4/bin
 /mnt/gnu/store/1qiic9c00a3aipsfpvs207q52kxzidc0-inetutils-1.9.4/bin/dnsdomainname
@@ -3975,6 +4259,17 @@
 /mnt/gnu/store/2f4kl55cinl8wf9m6rsxaknahk4kmnip-libffi-3.3/share/man/man3/ffi_prep_cif.3.gz
 /mnt/gnu/store/2f4kl55cinl8wf9m6rsxaknahk4kmnip-libffi-3.3/share/man/man3/ffi_prep_cif_var.3.gz
 /mnt/gnu/store/2mkc12b9rc0agcvdx41jghpqak37xia9-shells
+/mnt/gnu/store/2pld8ls6k6xlp1mncgcwsny1q6a72k7f-etc
+/mnt/gnu/store/2pld8ls6k6xlp1mncgcwsny1q6a72k7f-etc/fstab
+/mnt/gnu/store/2pld8ls6k6xlp1mncgcwsny1q6a72k7f-etc/hostname
+/mnt/gnu/store/2pld8ls6k6xlp1mncgcwsny1q6a72k7f-etc/login
+/mnt/gnu/store/2pld8ls6k6xlp1mncgcwsny1q6a72k7f-etc/motd
+/mnt/gnu/store/2pld8ls6k6xlp1mncgcwsny1q6a72k7f-etc/pam.d
+/mnt/gnu/store/2pld8ls6k6xlp1mncgcwsny1q6a72k7f-etc/profile
+/mnt/gnu/store/2pld8ls6k6xlp1mncgcwsny1q6a72k7f-etc/protocols
+/mnt/gnu/store/2pld8ls6k6xlp1mncgcwsny1q6a72k7f-etc/services
+/mnt/gnu/store/2pld8ls6k6xlp1mncgcwsny1q6a72k7f-etc/shells
+/mnt/gnu/store/2pld8ls6k6xlp1mncgcwsny1q6a72k7f-etc/skel
 /mnt/gnu/store/2qgfx97gf619ihwg0rb640cyf76nyhcm-shadow-4.8.1
 /mnt/gnu/store/2qgfx97gf619ihwg0rb640cyf76nyhcm-shadow-4.8.1/bin
 /mnt/gnu/store/2qgfx97gf619ihwg0rb640cyf76nyhcm-shadow-4.8.1/bin/chage
@@ -6371,10 +6666,6 @@
 /mnt/gnu/store/62jv6ba69vmscdnkaj1699pqk9s2g7pv-findutils-4.7.0/share/man/man1/xargs.1.gz
 /mnt/gnu/store/62jv6ba69vmscdnkaj1699pqk9s2g7pv-findutils-4.7.0/share/man/man5
 /mnt/gnu/store/62jv6ba69vmscdnkaj1699pqk9s2g7pv-findutils-4.7.0/share/man/man5/locatedb.5.gz
-/mnt/gnu/store/6aivs06ky003v3r9rzvqqmdmk5ydcr12-system
-/mnt/gnu/store/6aivs06ky003v3r9rzvqqmdmk5ydcr12-system/boot
-/mnt/gnu/store/6aivs06ky003v3r9rzvqqmdmk5ydcr12-system/etc
-/mnt/gnu/store/6aivs06ky003v3r9rzvqqmdmk5ydcr12-system/profile
 /mnt/gnu/store/6j8k26az3603pabrkgq5rilj07jmvxy9-libaio-0.3.112
 /mnt/gnu/store/6j8k26az3603pabrkgq5rilj07jmvxy9-libaio-0.3.112/include
 /mnt/gnu/store/6j8k26az3603pabrkgq5rilj07jmvxy9-libaio-0.3.112/include/libaio.h
@@ -6392,7 +6683,6 @@
 /mnt/gnu/store/6knhh53rv28b6vijp84fa2czghb4cskw-module-import/guix/build
 /mnt/gnu/store/6knhh53rv28b6vijp84fa2czghb4cskw-module-import/guix/build/syscalls.scm
 /mnt/gnu/store/6knhh53rv28b6vijp84fa2czghb4cskw-module-import/guix/build/utils.scm
-/mnt/gnu/store/6pwj43n207yvmzpgihkhw8h7yvm7660x-activate.scm
 /mnt/gnu/store/6v1dngaaylg4zddyccfrsq5krm2s55cd-guile-3.0.2
 /mnt/gnu/store/6v1dngaaylg4zddyccfrsq5krm2s55cd-guile-3.0.2/bin
 /mnt/gnu/store/6v1dngaaylg4zddyccfrsq5krm2s55cd-guile-3.0.2/bin/guild
@@ -8174,17 +8464,7 @@
 /mnt/gnu/store/776vkvaqd1583y3zcaj41j37irnqvfb5-libtirpc-hurd-1.2.5/share/man/man3/rtime.3t
 /mnt/gnu/store/776vkvaqd1583y3zcaj41j37irnqvfb5-libtirpc-hurd-1.2.5/share/man/man5
 /mnt/gnu/store/776vkvaqd1583y3zcaj41j37irnqvfb5-libtirpc-hurd-1.2.5/share/man/man5/netconfig.5.gz
-/mnt/gnu/store/7g8029j8xg6v1jg28cml79dm7698klwn-etc
-/mnt/gnu/store/7g8029j8xg6v1jg28cml79dm7698klwn-etc/fstab
-/mnt/gnu/store/7g8029j8xg6v1jg28cml79dm7698klwn-etc/hostname
-/mnt/gnu/store/7g8029j8xg6v1jg28cml79dm7698klwn-etc/login
-/mnt/gnu/store/7g8029j8xg6v1jg28cml79dm7698klwn-etc/motd
-/mnt/gnu/store/7g8029j8xg6v1jg28cml79dm7698klwn-etc/pam.d
-/mnt/gnu/store/7g8029j8xg6v1jg28cml79dm7698klwn-etc/profile
-/mnt/gnu/store/7g8029j8xg6v1jg28cml79dm7698klwn-etc/protocols
-/mnt/gnu/store/7g8029j8xg6v1jg28cml79dm7698klwn-etc/services
-/mnt/gnu/store/7g8029j8xg6v1jg28cml79dm7698klwn-etc/shells
-/mnt/gnu/store/7g8029j8xg6v1jg28cml79dm7698klwn-etc/skel
+/mnt/gnu/store/7h53d16508m2p3008pgln27ly940nfw4-activate-service.scm
 /mnt/gnu/store/7kpj306l4rhksk4cqxs1acbpgqi666yv-activate-service.scm
 /mnt/gnu/store/821ibr4gx0p0jaccm1dykvkrxyd7jgx0-grub-image.png
 /mnt/gnu/store/84drw74x1za6pspp9xhncbdkw072xvfy-shepherd-ssh-daemon-ssh-sshd.scm
@@ -11619,7 +11899,6 @@
 /mnt/gnu/store/a4vdhbfflmbpc346lsvl3v0plplmg5ma-attr-2.4.48/share/man/man3/attr_removef.3
 /mnt/gnu/store/a4vdhbfflmbpc346lsvl3v0plplmg5ma-attr-2.4.48/share/man/man3/attr_set.3.gz
 /mnt/gnu/store/a4vdhbfflmbpc346lsvl3v0plplmg5ma-attr-2.4.48/share/man/man3/attr_setf.3
-/mnt/gnu/store/ag32klvln9v9dwxizjv08fizd8v46ml7-activate-service.scm
 /mnt/gnu/store/allmlpclnmwwd9i8bpiflczzb4l5snwz-grep-3.4
 /mnt/gnu/store/allmlpclnmwwd9i8bpiflczzb4l5snwz-grep-3.4/bin
 /mnt/gnu/store/allmlpclnmwwd9i8bpiflczzb4l5snwz-grep-3.4/bin/egrep
@@ -11962,6 +12241,10 @@
 /mnt/gnu/store/bmzm0438zg3b5lzfii88g3mvfi1j9nrp-acl-2.2.53/share/man/man3/acl_valid.3.gz
 /mnt/gnu/store/bmzm0438zg3b5lzfii88g3mvfi1j9nrp-acl-2.2.53/share/man/man5
 /mnt/gnu/store/bmzm0438zg3b5lzfii88g3mvfi1j9nrp-acl-2.2.53/share/man/man5/acl.5.gz
+/mnt/gnu/store/byi1lqv7vg53r9j3wza7hz2irygyphq1-system
+/mnt/gnu/store/byi1lqv7vg53r9j3wza7hz2irygyphq1-system/boot
+/mnt/gnu/store/byi1lqv7vg53r9j3wza7hz2irygyphq1-system/etc
+/mnt/gnu/store/byi1lqv7vg53r9j3wza7hz2irygyphq1-system/profile
 /mnt/gnu/store/ciqw141srsmdl8mdiia002rpsmy1k60f-profile
 /mnt/gnu/store/cp5kmw9rs8ix2glhcvfs8kkj7pz603rq-shepherd-user-processes.scm
 /mnt/gnu/store/cxg27gj26rh3as8x03zm1b1iybaqga4q-linux-pam-1.3.1
@@ -12480,7 +12763,6 @@
 /mnt/gnu/store/cxg27gj26rh3as8x03zm1b1iybaqga4q-linux-pam-1.3.1/share/man/man8/pam_xauth.8.gz
 /mnt/gnu/store/cxg27gj26rh3as8x03zm1b1iybaqga4q-linux-pam-1.3.1/share/man/man8/unix_chkpwd.8.gz
 /mnt/gnu/store/cxg27gj26rh3as8x03zm1b1iybaqga4q-linux-pam-1.3.1/share/man/man8/unix_update.8.gz
-/mnt/gnu/store/d9n46xfrk1cvzbsqzrqns652pdx5afhs-grub.cfg
 /mnt/gnu/store/dg1ng9q9gphg0h84fv6jjcl6hdl4kvy9-module-import-compiled
 /mnt/gnu/store/dg1ng9q9gphg0h84fv6jjcl6hdl4kvy9-module-import-compiled/guix
 /mnt/gnu/store/dg1ng9q9gphg0h84fv6jjcl6hdl4kvy9-module-import-compiled/guix/build
@@ -12600,7 +12882,6 @@
 /mnt/gnu/store/drpbfxxhxz6zzbailf0p61ky3aixc7lq-gnumach-headers-1.8-1.097f9cf/share/info/mach.info-1.gz
 /mnt/gnu/store/drpbfxxhxz6zzbailf0p61ky3aixc7lq-gnumach-headers-1.8-1.097f9cf/share/info/mach.info-2.gz
 /mnt/gnu/store/drpbfxxhxz6zzbailf0p61ky3aixc7lq-gnumach-headers-1.8-1.097f9cf/share/info/mach.info.gz
-/mnt/gnu/store/fa2d2dprkchyk6f2ary1h9ifvykq0i6m-boot
 /mnt/gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31
 /mnt/gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/bin
 /mnt/gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/bin/catchsegv
@@ -17665,7 +17946,6 @@
 /mnt/gnu/store/jj6xg0msv87m0w17xad54h6c2djbm1iw-libatomic-ops-7.6.10/share/doc/libatomic_ops/README_stack.txt
 /mnt/gnu/store/jj6xg0msv87m0w17xad54h6c2djbm1iw-libatomic-ops-7.6.10/share/doc/libatomic_ops/README_win32.txt
 /mnt/gnu/store/jr97p9mbk4xvvgjzw8b3h1gv5s0kdgnn-shepherd-term-tty1.go
-/mnt/gnu/store/jscsrg9xvnxg2wi8a6k1fmrs2byjfc51-activate.scm
 /mnt/gnu/store/k25ghz69j9p3k40zdb06sp5l1h3fjvjj-pkg-config-i586-pc-gnu-0.29.2
 /mnt/gnu/store/k25ghz69j9p3k40zdb06sp5l1h3fjvjj-pkg-config-i586-pc-gnu-0.29.2/bin
 /mnt/gnu/store/k25ghz69j9p3k40zdb06sp5l1h3fjvjj-pkg-config-i586-pc-gnu-0.29.2/bin/i586-pc-gnu-pkg-config
@@ -18327,6 +18607,8 @@
 /mnt/gnu/store/pd044fvg5il8gj44280bzlcc4ha1sxgn-libgcrypt-1.8.5/share/man
 /mnt/gnu/store/pd044fvg5il8gj44280bzlcc4ha1sxgn-libgcrypt-1.8.5/share/man/man1
 /mnt/gnu/store/pd044fvg5il8gj44280bzlcc4ha1sxgn-libgcrypt-1.8.5/share/man/man1/hmac256.1.gz
+/mnt/gnu/store/pdilh7rf8h9rp8pfla90xdmbs4dq61ma-boot
+/mnt/gnu/store/pj7dgbfhwf6j3i642hqmxbalbd4399x8-activate.scm
 /mnt/gnu/store/pr9l9w6d3jg5sq7gvxhb25kg356fzvam-hurd-headers-cross-i586-pc-gnu-0.9-1.91a5167
 /mnt/gnu/store/pr9l9w6d3jg5sq7gvxhb25kg356fzvam-hurd-headers-cross-i586-pc-gnu-0.9-1.91a5167/include
 /mnt/gnu/store/pr9l9w6d3jg5sq7gvxhb25kg356fzvam-hurd-headers-cross-i586-pc-gnu-0.9-1.91a5167/include/assert-backtrace.h
@@ -18898,6 +19180,7 @@
 /mnt/gnu/store/qggj6a3f1iyhb7hrkqi6a7582qcj39y5-module-import-compiled/gnu/system/accounts.go
 /mnt/gnu/store/qggj6a3f1iyhb7hrkqi6a7582qcj39y5-module-import-compiled/guix
 /mnt/gnu/store/qggj6a3f1iyhb7hrkqi6a7582qcj39y5-module-import-compiled/guix/records.go
+/mnt/gnu/store/qqr3c122ph5ib97ji1ryv4gxl283c4wq-activate.scm
 /mnt/gnu/store/qrxci5gzdklc3qv9wpa3vvpz7wl7xmj5-module-import
 /mnt/gnu/store/qrxci5gzdklc3qv9wpa3vvpz7wl7xmj5-module-import/gnu
 /mnt/gnu/store/qrxci5gzdklc3qv9wpa3vvpz7wl7xmj5-module-import/gnu/build
@@ -19227,6 +19510,7 @@
 /mnt/gnu/store/s9gkbbf9wd2smdngx1p0shg7q24ijb9w-file-5.38/share/man/man5
 /mnt/gnu/store/s9gkbbf9wd2smdngx1p0shg7q24ijb9w-file-5.38/share/misc
 /mnt/gnu/store/s9gkbbf9wd2smdngx1p0shg7q24ijb9w-file-5.38/share/misc/magic.mgc
+/mnt/gnu/store/sfpl6f74yvyln7pz1fqgplnfv830f67i-fstab
 /mnt/gnu/store/sqc2k5chiyjm63mpdja0b5cin9c7czvq-shepherd-loopback.go
 /mnt/gnu/store/sr2j5gnlzygpqgvwbk6z0qdgi08sqpgx-libpciaccess-0.16
 /mnt/gnu/store/sr2j5gnlzygpqgvwbk6z0qdgi08sqpgx-libpciaccess-0.16/include
@@ -24349,8 +24633,9 @@
 /mnt/var/db
 /mnt/var/empty
 /mnt/var/guix
+/mnt/var/guix/db
+/mnt/var/guix/db/db.sqlite
 /mnt/var/guix/gcroots
-/mnt/var/guix/gcroots/bootcfg
 /mnt/var/guix/gcroots/booted-system
 /mnt/var/guix/gcroots/current-system
 /mnt/var/guix/gcroots/profiles

[-- Attachment #3: Type: text/plain, Size: 152 bytes --]


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

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd.
  2020-05-23 19:07           ` Jan Nieuwenhuizen
  2020-05-24  9:18             ` Mathieu Othacehe
  2020-05-24 11:19             ` Jan Nieuwenhuizen
@ 2020-05-24 16:36             ` Ludovic Courtès
  2 siblings, 0 replies; 48+ messages in thread
From: Ludovic Courtès @ 2020-05-24 16:36 UTC (permalink / raw)
  To: Jan Nieuwenhuizen; +Cc: Mathieu Othacehe, 41350

Hi!

Jan Nieuwenhuizen <janneke@gnu.org> skribis:

> Mathieu Othacehe writes:
>
>> Hello Jan,
>>
>>> Mathieu, if it turns out that you are dropping qemu-image next week
>>> altogether then great!, and I have no problem whatsoever dropping this
>>> patch set as well.
>>>
>>> For now, I have reset wip-hurd-vm and put your commits towards the
>>> bottom of the wip-hurd-vm stack too.
>>
>> I just pushed a few commits to your branch. I'm now able to run:
>>
>> guix system disk-image --target=i586-pc-gnu  gnu/system/examples/bare-hurd.tmpl
>>
>> no VM inside.
>
> Whoa, that's 10 commits -- great!

Woow, excellent!  Thumbs up!

(I’ll take a look at the graft issue, I feel a repulsion for dynamic
binding growing every day…)

Ludo’.




^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd.
  2020-05-17 10:01 [bug#41350] [PATCH 0/3] Use native qemu to build vm-image Jan Nieuwenhuizen
                   ` (4 preceding siblings ...)
  2020-05-23  9:30 ` [bug#41350] [PATCH v3 1/3] utils: Move 'reset-timestamps' out of database Jan (janneke) Nieuwenhuizen
@ 2020-05-24 18:11 ` Mathieu Othacehe
  2020-05-24 18:40   ` Jan Nieuwenhuizen
  5 siblings, 1 reply; 48+ messages in thread
From: Mathieu Othacehe @ 2020-05-24 18:11 UTC (permalink / raw)
  To: Jan Nieuwenhuizen; +Cc: Ludovic Courtès, 41350


> Ah, qemu-img convert -- nice.  So, we get different type of images.
> Wonder if that could play some role?

Hope not!

> The most interesting differences I see are wrt Grub, e.g.
>
> -/mnt/boot/grub/fonts
> -/mnt/boot/grub/fonts/unicode.pf2
>
> could that still play a role?  I'm having a look why this could be missing.

It's because I just copy "lib/grub" folder in (gnu bootloader grub). I
should also do that for the fonts I guess. But I doubt the issue comes
from here.

> --- vm-image.lst-s	2020-05-24 15:41:02.051314009 +0200
> +++ disk-image.lst-s	2020-05-24 15:41:08.407414141 +0200
> @@ -3,293 +3,577 @@
>  /mnt/boot
>  /mnt/boot/activation
>  /mnt/boot/grub
> -/mnt/boot/grub/fonts

At some point, if we have the same files inside, it should work :p I
noticed that doing a cfdisk on the raw converted, vm-image root
partition reports:

Attributes: 80

which doesn't appear on the disk-image.

However, tune2fs does not show any noticeable difference (both ext_attr
and Hurd OS type are set).

Mathieu




^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd.
  2020-05-24 18:11 ` [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd Mathieu Othacehe
@ 2020-05-24 18:40   ` Jan Nieuwenhuizen
  2020-05-25 15:46     ` Jan Nieuwenhuizen
  0 siblings, 1 reply; 48+ messages in thread
From: Jan Nieuwenhuizen @ 2020-05-24 18:40 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: Ludovic Courtès, 41350

Mathieu Othacehe writes:

>> Ah, qemu-img convert -- nice.  So, we get different type of images.
>> Wonder if that could play some role?
>
> Hope not!

Okay...let's continue searching elsewhere then.

>> The most interesting differences I see are wrt Grub, e.g.
>>
>> -/mnt/boot/grub/fonts
>> -/mnt/boot/grub/fonts/unicode.pf2
>>
>> could that still play a role?  I'm having a look why this could be missing.
>
> It's because I just copy "lib/grub" folder in (gnu bootloader grub). I
> should also do that for the fonts I guess. But I doubt the issue comes
> from here.

Meanwhile I tried adding that by hand; indeed that's not it.

>> --- vm-image.lst-s	2020-05-24 15:41:02.051314009 +0200
>> +++ disk-image.lst-s	2020-05-24 15:41:08.407414141 +0200
>> @@ -3,293 +3,577 @@
>>  /mnt/boot
>>  /mnt/boot/activation
>>  /mnt/boot/grub
>> -/mnt/boot/grub/fonts
>
> At some point, if we have the same files inside, it should work :p I
> noticed that doing a cfdisk on the raw converted, vm-image root
> partition reports:
>
> Attributes: 80
>
> which doesn't appear on the disk-image.

I am not aware that we would be using attributes, at least I reverted
the xattr trick on wip-hurd-vm for the /servers.  Can we find out where
and what they are?

> However, tune2fs does not show any noticeable difference (both ext_attr
> and Hurd OS type are set).

Indeed, I looked at that too.  This may be so obvious once we find it...

Janneke

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




^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd.
  2020-05-24 18:40   ` Jan Nieuwenhuizen
@ 2020-05-25 15:46     ` Jan Nieuwenhuizen
  0 siblings, 0 replies; 48+ messages in thread
From: Jan Nieuwenhuizen @ 2020-05-25 15:46 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: Ludovic Courtès, 41350

Jan Nieuwenhuizen writes:

Hello Mathieu, Ludo',

>>> The most interesting differences I see are wrt Grub, e.g.
>>>
>>> -/mnt/boot/grub/fonts
>>> -/mnt/boot/grub/fonts/unicode.pf2
>>>
>>> could that still play a role?  I'm having a look why this could be missing.
>>
>> It's because I just copy "lib/grub" folder in (gnu bootloader grub). I
>> should also do that for the fonts I guess. But I doubt the issue comes
>> from here.
>
> Meanwhile I tried adding that by hand; indeed that's not it.

As discussed on IRC (thanks!!), I bisected it down to a problem with the
file /servers/exec.  I suspected translator magic...but luckily Ludo
insisted he thinks that /servers/exec only needs to exist.

So, using current wip-hurd-vm, I tried this script:

--8<---------------cut here---------------start------------->8---
set -ex
cp -f $(./pre-inst-env guix system disk-image --no-grafts --target=i586-pc-gnu gnu/system/examples/bare-hurd.tmpl) /tmp/disk-image.img
sudo losetup -P /dev/loop0 /tmp/disk-image.img
sudo mount /dev/loop0p1 /mnt
ls -l /mnt/servers/exec
sudo rm -f /mnt/servers/exec
sudo touch /mnt/servers/exec
ls -l /mnt/servers/exec
sudo umount /mnt
sudo losetup -d /dev/loop0
--8<---------------cut here---------------end--------------->8---

...which indeed produces a working VM!

Turns out that creating /servers/exec in the store gets
hard-linked/deduplicated or something...look:

--8<---------------cut here---------------start------------->8---
+ ls -l /mnt/servers/exec
-r--r--r-- 17 root root 0 Jan  1  1970 /mnt/servers/exec
+ sudo rm -f /mnt/servers/exec
+ sudo touch /mnt/servers/exec
+ ls -l /mnt/servers/exec
-rw-r--r-- 1 root root 0 May 25 17:16 /mnt/servers/exec
--8<---------------cut here---------------end--------------->8---

The "fix" is just going from 17 to 1 link.  Doh'

So, another "fix" is the diff below but I did not want to commit and
push that yet.  Can we prevent creation of hard links in another way?

Greetings,
Janneke


$ git diff
diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm
index 7dd509d0d9..dfad83aa05 100644
--- a/gnu/build/linux-boot.scm
+++ b/gnu/build/linux-boot.scm
@@ -337,6 +337,7 @@ one specific hardware device. These we have to create."
   (for-each (lambda (file)
               (call-with-output-file (scope file)
                 (lambda (port)
+                  (display file port)   ;hack to avoid hard-linking
                   (chmod port #o666))))
             '("dev/null"
               "dev/zero"
@@ -350,6 +351,7 @@ one specific hardware device. These we have to create."
   (for-each (lambda (file)
               (call-with-output-file (scope (string-append "servers/" file))
                 (lambda (port)
+                  (display file port)   ;hack to avoid hard-linking
                   (chmod port #o444))))
             '("startup"
               "exec"


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




^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH v3 1/3] utils: Move 'reset-timestamps' out of database.
  2020-05-23  9:30 ` [bug#41350] [PATCH v3 1/3] utils: Move 'reset-timestamps' out of database Jan (janneke) Nieuwenhuizen
  2020-05-23  9:30   ` [bug#41350] [PATCH v3 2/3] system: vm: Do not register-closures when cross-building to the Hurd Jan (janneke) Nieuwenhuizen
  2020-05-23  9:30   ` [bug#41350] [PATCH v3 3/3] system: vm: Build vm-image using native qemu, for " Jan (janneke) Nieuwenhuizen
@ 2020-05-27  8:43   ` Ludovic Courtès
  2020-05-27  8:59     ` Ludovic Courtès
  2020-05-27  9:10     ` Jan Nieuwenhuizen
  2 siblings, 2 replies; 48+ messages in thread
From: Ludovic Courtès @ 2020-05-27  8:43 UTC (permalink / raw)
  To: Jan (janneke) Nieuwenhuizen; +Cc: 41350

Hi!

"Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:

> This supports calling reset-timestamps without loading sqlite3.
>
> * guix/store/database.scm (reset-timestamps): Move to...
> * guix/utils.scm (reset-timestamps): ... here.
> * gnu/build/vm.scm: Include it.

Please open different issues for different patch series so that each one
is visible.  :-)

> --- a/gnu/build/vm.scm
> +++ b/gnu/build/vm.scm
> @@ -26,6 +26,7 @@
>    #:use-module (guix build utils)
>    #:use-module (guix build store-copy)
>    #:use-module (guix build syscalls)
> +  #:use-module ((guix utils) #:select (reset-timestamps))

We shouldn’t include (guix utils) on the build side because it pulls in
the host (guix config), which is bad because it’s user-specific:

--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> ,use(guix modules)
scheme@(guile-user)> ,pp (source-module-closure '((guix utils)))
$7 = ((guix utils)
 (guix config)
 (guix memoization)
 (guix profiling)
 (guix build utils)
 (guix build syscalls))
--8<---------------cut here---------------end--------------->8---

Or we have to remember to do the ((guix config) => ,(make-config.scm))
dance.

What’s the problem with loading sqlite3?

Thanks,
Ludo’.




^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH v3 2/3] system: vm: Do not register-closures when cross-building to the Hurd.
  2020-05-23  9:30   ` [bug#41350] [PATCH v3 2/3] system: vm: Do not register-closures when cross-building to the Hurd Jan (janneke) Nieuwenhuizen
@ 2020-05-27  8:45     ` Ludovic Courtès
  2020-05-27  9:13       ` Jan Nieuwenhuizen
  0 siblings, 1 reply; 48+ messages in thread
From: Ludovic Courtès @ 2020-05-27  8:45 UTC (permalink / raw)
  To: Jan (janneke) Nieuwenhuizen; +Cc: 41350

"Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:

> This supports cross-building building a vm-image for the Hurd, running a
> native qemu.
>
> * gnu/system/vm.scm (qemu-image)[register-closures?]: Default to #f when
> cross-compiling to the Hurd.  Only create sql-schema when actually registering
> closures.

[...]

> -                     (register-closures? (has-guix-service-type? os))
> +                     (register-closures? (and (has-guix-service-type? os)
> +                                              (not (hurd-target?))))

What’s the problem here?  (Sorry if I missed earlier discussions!)

Intuitively, I think there shouldn’t be system-specific bits here:
registering closures has nothing to do with the OS we’re targeting.

Thanks,
Ludo’.




^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH v3 1/3] utils: Move 'reset-timestamps' out of database.
  2020-05-27  8:43   ` [bug#41350] [PATCH v3 1/3] utils: Move 'reset-timestamps' out of database Ludovic Courtès
@ 2020-05-27  8:59     ` Ludovic Courtès
  2020-05-27  9:10     ` Jan Nieuwenhuizen
  1 sibling, 0 replies; 48+ messages in thread
From: Ludovic Courtès @ 2020-05-27  8:59 UTC (permalink / raw)
  To: Jan (janneke) Nieuwenhuizen; +Cc: 41350

Ludovic Courtès <ludo@gnu.org> skribis:

> Please open different issues for different patch series so that each one
> is visible.  :-)

Silly me, forget about that, I was just confused.  Apologies!

/me goes back to the beginning of the thread…




^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH v3 1/3] utils: Move 'reset-timestamps' out of database.
  2020-05-27  8:43   ` [bug#41350] [PATCH v3 1/3] utils: Move 'reset-timestamps' out of database Ludovic Courtès
  2020-05-27  8:59     ` Ludovic Courtès
@ 2020-05-27  9:10     ` Jan Nieuwenhuizen
  1 sibling, 0 replies; 48+ messages in thread
From: Jan Nieuwenhuizen @ 2020-05-27  9:10 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 41350

Ludovic Courtès writes:

Hi!

> "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:
>
>> This supports calling reset-timestamps without loading sqlite3.
>>
>> * guix/store/database.scm (reset-timestamps): Move to...
>> * guix/utils.scm (reset-timestamps): ... here.
>> * gnu/build/vm.scm: Include it.
>
> Please open different issues for different patch series so that each one
> is visible.  :-)

Okay...yes this "grew" out of the wip-hurd-vm => qemu-cross => etc. :-/

>> --- a/gnu/build/vm.scm
>> +++ b/gnu/build/vm.scm
>> @@ -26,6 +26,7 @@
>>    #:use-module (guix build utils)
>>    #:use-module (guix build store-copy)
>>    #:use-module (guix build syscalls)
>> +  #:use-module ((guix utils) #:select (reset-timestamps))
>
> We shouldn’t include (guix utils) on the build side because it pulls in
> the host (guix config), which is bad because it’s user-specific:
>
> scheme@(guile-user)> ,use(guix modules)
> scheme@(guile-user)> ,pp (source-module-closure '((guix utils)))
> $7 = ((guix utils)
>  (guix config)
>  (guix memoization)
>  (guix profiling)
>  (guix build utils)
>  (guix build syscalls))

Oh, crap!

> Or we have to remember to do the ((guix config) => ,(make-config.scm))
> dance.
>
> What’s the problem with loading sqlite3?

When running a native qemu-image with cross-built content, any .GO files
for TARGET are skipped and .SCM load fine, except for sqlite.  It fails
trying to load the sqlite3.so

Greetings,
Janneke

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




^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH v3 2/3] system: vm: Do not register-closures when cross-building to the Hurd.
  2020-05-27  8:45     ` Ludovic Courtès
@ 2020-05-27  9:13       ` Jan Nieuwenhuizen
  0 siblings, 0 replies; 48+ messages in thread
From: Jan Nieuwenhuizen @ 2020-05-27  9:13 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 41350

Ludovic Courtès writes:

> "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:
>
>> This supports cross-building building a vm-image for the Hurd, running a
>> native qemu.
>>
>> * gnu/system/vm.scm (qemu-image)[register-closures?]: Default to #f when
>> cross-compiling to the Hurd.  Only create sql-schema when actually registering
>> closures.
>
> [...]
>
>> -                     (register-closures? (has-guix-service-type? os))
>> +                     (register-closures? (and (has-guix-service-type? os)
>> +                                              (not (hurd-target?))))
>
> What’s the problem here?  (Sorry if I missed earlier discussions!)

register-closures is being done inside the VM and needs sqlite, which we
don't have because it's for the wrong architecture.  So as long as we
avoid sqlite, we can cross-build a working VM.

> Intuitively, I think there shouldn’t be system-specific bits here:
> registering closures has nothing to do with the OS we’re targeting.

True...but currently Hurd is the only image that we are trying to build
in this weird way, i.e., using a native qemu!  Other cross-builds of
vm-images are done using qemu-TARGET, only for the Hurd that does
not work.

Greetings,
Janneke

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




^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd.
  2020-05-24  9:18             ` Mathieu Othacehe
@ 2020-05-27  9:30               ` Ludovic Courtès
  2020-05-28  7:00                 ` Mathieu Othacehe
  0 siblings, 1 reply; 48+ messages in thread
From: Ludovic Courtès @ 2020-05-27  9:30 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: 41350, Jan Nieuwenhuizen

Hi!

Mathieu Othacehe <othacehe@gnu.org> skribis:

>>     guix system: error: gnu/packages/glib.scm:406:2: gobject-introspection@1.62.0: build system `meson' does not support cross builds
>>
>> Do you see that too?
>
> Yes, same issue. When grafting is enabled, we try to cross-built the
> native extension "guile-rsvg" in (gnu bootloader grub).
>
> Taking inspiration from f52fbf709, I tried:
>
> diff --git a/guix/packages.scm b/guix/packages.scm
> index 3d9988d836..e74ac882cb 100644
> --- a/guix/packages.scm
> +++ b/guix/packages.scm
> @@ -1276,13 +1276,14 @@ to (see 'graft-derivation'.)"
>    (define target (bag-target bag))
>  
>    (define native-grafts
> -    (let ((->graft (input-graft store system)))
> -      (fold-bag-dependencies (lambda (package grafts)
> -                               (match (->graft package)
> -                                 (#f    grafts)
> -                                 (graft (cons graft grafts))))
> -                             '()
> -                             bag)))
> +    (parameterize ((%current-target-system target))
> +      (let ((->graft (input-graft store system)))
> +        (fold-bag-dependencies (lambda (package grafts)
> +                                 (match (->graft package)
> +                                   (#f    grafts)
> +                                   (graft (cons graft grafts))))
> +                               '()
> +                               bag))))
>
>  
> which, by pure luck, fixes the issue for me. Maybe, I should also do
> that for "target-grafts". Ludo, WDYT?

Could you boil the problem down to a “guix build --target” command?

I’d like to make sure we understand the issue so we can add a test when
we fix it.

Thanks,
Ludo’.




^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd.
  2020-05-22 19:24 ` Mathieu Othacehe
@ 2020-05-27 22:54   ` Ludovic Courtès
  2020-05-28  6:36     ` Mathieu Othacehe
  0 siblings, 1 reply; 48+ messages in thread
From: Ludovic Courtès @ 2020-05-27 22:54 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: 41350, Jan (janneke) Nieuwenhuizen

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

Hi!

Mathieu Othacehe <othacehe@gnu.org> skribis:

>>   1. When cross-compiling, can the ‘qemu-image’ procedure to its job by
>>      running exclusively native software (in particular using a native
>>      QEMU, native kernel, etc.)?
>
> I think the answer is yes, but I raised a concern about being able to
> run grub-install from an ARM system to build a cross-compiled x86-64
> system (for instance).
>
> For now, running this command shows:
>
> ls $(guix build --system=aarch64-linux grub)/lib/grub/
> arm64-efi
>
> So, the native aarch64-linux is only able to install itself on the same
> system. I think can be fixed though (same as for grub-hybrid package).
>
>> As for (2), I’d say that when cross-compiling, it should just run native
>> software but simply preserve references to cross-compiled software,
>> which is what janneke’s patch does.
>
> Yes, I agree.

So it took me the whole day, but I ended up with the following patches
addressing these two points.  With that on master, I can do:

  guix system vm --target=arm-linux-gnueabihf --no-grafts \
    gnu/system/examples/bare-bones.tmpl

and get a usable script that spawns an ARM VM (I still need to add ‘-M
virt -nographic’ and remove ‘-enable-kvm’, but that’s a secondary
issue.)

Likewise, this produces what looks like a valid image, except probably
for the bootloader (I used GRUB in bare-bones, which didn’t complain,
but the result doesn’t work):

  guix system vm-image --target=arm-linux-gnueabihf …

Thoughts?

I’ll see if I can test it with ‘wip-hurd-vm’ on top but I’m not sure
I’ll do it before the week-end.

> However, I think I found a way to install Grub, without root
> permissions, from the host system (see:
> https://lists.gnu.org/archive/html/guix-patches/2020-05/msg00988.html).

Yay!

> This should allow to deprecate the whole (gnu system vm) module.

Yeah, using the new image API will be nicer.  We still need to keep some
of the API in (guix system vm), at least for the ‘guix system vm’
command.

Thanks,
Ludo’.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-system-system-linux-image-file-name-takes-an-optiona.patch --]
[-- Type: text/x-patch, Size: 1704 bytes --]

From 1ccd6f8e853be17fa4ec244a660fa53ffcec979f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>
Date: Wed, 27 May 2020 17:40:14 +0200
Subject: [PATCH 1/7] system: 'system-linux-image-file-name' takes an optional
 parameter.

* gnu/system.scm (system-linux-image-file-name): Make 'target' an
optional parameter.
---
 gnu/system.scm | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/gnu/system.scm b/gnu/system.scm
index d929187695..ab0a6dfc33 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -466,15 +466,15 @@ from the initrd."
   "Return the list of swap services for OS."
   (map swap-service (operating-system-swap-devices os)))
 
-(define* (system-linux-image-file-name)
-  "Return the basename of the kernel image file for SYSTEM."
-  ;; FIXME: Evaluate the conditional based on the actual current system.
-  (let ((target (or (%current-target-system) (%current-system))))
-    (cond
-     ((string-prefix? "arm" target) "zImage")
-     ((string-prefix? "mips" target) "vmlinuz")
-     ((string-prefix? "aarch64" target) "Image")
-     (else "bzImage"))))
+(define* (system-linux-image-file-name #:optional
+                                       (target (or (%current-target-system)
+                                                   (%current-system))))
+  "Return the basename of the kernel image file for TARGET."
+  (cond
+   ((string-prefix? "arm" target) "zImage")
+   ((string-prefix? "mips" target) "vmlinuz")
+   ((string-prefix? "aarch64" target) "Image")
+   (else "bzImage")))
 
 (define (operating-system-kernel-file os)
   "Return an object representing the absolute file name of the kernel image of
-- 
2.26.2


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-vm-expression-derivation-in-linux-vm-always-returns-.patch --]
[-- Type: text/x-patch, Size: 4672 bytes --]

From 56d8d921199bfdf151d899639052f579f24fdd00 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>
Date: Wed, 27 May 2020 23:04:48 +0200
Subject: [PATCH 2/7] vm: 'expression->derivation-in-linux-vm' always returns a
 native build.

* gnu/system/vm.scm (expression->derivation-in-linux-vm): Remove #:target.
[builder]: Use #+.  Don't pass #:target-arm32? and #:target-aarch64? to
'load-in-linux-vm'.
Pass #:target #f to 'gexp->derivation'.
(qemu-image): Adjust accordingly.
* gnu/build/vm.scm (load-in-linux-vm): Remove #:target-aarch64?
and #:target-arm32?.  Define them as local variables.
---
 gnu/build/vm.scm  | 11 ++++++++---
 gnu/system/vm.scm | 16 +++++++---------
 2 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm
index 433b5a7e8d..0f0ceae18f 100644
--- a/gnu/build/vm.scm
+++ b/gnu/build/vm.scm
@@ -84,8 +84,6 @@
                            linux initrd
                            make-disk-image?
                            single-file-output?
-                           target-arm32?
-                           target-aarch64?
                            (disk-image-size (* 100 (expt 2 20)))
                            (disk-image-format "qcow2")
                            (references-graphs '()))
@@ -101,7 +99,14 @@ access it via /dev/hda.
 REFERENCES-GRAPHS can specify a list of reference-graph files as produced by
 the #:references-graphs parameter of 'derivation'."
 
-  (define target-arm? (or target-arm32? target-aarch64?))
+  (define target-arm32?
+    (string-prefix? "arm-" %host-type))
+
+  (define target-aarch64?
+    (string-prefix? "aarch64-" %host-type))
+
+  (define target-arm?
+    (or target-arm32? target-aarch64?))
 
   (define arch-specific-flags
     `(;; On ARM, a machine has to be specified. Use "virt" machine to avoid
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index 3e483fd86c..d737a5e4ec 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -141,7 +141,7 @@
 
 (define* (expression->derivation-in-linux-vm name exp
                                              #:key
-                                             (system (%current-system)) target
+                                             (system (%current-system))
                                              (linux linux-libre)
                                              initrd
                                              (qemu qemu-minimal)
@@ -226,10 +226,11 @@ substitutable."
 
               (let* ((native-inputs
                       '#+(list qemu (canonical-package coreutils)))
-                     (linux   (string-append #$linux "/"
-                                             #$(system-linux-image-file-name)))
-                     (initrd  #$initrd)
-                     (loader  #$loader)
+                     (linux   (string-append
+                               #+linux "/"
+                               #+(system-linux-image-file-name system)))
+                     (initrd  #+initrd)
+                     (loader  #+loader)
                      (graphs  '#$(match references-graphs
                                    (((graph-files . _) ...) graph-files)
                                    (_ #f)))
@@ -249,8 +250,6 @@ substitutable."
                                   #:memory-size #$memory-size
                                   #:make-disk-image? #$make-disk-image?
                                   #:single-file-output? #$single-file-output?
-                                  #:target-arm32? #$(check target-arm32?)
-                                  #:target-aarch64? #$(check target-aarch64?)
                                   #:disk-image-format #$disk-image-format
                                   #:disk-image-size size
                                   #:references-graphs graphs))))))
@@ -258,7 +257,7 @@ substitutable."
     (gexp->derivation name builder
                       ;; TODO: Require the "kvm" feature.
                       #:system system
-                      #:target target
+                      #:target #f             ;EXP is always executed natively
                       #:env-vars env-vars
                       #:guile-for-build guile-for-build
                       #:references-graphs references-graphs
@@ -430,7 +429,6 @@ system that is passed to 'populate-root-file-system'."
                                      #:bootloader-installer
                                      #$(bootloader-installer bootloader)))))))
    #:system system
-   #:target target
    #:make-disk-image? #t
    #:disk-image-size disk-image-size
    #:disk-image-format disk-image-format
-- 
2.26.2


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: 0003-vm-qemu-image-uses-the-native-partitioning-tools-and.patch --]
[-- Type: text/x-patch, Size: 1879 bytes --]

From a2b70d97aa80f70cba56d419470ee8d2221dcc1e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>
Date: Wed, 27 May 2020 23:08:15 +0200
Subject: [PATCH 3/7] vm: 'qemu-image' uses the native partitioning tools and
 bootloader.

* gnu/system/vm.scm (qemu-image): Use #+ for Parted, the bootloader, etc.
---
 gnu/system/vm.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index d737a5e4ec..c7767db9df 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -345,7 +345,7 @@ system that is passed to 'populate-root-file-system'."
            (setlocale LC_ALL "en_US.utf8")
 
            (let ((inputs
-                  '#$(append (list parted e2fsprogs dosfstools)
+                  '#+(append (list parted e2fsprogs dosfstools)
                              (map canonical-package
                                   (list sed grep coreutils findutils gawk))))
 
@@ -422,12 +422,12 @@ system that is passed to 'populate-root-file-system'."
                                      #:partitions partitions
                                      #:grub-efi grub-efi
                                      #:bootloader-package
-                                     #$(bootloader-package bootloader)
+                                     #+(bootloader-package bootloader)
                                      #:bootcfg #$bootcfg-drv
                                      #:bootcfg-location
                                      #$(bootloader-configuration-file bootloader)
                                      #:bootloader-installer
-                                     #$(bootloader-installer bootloader)))))))
+                                     #+(bootloader-installer bootloader)))))))
    #:system system
    #:make-disk-image? #t
    #:disk-image-size disk-image-size
-- 
2.26.2


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #5: 0004-vm-qemu-image-preserves-the-cross-compilation-target.patch --]
[-- Type: text/x-patch, Size: 3229 bytes --]

From db7a12bf54585c8979602956a03fbb6502381dcd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>
Date: Thu, 28 May 2020 00:37:33 +0200
Subject: [PATCH 4/7] vm: 'qemu-image' preserves the cross-compilation target
 of the OS.

* gnu/system/vm.scm (qemu-image)[preserve-target, inputs*]: New variables.
In gexp, use INPUTS* instead of INPUTS.  Wrap OS and BOOTCFG-DRV in
'preserve-target'.  Pass INPUTS* instead of INPUTS as the #:references-graphs.
---
 gnu/system/vm.scm | 23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index c7767db9df..991ea2d837 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -317,6 +317,21 @@ system that is passed to 'populate-root-file-system'."
          (local-file (search-path %load-path
                                   "guix/store/schema.sql"))))
 
+  (define preserve-target
+    (if target
+        (lambda (obj)
+          (with-parameters ((%current-target-system target))
+            obj))
+        identity))
+
+  (define inputs*
+    (map (match-lambda
+           ((name thing)
+            `(,name ,(preserve-target thing)))
+           ((name thing output)
+            `(,name ,(preserve-target thing) ,output)))
+         inputs))
+
   (expression->derivation-in-linux-vm
    name
    (with-extensions gcrypt-sqlite3&co
@@ -355,7 +370,7 @@ system that is passed to 'populate-root-file-system'."
                   '#$(map (match-lambda
                             ((name thing) thing)
                             ((name thing output) `(,thing ,output)))
-                          inputs)))
+                          inputs*)))
 
              (set-path-environment-variable "PATH" '("bin" "sbin") inputs)
 
@@ -367,7 +382,7 @@ system that is passed to 'populate-root-file-system'."
                                  #:closures graphs
                                  #:copy-closures? #$copy-inputs?
                                  #:register-closures? #$register-closures?
-                                 #:system-directory #$os
+                                 #:system-directory #$(preserve-target os)
 
                                  #:make-device-nodes
                                  #$(match device-nodes
@@ -423,7 +438,7 @@ system that is passed to 'populate-root-file-system'."
                                      #:grub-efi grub-efi
                                      #:bootloader-package
                                      #+(bootloader-package bootloader)
-                                     #:bootcfg #$bootcfg-drv
+                                     #:bootcfg #$(preserve-target bootcfg-drv)
                                      #:bootcfg-location
                                      #$(bootloader-configuration-file bootloader)
                                      #:bootloader-installer
@@ -432,7 +447,7 @@ system that is passed to 'populate-root-file-system'."
    #:make-disk-image? #t
    #:disk-image-size disk-image-size
    #:disk-image-format disk-image-format
-   #:references-graphs inputs
+   #:references-graphs inputs*
    #:substitutable? substitutable?))
 
 (define* (system-docker-image os
-- 
2.26.2


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #6: 0005-vm-virtual-machine-compiler-honors-system-and-target.patch --]
[-- Type: text/x-patch, Size: 3907 bytes --]

From a9270c1261b747dc9a82b52d1ce38314862c51cd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>
Date: Wed, 27 May 2020 23:09:49 +0200
Subject: [PATCH 5/7] vm: <virtual-machine> compiler honors system and target.

* gnu/system/vm.scm (system-qemu-image/shared-store): Add #:system
and #:target.  Pass it down.
(system-qemu-image/shared-store-script): Likewise.
(virtual-machine-compiler): Likewise.
---
 gnu/system/vm.scm | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index 991ea2d837..05f3986aca 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -764,6 +764,8 @@ environment with the store shared with the host.  MAPPINGS is a list of
 (define* (system-qemu-image/shared-store
           os
           #:key
+          (system (%current-system))
+          (target (%current-target-system))
           full-boot?
           (disk-image-size (* (if full-boot? 500 30) (expt 2 20))))
   "Return a derivation that builds a QEMU image of OS that shares its store
@@ -784,6 +786,8 @@ bootloader refers to: OS kernel, initrd, bootloader data, etc."
   ;; This is more than needed (we only need the kernel, initrd, GRUB for its
   ;; font, and the background image), but it's hard to filter that.
   (qemu-image #:os os
+              #:system system
+              #:target target
               #:bootcfg-drv bootcfg
               #:bootloader (bootloader-configuration-bootloader
                             (operating-system-bootloader os))
@@ -824,6 +828,8 @@ with '-virtfs' options for the host file systems listed in SHARED-FS."
 
 (define* (system-qemu-image/shared-store-script os
                                                 #:key
+                                                (system (%current-system))
+                                                (target (%current-target-system))
                                                 (qemu qemu)
                                                 (graphic? #t)
                                                 (memory-size 256)
@@ -847,6 +853,8 @@ it is mostly useful when FULL-BOOT?  is true."
   (mlet* %store-monad ((os ->  (virtualized-operating-system os mappings full-boot?))
                        (image  (system-qemu-image/shared-store
                                 os
+                                #:system system
+                                #:target target
                                 #:full-boot? full-boot?
                                 #:disk-image-size disk-image-size)))
     (define kernel-arguments
@@ -920,10 +928,11 @@ FORWARDINGS is a list of host-port/guest-port pairs."
 
 (define-gexp-compiler (virtual-machine-compiler (vm <virtual-machine>)
                                                 system target)
-  ;; XXX: SYSTEM and TARGET are ignored.
   (match vm
     (($ <virtual-machine> os qemu graphic? memory-size disk-image-size ())
      (system-qemu-image/shared-store-script os
+                                            #:system system
+                                            #:target target
                                             #:qemu qemu
                                             #:graphic? graphic?
                                             #:memory-size memory-size
@@ -936,6 +945,8 @@ FORWARDINGS is a list of host-port/guest-port pairs."
                        "user,model=virtio-net-pci,"
                        (port-forwardings->qemu-options forwardings)))))
        (system-qemu-image/shared-store-script os
+                                              #:system system
+                                              #:target target
                                               #:qemu qemu
                                               #:graphic? graphic?
                                               #:memory-size memory-size
-- 
2.26.2


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #7: 0006-vm-Shared-store-script-runs-that-native-QEMU-and-Bas.patch --]
[-- Type: text/x-patch, Size: 1422 bytes --]

From dc3f04a9f412045a85ac810f9436648368c36adc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>
Date: Wed, 27 May 2020 23:11:14 +0200
Subject: [PATCH 6/7] vm: Shared-store script runs that native QEMU and Bash.

* gnu/system/vm.scm (system-qemu-image/shared-store-script): Use #+ for
QEMU and BASH.
---
 gnu/system/vm.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index 05f3986aca..038cce19b6 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -862,7 +862,8 @@ it is mostly useful when FULL-BOOT?  is true."
               #+@(operating-system-kernel-arguments os "/dev/vda1")))
 
     (define qemu-exec
-      #~(list (string-append #$qemu "/bin/" #$(qemu-command (%current-system)))
+      #~(list #+(file-append qemu "/bin/"
+                             (qemu-command (or target system)))
               #$@(if full-boot?
                      #~()
                      #~("-kernel" #$(operating-system-kernel-file os)
@@ -879,7 +880,7 @@ it is mostly useful when FULL-BOOT?  is true."
       #~(call-with-output-file #$output
           (lambda (port)
             (format port "#!~a~% exec ~a \"$@\"~%"
-                    #$(file-append bash "/bin/sh")
+                    #+(file-append bash "/bin/sh")
                     (string-join #$qemu-exec " "))
             (chmod port #o555))))
 
-- 
2.26.2


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #8: 0007-gnu-guile-static-Disable-JIT-on-ARMv7.patch --]
[-- Type: text/x-patch, Size: 1281 bytes --]

From 6e936131ca85aba24f82d35c4616afe835ac7da5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>
Date: Wed, 27 May 2020 23:57:41 +0200
Subject: [PATCH 7/7] gnu: guile-static: Disable JIT on ARMv7.

* gnu/packages/make-bootstrap.scm (make-guile-static): Pass
"--disable-jit" when 'target-arm32?' is true.
---
 gnu/packages/make-bootstrap.scm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm
index fe86f810bf..b2d3e2a326 100644
--- a/gnu/packages/make-bootstrap.scm
+++ b/gnu/packages/make-bootstrap.scm
@@ -706,7 +706,12 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
           ;; When `configure' checks for ltdl availability, it
           ;; doesn't try to link using libtool, and thus fails
           ;; because of a missing -ldl.  Work around that.
-          ''("LDFLAGS=-ldl"))
+
+          ;; XXX: On ARMv7, disable JIT: it causes crashes with 3.0.2,
+          ;; possibly related to <https://bugs.gnu.org/40737>.
+          (if (target-arm32?)
+              ''("LDFLAGS=-ldl" "--disable-jit")
+              ''("LDFLAGS=-ldl")))
          ((#:phases phases '%standard-phases)
           `(modify-phases ,phases
 
-- 
2.26.2


^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd.
  2020-05-27 22:54   ` Ludovic Courtès
@ 2020-05-28  6:36     ` Mathieu Othacehe
  2020-05-28 12:29       ` Jan Nieuwenhuizen
  0 siblings, 1 reply; 48+ messages in thread
From: Mathieu Othacehe @ 2020-05-28  6:36 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 41350, Jan (janneke) Nieuwenhuizen

> So it took me the whole day, but I ended up with the following patches

Hey Ludo,

> addressing these two points.  With that on master, I can do:
>
>   guix system vm --target=arm-linux-gnueabihf --no-grafts \
>     gnu/system/examples/bare-bones.tmpl

Nice! Many thanks for helping us on that :)

> Likewise, this produces what looks like a valid image, except probably
> for the bootloader (I used GRUB in bare-bones, which didn’t complain,
> but the result doesn’t work):
>
>   guix system vm-image --target=arm-linux-gnueabihf …
>
> Thoughts?

qemu-system-arm supports a whole range of machine. You can type:

--8<---------------cut here---------------start------------->8---
qemu-system-arm -M machine help
--8<---------------cut here---------------end--------------->8---

for the complete list. Depending on the selected machine, the required
bootloader differs. For the "virt" machine, it seems that we could pass
the bootloader as Qemu "bios" argument[1], but I'm not sure we can do
much better.

> Yeah, using the new image API will be nicer.  We still need to keep some
> of the API in (guix system vm), at least for the ‘guix system vm’
> command.

Yes, you are right.

> From 6e936131ca85aba24f82d35c4616afe835ac7da5 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>
> Date: Wed, 27 May 2020 23:57:41 +0200
> Subject: [PATCH 7/7] gnu: guile-static: Disable JIT on ARMv7.

The whole serie LGTM. It's nice to have cross-compilation working for
both disk-images and vm-images!

Mathieu

[1]:
https://github.com/ARM-software/u-boot/blob/master/doc/README.qemu-arm




^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd.
  2020-05-27  9:30               ` Ludovic Courtès
@ 2020-05-28  7:00                 ` Mathieu Othacehe
  0 siblings, 0 replies; 48+ messages in thread
From: Mathieu Othacehe @ 2020-05-28  7:00 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 41350, Jan Nieuwenhuizen


Hey Ludo,

> Could you boil the problem down to a “guix build --target” command?

No, but I just found a small reproducer:

--8<---------------cut here---------------start------------->8---
(use-modules (gnu)
             (gnu packages gtk)
             (guix)
             (guix store))

(run-with-store (open-connection)
  (mlet* %store-monad ((target (set-current-target "aarch64-linux-gnu"))
                       (drv (lower-object
                             (computed-file "test"
                                            #~(begin
                                                (mkdir #$output)
                                                #+guile-rsvg))))
                       (out -> (derivation->output-path drv)))
    (mbegin %store-monad
      (built-derivations (list drv))
      (return out))))
--8<---------------cut here---------------end--------------->8---

This should fail with:

--8<---------------cut here---------------start------------->8---
In guix/packages.scm:
  1072:16  5 (package-derivation _ #<package guile-rsvg@2.18.1-0.05…> …)
  1393:16  4 (thunk)
   1280:6  3 (bag-grafts #<store-connection 256.99 7f484d450780> #<<…>)
  1260:45  2 (fold-bag-dependencies #<procedure 7f484b8bd5e0 at gui…> …)
  1072:16  1 (package->bag _ _ _ #:graft? _)
  1183:21  0 (thunk)

guix/packages.scm:1183:21: In procedure thunk:
ERROR:
  1. &package-cross-build-system-error: #<package gobject-introspection@1.62.0 gnu/packages/glib.scm:406 7f48407ec460>
--8<---------------cut here---------------end--------------->8---

Thanks,

Mathieu




^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd.
  2020-05-28  6:36     ` Mathieu Othacehe
@ 2020-05-28 12:29       ` Jan Nieuwenhuizen
  2020-05-28 15:39         ` Ludovic Courtès
  0 siblings, 1 reply; 48+ messages in thread
From: Jan Nieuwenhuizen @ 2020-05-28 12:29 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: Ludovic Courtès, 41350

Mathieu Othacehe writes:

Hello!

>> So it took me the whole day, but I ended up with the following patches
>
> Hey Ludo,

Thanks so much for helping out!

>> addressing these two points.  With that on master, I can do:
>>
>>   guix system vm --target=arm-linux-gnueabihf --no-grafts \
>>     gnu/system/examples/bare-bones.tmpl
>
> Nice! Many thanks for helping us on that :)

+1

>> Likewise, this produces what looks like a valid image, except probably
>> for the bootloader (I used GRUB in bare-bones, which didn’t complain,
>> but the result doesn’t work):
>>
>>   guix system vm-image --target=arm-linux-gnueabihf …
>>
>> Thoughts?

I have locally rebased wip-hurd-vm and wip-disk-image (working title for
wip-hurd-vm minus vm-image support) on it: it looks nice and works for
me building a disk-impage.

Building a vm-image still needs quite some work: I tried building a
vm-image without hurd-specific vm-image patches (bisecting a bit:
register-closures/grub/qemu-image preserve-target stuff)...but in the
end I still needed all these

--8<---------------cut here---------------start------------->8---
0547e4c251 * wip-hurd-vm system: vm: Activate the Hurd.
8c28ab91a5 * system: vm: Initial vm-image support for the Hurd.
d9b84d03bc * system: vm: Add defaults for the Hurd.
29281d053f * system: vm: Build vm-image using native qemu, for the Hurd.
86edea90c4 * system: vm: Do not register-closures when cross-building to the Hurd.
a29437ad82 * utils: Move 'reset-timestamps' out of database.
--8<---------------cut here---------------end--------------->8---

(especially the "using native qemu" patch was greatly reduced now)
as well as --no-grafts to get a vm-image.

So..as discussed on IRC yesterday I'm voting to drop/pause the vm-image
work for the Hurd and reset wip-hurd-vm to my current gitlab
wip-hurd-disk (or possibly push wip-hurd-disk...)  WDYT?

>> From 6e936131ca85aba24f82d35c4616afe835ac7da5 Mon Sep 17 00:00:00 2001
>> From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>
>> Date: Wed, 27 May 2020 23:57:41 +0200
>> Subject: [PATCH 7/7] gnu: guile-static: Disable JIT on ARMv7.
>
> The whole serie LGTM. It's nice to have cross-compilation working for
> both disk-images and vm-images!

I agree...although as noted above: how much effort do we want to put in
for the Hurd?

Greetings,
Janneke

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




^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd.
  2020-05-28 12:29       ` Jan Nieuwenhuizen
@ 2020-05-28 15:39         ` Ludovic Courtès
  2020-05-28 17:07           ` Jan Nieuwenhuizen
  2020-05-28 17:10           ` Mathieu Othacehe
  0 siblings, 2 replies; 48+ messages in thread
From: Ludovic Courtès @ 2020-05-28 15:39 UTC (permalink / raw)
  To: Jan Nieuwenhuizen; +Cc: Mathieu Othacehe, 41350

Hi!

Jan Nieuwenhuizen <janneke@gnu.org> skribis:

> Building a vm-image still needs quite some work: I tried building a
> vm-image without hurd-specific vm-image patches (bisecting a bit:
> register-closures/grub/qemu-image preserve-target stuff)...but in the
> end I still needed all these

How does it fail exactly?  (I’ll give it a spin as time permits.)

> So..as discussed on IRC yesterday I'm voting to drop/pause the vm-image
> work for the Hurd and reset wip-hurd-vm to my current gitlab
> wip-hurd-disk (or possibly push wip-hurd-disk...)  WDYT?

Sure, whatever works best!

>>> From 6e936131ca85aba24f82d35c4616afe835ac7da5 Mon Sep 17 00:00:00 2001
>>> From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>
>>> Date: Wed, 27 May 2020 23:57:41 +0200
>>> Subject: [PATCH 7/7] gnu: guile-static: Disable JIT on ARMv7.
>>
>> The whole serie LGTM. It's nice to have cross-compilation working for
>> both disk-images and vm-images!
>
> I agree...although as noted above: how much effort do we want to put in
> for the Hurd?

I was looking at what needs to be fixed there, independently of the
Hurd.

But maybe we can just rebase ‘system-qemu-image’ & co. on top of (gnu
image)?  What prevents us from doing that, Mathieu?

If we can do that, then indeed, there’s no point in insisting on fixing
cross-compilation support in (gnu system vm).

Thanks for your feedback!

Ludo’.




^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd.
  2020-05-28 15:39         ` Ludovic Courtès
@ 2020-05-28 17:07           ` Jan Nieuwenhuizen
  2020-05-28 17:10           ` Mathieu Othacehe
  1 sibling, 0 replies; 48+ messages in thread
From: Jan Nieuwenhuizen @ 2020-05-28 17:07 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Mathieu Othacehe, 41350

Ludovic Courtès writes:

Hello!

> Jan Nieuwenhuizen <janneke@gnu.org> skribis:
>
>> Building a vm-image still needs quite some work: I tried building a
>> vm-image without hurd-specific vm-image patches (bisecting a bit:
>> register-closures/grub/qemu-image preserve-target stuff)...but in the
>> end I still needed all these
>
> How does it fail exactly?  (I’ll give it a spin as time permits.)

As discussed on IRC: same errors as before, mostly (sqlite loading,
meson cross build using --no-grafts, linux build for i586-pc-gnu).

>> So..as discussed on IRC yesterday I'm voting to drop/pause the vm-image
>> work for the Hurd and reset wip-hurd-vm to my current gitlab
>> wip-hurd-disk (or possibly push wip-hurd-disk...)  WDYT?
>
> Sure, whatever works best!

Done!  I have just reset wip-hurd-vm, let the review+merge begin \o/

>>>> From 6e936131ca85aba24f82d35c4616afe835ac7da5 Mon Sep 17 00:00:00 2001
>>>> From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>
>>>> Date: Wed, 27 May 2020 23:57:41 +0200
>>>> Subject: [PATCH 7/7] gnu: guile-static: Disable JIT on ARMv7.
>>>
>>> The whole serie LGTM. It's nice to have cross-compilation working for
>>> both disk-images and vm-images!
>>
>> I agree...although as noted above: how much effort do we want to put in
>> for the Hurd?
>
> I was looking at what needs to be fixed there, independently of the
> Hurd.

Yes, so I kept your commits at the bottom of the new wip-hurd-vm, they
are clean and there's some value in them, I think.

> But maybe we can just rebase ‘system-qemu-image’ & co. on top of (gnu
> image)?  What prevents us from doing that, Mathieu?

+1

> If we can do that, then indeed, there’s no point in insisting on fixing
> cross-compilation support in (gnu system vm).

possibly, modulo s/no/litte/ s/point/urgency/
but yeah.  A bit sad, between us we put quite some effort into that...

Janneke

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




^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd.
  2020-05-28 15:39         ` Ludovic Courtès
  2020-05-28 17:07           ` Jan Nieuwenhuizen
@ 2020-05-28 17:10           ` Mathieu Othacehe
  2020-05-28 18:19             ` Jan Nieuwenhuizen
  2020-05-29  8:18             ` Ludovic Courtès
  1 sibling, 2 replies; 48+ messages in thread
From: Mathieu Othacehe @ 2020-05-28 17:10 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 41350, Jan Nieuwenhuizen


Hey Ludo & Jan,

> But maybe we can just rebase ‘system-qemu-image’ & co. on top of (gnu
> image)?  What prevents us from doing that, Mathieu?
>
> If we can do that, then indeed, there’s no point in insisting on fixing
> cross-compilation support in (gnu system vm).

I think we could proceed that way:

* Merge Ludo's serie on master.

* Then we could review & merge Jan's wip-hurd-disk.

* Finally, there's the wip-hurd-vm. I believe that some of stuff there
is fixed in Ludo's serie. So we would need to rebase it on top of
everything & finally push it.

Do you think that makes sense?

Thanks,

Mathieu




^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd.
  2020-05-28 17:10           ` Mathieu Othacehe
@ 2020-05-28 18:19             ` Jan Nieuwenhuizen
  2020-05-29  8:18             ` Ludovic Courtès
  1 sibling, 0 replies; 48+ messages in thread
From: Jan Nieuwenhuizen @ 2020-05-28 18:19 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: Ludovic Courtès, 41350

Mathieu Othacehe writes:

Hi Mathieu, Ludo

> Hey Ludo & Jan,
>
>> But maybe we can just rebase ‘system-qemu-image’ & co. on top of (gnu
>> image)?  What prevents us from doing that, Mathieu?
>>
>> If we can do that, then indeed, there’s no point in insisting on fixing
>> cross-compilation support in (gnu system vm).
>
> I think we could proceed that way:
>
> * Merge Ludo's serie on master.
>
> * Then we could review & merge Jan's wip-hurd-disk.

Oops, you sent your mail just a few minutes before mine; just reading it
now :-)

I push a fresh wip-hurd-vm, which is the above: wip-hurd-disk rebase
onto Ludo's series...almost the same.

> * Finally, there's the wip-hurd-vm. I believe that some of stuff there
> is fixed in Ludo's serie. So we would need to rebase it on top of
> everything & finally push it.
>
> Do you think that makes sense?

Yes, I think this is more or less my idea too and what I did...except
for leaving my hurd-specific qemu-image/vm-image work rest.

Hope that's OK!
Janneke

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




^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd.
  2020-05-28 17:10           ` Mathieu Othacehe
  2020-05-28 18:19             ` Jan Nieuwenhuizen
@ 2020-05-29  8:18             ` Ludovic Courtès
  2020-05-29  9:06               ` Jan Nieuwenhuizen
  1 sibling, 1 reply; 48+ messages in thread
From: Ludovic Courtès @ 2020-05-29  8:18 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: 41350, Jan Nieuwenhuizen

Hi,

Mathieu Othacehe <othacehe@gnu.org> skribis:

>> But maybe we can just rebase ‘system-qemu-image’ & co. on top of (gnu
>> image)?  What prevents us from doing that, Mathieu?
>>
>> If we can do that, then indeed, there’s no point in insisting on fixing
>> cross-compilation support in (gnu system vm).
>
> I think we could proceed that way:
>
> * Merge Ludo's serie on master.

I think that can wait because on IRC Janneke explained that it doesn’t
fix anything for GNU/Hurd (to my surprise).  So I’ll maybe check again
once the relevant Hurd bits are on master, instead of checking ARM
cross-compilation.

Anyway it’s much less important now that (gnu image) can be used for the
task!

> * Then we could review & merge Jan's wip-hurd-disk.

Do I get it right that we first need
<https://issues.guix.gnu.org/41560>?

The ‘wip-hurd-vm’ branch contains many things:

  1. (gnu system hurd) with the Hurd services etc.

  2. The ‘hurd’ field of <operating-system>.

  3. <menu-entry> with multiboot support.

  4. Hacks to work around vm.scm defects: uses of ‘with-parameters’,
     ‘hurd-target?’, disabling sqlite3, and #~#$ tricks.

I think part of the reason this cycle has been so long is that it’s been
kind of a big bang; big bangs are great because they lead to something
new and exciting, but they’re also intimidating.  :-) For me personally,
looking at all these aspects at once was just too much.

For merging, I think it’d be great to see #1 and #2 as a first step, and
then #3.

I do not want any of #4 :-), because I really think it could lead to
maintenance headaches down the road, which would make the kind of
changes we’re making today practically impossible in the future.

Thoughts?

Ludo’.




^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd.
  2020-05-29  8:18             ` Ludovic Courtès
@ 2020-05-29  9:06               ` Jan Nieuwenhuizen
  2020-05-30 10:08                 ` Jan Nieuwenhuizen
  0 siblings, 1 reply; 48+ messages in thread
From: Jan Nieuwenhuizen @ 2020-05-29  9:06 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Mathieu Othacehe, 41350

Ludovic Courtès writes:

> Hi,
>
> Mathieu Othacehe <othacehe@gnu.org> skribis:
>
>>> But maybe we can just rebase ‘system-qemu-image’ & co. on top of (gnu
>>> image)?  What prevents us from doing that, Mathieu?
>>>
>>> If we can do that, then indeed, there’s no point in insisting on fixing
>>> cross-compilation support in (gnu system vm).
>>
>> I think we could proceed that way:
>>
>> * Merge Ludo's serie on master.
>
> I think that can wait because on IRC Janneke explained that it doesn’t
> fix anything for GNU/Hurd (to my surprise).

Well, that's too black/white.  Of course this:

-                     (linux   (string-append #$linux "/"
-                                             #$(system-linux-image-file-name)))
-                     (initrd  #$initrd)
-                     (loader  #$loader)
+                     (linux   (string-append
+                               #+linux "/"
+                               #+(system-linux-image-file-name system)))
+                     (initrd  #+initrd)
+                     (loader  #+loader)

is an essential fix.  Only, that used to be on wip-hurd-vm -- so from
that perspective this fix only got reviewed and moved.

Pretty similarly for this

+  (define preserve-target
+    (if target
+        (lambda (obj)
+          (with-parameters ((%current-target-system target))
+            obj))
+        identity))

also an essential bit.  So, seen from master it fixes quite some bits!
What I meant to say is that I haven't seen /additional/ fixes to what
we had on wip-hurd-vm...

Because your fixes look clean and don't break anything, I think we
should maybe apply them to master -- and that's why I kept them at
the bottom of "wip-hurd-vm" for now.

> So I’ll maybe check again once the relevant Hurd bits are on master,
> instead of checking ARM cross-compilation.
>
> Anyway it’s much less important now that (gnu image) can be used for the
> task!

Yes, so from the Hurd perspective this patch set has shifted from
top-priority to probably not going to be used for the Hurd ;)

>> * Then we could review & merge Jan's wip-hurd-disk.
>
> Do I get it right that we first need
> <https://issues.guix.gnu.org/41560>?
>
> The ‘wip-hurd-vm’ branch contains many things:
>
>   1. (gnu system hurd) with the Hurd services etc.
>
>   2. The ‘hurd’ field of <operating-system>.
>
>   3. <menu-entry> with multiboot support.

Yes.

>   4. Hacks to work around vm.scm defects: uses of ‘with-parameters’,

Together with dropping qemu-image support for the Hurd, I have removed
most of this; what remains is in

--8<---------------cut here---------------start------------->8---
system: Add 'multiboot-modules' field to <boot-parameters>.
+             (mach (if (%current-target-system)
+                       ;; A cross-built GNUmach does not work
+                       (with-parameters ((%current-system "i686-linux")
+                                         (%current-target-system #f))
+                         mach)
+                       mach)))
[..]
+         (libc (if target
+                   (with-parameters ((%current-target-system #f))
+                     (cross-libc target))
+                   glibc))
--8<---------------cut here---------------end--------------->8---

>      ‘hurd-target?’, disabling sqlite3, and #~#$ tricks.

I think this is mostly gone, two instances of hurd-target? remain.  I'll
look more sharply at that too!

> I think part of the reason this cycle has been so long is that it’s been
> kind of a big bang; big bangs are great because they lead to something
> new and exciting, but they’re also intimidating.  :-) For me personally,
> looking at all these aspects at once was just too much.

Yes...

> For merging, I think it’d be great to see #1 and #2 as a first step, and
> then #3.

Yes, that would be an amazing feat.

> I do not want any of #4 :-), because I really think it could lead to
> maintenance headaches down the road, which would make the kind of
> changes we’re making today practically impossible in the future.

> Thoughts?

I fully agree, thanks!

Greetings,
Janneke

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




^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd.
  2020-05-29  9:06               ` Jan Nieuwenhuizen
@ 2020-05-30 10:08                 ` Jan Nieuwenhuizen
  2020-05-30 13:54                   ` Ludovic Courtès
  0 siblings, 1 reply; 48+ messages in thread
From: Jan Nieuwenhuizen @ 2020-05-30 10:08 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Mathieu Othacehe, 41350

Jan Nieuwenhuizen writes:

Hi!

A quick headsup for /boot/activation; I have found how to do without
/boot/activation, using the regular (I think) path using kernel
arguments --system=, --load=, and system/boot.

I'll be pushing a couple of squash commits onto wip-hurd-vm for
that.

Janneke

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




^ permalink raw reply	[flat|nested] 48+ messages in thread

* [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd.
  2020-05-30 10:08                 ` Jan Nieuwenhuizen
@ 2020-05-30 13:54                   ` Ludovic Courtès
  0 siblings, 0 replies; 48+ messages in thread
From: Ludovic Courtès @ 2020-05-30 13:54 UTC (permalink / raw)
  To: Jan Nieuwenhuizen; +Cc: Mathieu Othacehe, 41350

Hi,

Jan Nieuwenhuizen <janneke@gnu.org> skribis:

> A quick headsup for /boot/activation; I have found how to do without
> /boot/activation, using the regular (I think) path using kernel
> arguments --system=, --load=, and system/boot.

Yay!

Ludo’.




^ permalink raw reply	[flat|nested] 48+ messages in thread

end of thread, back to index

Thread overview: 48+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-17 10:01 [bug#41350] [PATCH 0/3] Use native qemu to build vm-image Jan Nieuwenhuizen
2020-05-17 10:03 ` [bug#41350] [PATCH 1/3] utils: Move 'reset-timestamps' out of database Jan (janneke) Nieuwenhuizen
2020-05-17 10:03   ` [bug#41350] [PATCH 2/3] system: vm: Do not register-closures when cross-building Jan (janneke) Nieuwenhuizen
2020-05-17 10:03   ` [bug#41350] [PATCH 3/3] system: vm: Build vm-image using native qemu Jan (janneke) Nieuwenhuizen
2020-05-18  9:10 ` [bug#41350] [PATCH 0/3] Use native qemu to build vm-image Mathieu Othacehe
2020-05-19  7:22   ` Jan Nieuwenhuizen
2020-05-19 10:02     ` Mathieu Othacehe
2020-05-20 14:03       ` Mathieu Othacehe
2020-05-20 15:09         ` Jan Nieuwenhuizen
2020-05-19  7:23 ` [bug#41350] [PATCH v2 1/3] utils: Move 'reset-timestamps' out of database Jan (janneke) Nieuwenhuizen
2020-05-19  7:23   ` [bug#41350] [PATCH v2 2/3] system: vm: Do not register-closures when cross-building to the Hurd Jan (janneke) Nieuwenhuizen
2020-05-19  7:23   ` [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for " Jan (janneke) Nieuwenhuizen
2020-05-19  9:14     ` Mathieu Othacehe
2020-05-20 21:49       ` Ludovic Courtès
2020-05-23  9:28       ` Jan Nieuwenhuizen
2020-05-23 17:45         ` Mathieu Othacehe
2020-05-23 19:07           ` Jan Nieuwenhuizen
2020-05-24  9:18             ` Mathieu Othacehe
2020-05-27  9:30               ` Ludovic Courtès
2020-05-28  7:00                 ` Mathieu Othacehe
2020-05-24 11:19             ` Jan Nieuwenhuizen
2020-05-24 12:07               ` Mathieu Othacehe
2020-05-24 14:20                 ` Jan Nieuwenhuizen
2020-05-24 16:36             ` Ludovic Courtès
2020-05-20 21:58     ` Ludovic Courtès
2020-05-22 19:24 ` Mathieu Othacehe
2020-05-27 22:54   ` Ludovic Courtès
2020-05-28  6:36     ` Mathieu Othacehe
2020-05-28 12:29       ` Jan Nieuwenhuizen
2020-05-28 15:39         ` Ludovic Courtès
2020-05-28 17:07           ` Jan Nieuwenhuizen
2020-05-28 17:10           ` Mathieu Othacehe
2020-05-28 18:19             ` Jan Nieuwenhuizen
2020-05-29  8:18             ` Ludovic Courtès
2020-05-29  9:06               ` Jan Nieuwenhuizen
2020-05-30 10:08                 ` Jan Nieuwenhuizen
2020-05-30 13:54                   ` Ludovic Courtès
2020-05-23  9:30 ` [bug#41350] [PATCH v3 1/3] utils: Move 'reset-timestamps' out of database Jan (janneke) Nieuwenhuizen
2020-05-23  9:30   ` [bug#41350] [PATCH v3 2/3] system: vm: Do not register-closures when cross-building to the Hurd Jan (janneke) Nieuwenhuizen
2020-05-27  8:45     ` Ludovic Courtès
2020-05-27  9:13       ` Jan Nieuwenhuizen
2020-05-23  9:30   ` [bug#41350] [PATCH v3 3/3] system: vm: Build vm-image using native qemu, for " Jan (janneke) Nieuwenhuizen
2020-05-27  8:43   ` [bug#41350] [PATCH v3 1/3] utils: Move 'reset-timestamps' out of database Ludovic Courtès
2020-05-27  8:59     ` Ludovic Courtès
2020-05-27  9:10     ` Jan Nieuwenhuizen
2020-05-24 18:11 ` [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd Mathieu Othacehe
2020-05-24 18:40   ` Jan Nieuwenhuizen
2020-05-25 15:46     ` Jan Nieuwenhuizen

unofficial mirror of guix-patches@gnu.org 

Archives are clonable:
	git clone --mirror https://yhetil.org/guix-patches/1 guix-patches/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 guix-patches guix-patches/ https://yhetil.org/guix-patches \
		guix-patches@gnu.org
	public-inbox-index guix-patches

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://news.yhetil.org/yhetil.gnu.guix.patches


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git