[PATCH 0/3] Use native qemu to build vm-image.

OpenSubmitted by Jan Nieuwenhuizen.
Details
3 participants
  • Jan Nieuwenhuizen
  • Ludovic Courtès
  • Mathieu Othacehe
Owner
unassigned
Severity
normal
J
J
Jan Nieuwenhuizen wrote on 17 May 12:01 +0200
(address . guix-patches@gnu.org)
87mu66q3rt.fsf@gnu.org
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. Ifthere a reason for using qemu-TARGET we may want to make this switchconditional for cross building to the Hurd?
There is a tricky aspect to this: the "user-builder" includes all thecross-built packages for TARGET, but we need to hard the native qemu anative #+LOADER, loading native #+LINUX and #+INITRD.
To accomplish this NATIVE/CROSS mixt, the builder is then run with a nativeguile, like so
Toggle snippet (5 lines)(system* #+(file-append (default-guile) "/bin/guile") "--no-auto-compile" #$(preserve-target user-builder))
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 anexception when dynamic-loading the .SO fails. Seeing it like this I am not sosure anymore this is a bug, WDYT? ...so instead
...the problem is now avoided by removing the sqlite dependency whencross-building by not registering closures and postponing the loading of (gnustore 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.orgFreelance IT http://JoyofSource.com| Avatar® http://AvatarAcademy.com
J
J
Jan (janneke) Nieuwenhuizen wrote on 17 May 12:03 +0200
[PATCH 1/3] utils: Move 'reset-timestamps' out of database.
(address . 41350@debbugs.gnu.org)
20200517100343.26361-1-janneke@gnu.org
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(-)
Toggle diff (146 lines)diff --git a/gnu/build/vm.scm b/gnu/build/vm.scmindex 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.scmindex 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.scmindex 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)) ;;;@@ -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
J
J
Jan (janneke) Nieuwenhuizen wrote on 17 May 12:03 +0200
[PATCH 2/3] system: vm: Do not register-closures when cross-building.
(address . 41350@debbugs.gnu.org)
20200517100343.26361-2-janneke@gnu.org
This supports cross-building building a vm-image, running a native qemu.
* gnu/system/vm.scm (qemu-image)[register-closures?]: Default to #f whencross-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(-)
Toggle diff (45 lines)diff --git a/gnu/build/vm.scm b/gnu/build/vm.scmindex 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.scmindex 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
J
J
Jan (janneke) Nieuwenhuizen wrote on 17 May 12:03 +0200
[PATCH 3/3] system: vm: Build vm-image using native qemu.
(address . 41350@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
20200517100343.26361-3-janneke@gnu.org
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 nativeqemu-command; use native linux, initrd, bootloader-package andbootloader-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(-)
Toggle diff (117 lines)diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scmindex 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.scmindex 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
M
M
Mathieu Othacehe wrote on 18 May 11:10 +0200
Re: [bug#41350] [PATCH 0/3] Use native qemu to build vm-image.
(name . Jan Nieuwenhuizen)(address . janneke@gnu.org)(address . 41350@debbugs.gnu.org)
87y2ppfw28.fsf@gnu.org
Hello Jan,
Toggle quote (3 lines)> 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.
Toggle quote (5 lines)>> 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) assoon as I have sorted out the bootloader issue. So the solution we willfind to overcome this Hurd issue will be temporary I hope.
About using qemu-TARGET, let say you are on an armhf machine and youwant to cross-build an x86-64 image. I fear that using a native, armhfGrub to install an x86-64 Grub won't work.
So maybe, it would be better to do that only for the architectureswithout an available qemu-TARGET (only the Hurd for now)?
Toggle quote (4 lines)> ...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, "guixbuild" something does not work. I don't know if its possible forguix-daemon to work without its database. An option could be to generatethis database if its absent, at first boot?
Toggle quote (5 lines)> ./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
J
J
Jan Nieuwenhuizen wrote on 19 May 09:22 +0200
(name . Mathieu Othacehe)(address . othacehe@gnu.org)(address . 41350@debbugs.gnu.org)
87367wbd82.fsf@gnu.org
Mathieu Othacehe writes:
Hello Mathieu,
Thanks for chiming in, I meant to CC you... :-)
Toggle quote (5 lines)>> 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 buildpackages for the Hurd. Now to see if this can be put into digestibleform.
Toggle quote (8 lines)>> 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 continuethis temporary path some more (as it starts to work right now), or can webetter abandon it and work the permanent solution? How could I contribute?
Toggle quote (4 lines)> 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.
Toggle quote (3 lines)> 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.
Toggle quote (9 lines)>> ...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 nowfor the Hurd only and we'll hit the problem that causes later. We canthen, s discussed on IRC, sqlite3 databases are indeed platformindependent and we could use something like guix/scripts/pack.scm'sstore-database. WDYT?
Toggle quote (7 lines)>> ./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.orgFreelance IT http://JoyofSource.com| Avatar® http://AvatarAcademy.com
J
J
Jan (janneke) Nieuwenhuizen wrote on 19 May 09:23 +0200
[PATCH v2 2/3] system: vm: Do not register-closures when cross-building to the Hurd.
20200519072302.9202-2-janneke@gnu.org
This supports cross-building building a vm-image for the Hurd, running anative qemu.
* gnu/system/vm.scm (qemu-image)[register-closures?]: Default to #f whencross-compiling to the Hurd. Only create sql-schema when actually registeringclosures.--- gnu/build/vm.scm | 2 +- gnu/system/vm.scm | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-)
Toggle diff (53 lines)diff --git a/gnu/build/vm.scm b/gnu/build/vm.scmindex 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.scmindex 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
J
J
Jan (janneke) Nieuwenhuizen wrote on 19 May 09:23 +0200
[PATCH v2 1/3] utils: Move 'reset-timestamps' out of database.
20200519072302.9202-1-janneke@gnu.org
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(-)
Toggle diff (146 lines)diff --git a/gnu/build/vm.scm b/gnu/build/vm.scmindex 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.scmindex 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.scmindex 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)) ;;;@@ -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
J
J
Jan (janneke) Nieuwenhuizen wrote on 19 May 09:23 +0200
[PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd.
(name . Ludovic Courtès)(address . ludo@gnu.org)
20200519072302.9202-3-janneke@gnu.org
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. Thatsolution 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 qemuvm.
* gnu/system/vm.scm (expression->derivation-in-linux-vm): Run nativeqemu-command; use native linux, initrd, bootloader-package andbootloader-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(-)
Toggle diff (169 lines)diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scmindex 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.scmindex 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
M
M
Mathieu Othacehe wrote on 19 May 11:14 +0200
(name . Jan (janneke) Nieuwenhuizen)(address . janneke@gnu.org)
87blmkthg0.fsf@gnu.org
Hello Janneke,
Toggle quote (7 lines)> + #$(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 answerhere. Now that we have let-system, the safer way to check for the targetsystem could be to write:
Toggle snippet (4 lines)#$(let-system (system target) (hurd-target? system target))
Ludo, is this correct? Furthermore, if you make sure that"grub-root-search" and "setup-gfxterm" return #+, you could maybe dropthis part?
Toggle quote (10 lines)> +> + (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?".
Toggle quote (9 lines)> + ;; (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
M
M
Mathieu Othacehe wrote on 19 May 12:02 +0200
Re: [bug#41350] [PATCH 0/3] Use native qemu to build vm-image.
(name . Jan Nieuwenhuizen)(address . janneke@gnu.org)(address . 41350@debbugs.gnu.org)
874ksctf85.fsf@gnu.org
Hello Jan,
Toggle quote (8 lines)>> 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 systemimages (raw disk-images, ISO9660 images, Qemu images) without resortingto VM for image creation.
Dropping VM, means that the image need to be build on the host, withoutroot permissions. This brings several limitations. If is no longerpossible 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 generatedisk-images.
For ISO9660 images:
* I first build the "image-root" derivation. It's a store directory thatcontains the root file-system.
* Then, I call make-iso9660-image that, run GNU Xorriso on thisdirectory.
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. Wecould 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 compatibleHurd 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 orgrub-bootloader (what you are trying to do), we need to find a way tomake grub-install work on disk-images (MBR installation and so on). Thattrue for the Hurd but that's also true for Linux.
Sorry for the long explanation. Please tell me if something is notclear.
The conclusion here is that, I think that we very few adaptations toyour branch, we should be able to produce Hurd ISO images or Hurd EFIcompatible disk-images. Maybe it would be a first step.
Then, we could find a way to create "MBR compatible" Hurd and Linuxdisk-images in (gnu system image).
WDYT?
Thanks,
Mathieu
M
M
Mathieu Othacehe wrote on 20 May 16:03 +0200
(name . Jan Nieuwenhuizen)(address . janneke@gnu.org)(address . 41350@debbugs.gnu.org)
87blmivh36.fsf@gnu.org
Hey,
Toggle quote (7 lines)> 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 adead-end, because I have a "no console will be available to os" messagein Qemu, instead of Hurd console output. I don't feel like debuggingthis.
So, back to the MBR solution. I had another look to what OpenWrt isdoing. 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".
Toggle snippet (7 lines)######################################## # # ## MBR # MBR-GAP # FIRST PARTITION ## # # ########################################
grub-mkimage generates a Grub image, small enough so that it can fit inthe MBR-GAP (the space between the MBR and the first partition).
It cannot contain all Grub modules, but that's not an issue, becauseGrub will be able to find missing modules from the first partition whenstarted.
They also patched grub-bios-setup[1] so that it can work on a rawdisk-image, and install the previously generated "grub.img".
So with the following commands:
Toggle snippet (5 lines)grub-mkimage -O i386-pc -o core.img biosdisk part_msdos ext2echo "(hd0) /tmp/my-disk-image" > device.mapgrub-bios-setup -m device.map -r "hd0,msdos1" -d tmp /tmp/qemu-image2
I'm able to make a Guix system image bootable, without rootpermissions. It then starts the Hurd kernel and crashes, but that'sanother story :p
So, if it's ok for you, I can integrate this stuff cleanly, and we won'tneed 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
J
J
Jan Nieuwenhuizen wrote on 20 May 17:09 +0200
(name . Mathieu Othacehe)(address . othacehe@gnu.org)
87lflm4p9o.fsf@gnu.org
Mathieu Othacehe writes:
Hello Mathieu!
Toggle quote (12 lines)>> 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 toshare. Maybe Ludo has an idea how to fix that; I could not findanything helpful yet.
Toggle quote (5 lines)> 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.
Toggle quote (10 lines)> #######################################> # # # #> # 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...
Toggle quote (4 lines)> 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...
Toggle quote (3 lines)> 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-installin 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 :-)
Toggle quote (10 lines)> 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!
Toggle quote (5 lines)> 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'dto me via IRC, adding som Hurd'y things. Maybe the pointers arehelpful, but it's all pretty obvious.
Greetings,Janneke
Toggle quote (2 lines)> [1]:> https://github.com/openwrt/openwrt/blob/master/package/boot/grub2/patches/100-grub_setup_root.patch
From 9bd218f4d91f79b26ad32cc6c4c1f479febd28de Mon Sep 17 00:00:00 2001From: "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org>Date: Tue, 19 May 2020 16:01:42 +0200Subject: [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(-)
Toggle diff (110 lines)diff --git a/gnu/build/bootloader.scm b/gnu/build/bootloader.scmindex 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.scmindex 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)) (elsediff --git a/gnu/system/examples/bare-hurd.tmpl b/gnu/system/examples/bare-hurd.tmplindex 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.scmindex 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
-- Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.orgFreelance IT http://JoyofSource.com| Avatar® http://AvatarAcademy.com
L
L
Ludovic Courtès wrote on 20 May 23:49 +0200
Re: [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd.
(name . Mathieu Othacehe)(address . othacehe@gnu.org)
87ftbue0pr.fsf@gnu.org
Hi,
Mathieu Othacehe <othacehe@gnu.org> skribis:
Toggle quote (16 lines)>> + #$(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’.
L
L
Ludovic Courtès wrote on 20 May 23:58 +0200
Re: [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd.
(name . Jan (janneke) Nieuwenhuizen)(address . janneke@gnu.org)
87367ue09v.fsf@gnu.org
Howdy!
"Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:
Toggle quote (15 lines)> 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 theabstractions:
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 QEMUimage for AArch64/EFI from an x86_64 box. That means we’d run thex86_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 aQEMU GNU/Hurd image without entirely on GNU/Linux.
As for (2), I’d say that when cross-compiling, it should just run nativesoftware 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 lasttime I looked at it, so I thought it’s best to double-check. :-))
Thanks!
Ludo’.
M
M
Mathieu Othacehe wrote on 22 May 21:24 +0200
Re: [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd.
(name . Ludovic Courtès)(address . ludo@gnu.org)
87pnavu611.fsf@gnu.org
Hey Ludo!
Toggle quote (4 lines)> 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 torun grub-install from an ARM system to build a cross-compiled x86-64system (for instance).
For now, running this command shows:
Toggle snippet (4 lines)ls $(guix build --system=aarch64-linux grub)/lib/grub/arm64-efi
So, the native aarch64-linux is only able to install itself on the samesystem. I think can be fixed though (same as for grub-hybrid package).
Toggle quote (4 lines)> 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 rootpermissions, 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
J
J
Jan Nieuwenhuizen wrote on 23 May 11:28 +0200
(name . Mathieu Othacehe)(address . othacehe@gnu.org)
87367r57b4.fsf@gnu.org
Mathieu Othacehe writes:
Hello Mathieu,
Toggle quote (14 lines)>> + #$(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...
Toggle quote (4 lines)> 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.
Toggle quote (12 lines)>> +>> + (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 insome other places here.
Toggle quote (11 lines)>> + ;; (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; possiblybecause 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 fulllist of exported symbols in the autoload of (gnu store database).
Mathieu, if it turns out that you are dropping qemu-image next weekaltogether then great!, and I have no problem whatsoever dropping thispatch set as well.
For now, I have reset wip-hurd-vm and put your commits towards thebottom of the wip-hurd-vm stack too.
Sending an updated v3 patch set just because I'm so pleased with thisresult.
Greetings,janneke
-- Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.orgFreelance IT http://JoyofSource.com| Avatar® http://AvatarAcademy.com
J
J
Jan (janneke) Nieuwenhuizen wrote on 23 May 11:30 +0200
[PATCH v3 1/3] utils: Move 'reset-timestamps' out of database.
(address . 41350@debbugs.gnu.org)
20200523093017.12149-1-janneke@gnu.org
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(-)
Toggle diff (146 lines)diff --git a/gnu/build/vm.scm b/gnu/build/vm.scmindex 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.scmindex 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.scmindex 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)) ;;;@@ -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
J
J
Jan (janneke) Nieuwenhuizen wrote on 23 May 11:30 +0200
[PATCH v3 2/3] system: vm: Do not register-closures when cross-building to the Hurd.
(address . 41350@debbugs.gnu.org)
20200523093017.12149-2-janneke@gnu.org
This supports cross-building building a vm-image for the Hurd, running anative qemu.
* gnu/system/vm.scm (qemu-image)[register-closures?]: Default to #f whencross-compiling to the Hurd. Only create sql-schema when actually registeringclosures.--- gnu/build/vm.scm | 9 ++++++++- gnu/system/vm.scm | 9 ++++++--- 2 files changed, 14 insertions(+), 4 deletions(-)
Toggle diff (60 lines)diff --git a/gnu/build/vm.scm b/gnu/build/vm.scmindex 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.scmindex 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
J
J
Jan (janneke) Nieuwenhuizen wrote on 23 May 11:30 +0200
[PATCH v3 3/3] system: vm: Build vm-image using native qemu, for the Hurd.
(address . 41350@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
20200523093017.12149-3-janneke@gnu.org
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. Thatsolution 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 qemuvm.
* gnu/system/vm.scm (expression->derivation-in-linux-vm): Run nativeqemu-command; use native linux, initrd, bootloader-package andbootloader-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(-)
Toggle diff (158 lines)diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scmindex 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) #$imagediff --git a/gnu/system/vm.scm b/gnu/system/vm.scmindex 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
M
M
Mathieu Othacehe wrote on 23 May 19:45 +0200
Re: [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd.
(name . Jan Nieuwenhuizen)(address . janneke@gnu.org)
87v9kmilze.fsf@gnu.org
Hello Jan,
Toggle quote (7 lines)> 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:
Toggle snippet (3 lines)guix system disk-image --target=i586-pc-gnu gnu/system/examples/bare-hurd.tmpl
no VM inside.
We now have to backport some of your work to (gnu system image), butthe good news is that closure registration is now working, and the Hurdboots.
Toggle quote (3 lines)> Sending an updated v3 patch set just because I'm so pleased with this> result.
I'll have a look :)
Thanks,
Mathieu
J
J
Jan Nieuwenhuizen wrote on 23 May 21:07 +0200
(name . Mathieu Othacehe)(address . othacehe@gnu.org)
87k112qxly.fsf@gnu.org
Mathieu Othacehe writes:
Toggle quote (15 lines)> 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 Idon'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?
Toggle quote (2 lines)> 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 latertomorrow, unless someone beats me to it ;)
Toggle quote (3 lines)> the good news is that closure registration is now working, and the Hurd> boots.
very nice, that's already one ahead!
Toggle quote (2 lines)> I'll have a look :)
Thanks :-)
Greetings,Janneke
-- Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.orgFreelance IT http://JoyofSource.com| Avatar® http://AvatarAcademy.com
M
M
Mathieu Othacehe wrote on 24 May 11:18 +0200
(name . Jan Nieuwenhuizen)(address . janneke@gnu.org)
87r1v9itd0.fsf@gnu.org
Hey!
Toggle quote (4 lines)> 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 thenative extension "guile-rsvg" in (gnu bootloader grub).
Taking inspiration from f52fbf709, I tried:
Toggle snippet (24 lines)diff --git a/guix/packages.scm b/guix/packages.scmindex 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 dothat for "target-grafts". Ludo, WDYT?
Thanks,
Mathieu
J
J
Jan Nieuwenhuizen wrote on 24 May 13:19 +0200
(name . Mathieu Othacehe)(address . othacehe@gnu.org)
87pnat37ia.fsf@gnu.org
Jan Nieuwenhuizen writes:
Hello Mathieu,
Toggle quote (6 lines)> 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 nothappen with "vm-image" because "qemu-image" of how qemu-image builtgrub. 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 theVM, the "Remove bash from boot process" patch would now rely on thehost's linux being patched. It's a bit early times/inconvenient todemand 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 callto 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.orgFreelance IT http://JoyofSource.com| Avatar® http://AvatarAcademy.com
M
M
Mathieu Othacehe wrote on 24 May 14:07 +0200
(name . Jan Nieuwenhuizen)(address . janneke@gnu.org)
87k111ilj0.fsf@gnu.org
Hello Jan,
Toggle quote (3 lines)> 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 withoutmake-device-nodes call.
Toggle quote (10 lines)>> 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:
Toggle snippet (16 lines)./pre-inst-env guix system disk-image --target=i586-pc-gnu gnu/system/examples/bare-hurd.tmplcp /gnu/store/the-image /tmp/img_ko
./pre-inst-env guix system vm-image --target=i586-pc-gnu gnu/system/examples/bare-hurd.tmplcp /gnu/store/the-vm-image /tmp/img_ok.qcow2qemu-img convert -f qcow2 -O raw /tmp/img_ok.qcow2 /tmp/img_ok.raw
sudo losetup -P /dev/loop1 /tmp/img_kosudo 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:
Toggle snippet (47 lines)Only in /mnt/img2/dev: consOnly in /mnt/img2/dev: consoleOnly in /mnt/img2/dev: fdOnly in /mnt/img2/dev: klogOnly in /mnt/img2/dev: kmsgOnly in /mnt/img2/dev: logOnly in /mnt/img2/dev: memOnly in /mnt/img2/dev: ptyp0Only in /mnt/img2/dev: ptyp1Only in /mnt/img2/dev: ptyp2Only in /mnt/img2/dev: shmOnly in /mnt/img2/dev: stderrOnly in /mnt/img2/dev: stdinOnly in /mnt/img2/dev: stdoutOnly in /mnt/img2/dev: timeOnly in /mnt/img2/dev: ttyOnly in /mnt/img2/dev: tty1Only in /mnt/img2/dev: tty12Only in /mnt/img2/dev: tty2Only in /mnt/img2/dev: tty3Only in /mnt/img2/dev: tty4Only in /mnt/img2/dev: tty5Only in /mnt/img2/dev: tty6Only in /mnt/img2/dev: ttyp0Only in /mnt/img2/dev: ttyp1Only in /mnt/img2/dev: ttyp2diff: /mnt/img2/dev/urandom: Structure needs cleaningOnly in /mnt/img2/dev: vcsOnly in /mnt/img2/etc: fstabOnly in /mnt/img2/etc: groupOnly in /mnt/img2/etc: hostnameOnly in /mnt/img2/etc: loginOnly in /mnt/img2/etc: motdOnly in /mnt/img2/etc: pam.dOnly in /mnt/img2/etc: passwdOnly in /mnt/img2/etc: profileOnly in /mnt/img2/etc: protocolsOnly in /mnt/img2/etc: .pwd.lockOnly in /mnt/img2/etc: servicesOnly in /mnt/img2/etc: shadowOnly in /mnt/img2/etc: shellsOnly in /mnt/img2/etc: skelOnly in /mnt/img2/etc: sshOnly in /mnt/img2/etc: sslOnly in /mnt/img2/etc: static
It seems that at least etc and dev directories are not correctlypopulated using disk-image. To be continued!
Mathieu
J
J
Jan Nieuwenhuizen wrote on 24 May 16:20 +0200
(name . Mathieu Othacehe)(address . othacehe@gnu.org)
87a71x8ldi.fsf@gnu.org
Mathieu Othacehe writes:
Helo Mathieu,
Toggle quote (11 lines)>> 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?
Toggle quote (17 lines)> 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...
Toggle quote (3 lines)> 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-imagefully works, the disk-image shows "/servers/startup: Device or resourcebusy"
I used something like
Toggle snippet (5 lines)modprobe nbd max_part=63qemu-nbd -c /dev/nbd0 vm-image.imgmount /dev/nbd0p1 /mnt
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
--- 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
-- Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.orgFreelance IT http://JoyofSource.com| Avatar® http://AvatarAcademy.com
L
L
Ludovic Courtès wrote on 24 May 18:36 +0200
(name . Jan Nieuwenhuizen)(address . janneke@gnu.org)
87imgl47e3.fsf@gnu.org
Hi!
Jan Nieuwenhuizen <janneke@gnu.org> skribis:
Toggle quote (19 lines)> 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 dynamicbinding growing every day…)
Ludo’.
M
M
Mathieu Othacehe wrote on 24 May 20:11 +0200
(name . Jan Nieuwenhuizen)(address . janneke@gnu.org)
87ftbpfbjl.fsf@gnu.org
Toggle quote (3 lines)> Ah, qemu-img convert -- nice. So, we get different type of images.> Wonder if that could play some role?
Hope not!
Toggle quote (7 lines)> 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). Ishould also do that for the fonts I guess. But I doubt the issue comesfrom here.
Toggle quote (8 lines)> --- 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 Inoticed that doing a cfdisk on the raw converted, vm-image rootpartition reports:
Attributes: 80
which doesn't appear on the disk-image.
However, tune2fs does not show any noticeable difference (both ext_attrand Hurd OS type are set).
Mathieu
J
J
Jan Nieuwenhuizen wrote on 24 May 20:40 +0200
(name . Mathieu Othacehe)(address . othacehe@gnu.org)
874ks52n3o.fsf@gnu.org
Mathieu Othacehe writes:
Toggle quote (5 lines)>> 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.
Toggle quote (11 lines)>> 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.
Toggle quote (16 lines)>> --- 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 revertedthe xattr trick on wip-hurd-vm for the /servers. Can we find out whereand what they are?
Toggle quote (3 lines)> 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.orgFreelance IT http://JoyofSource.com| Avatar® http://AvatarAcademy.com
J
J
Jan Nieuwenhuizen wrote on 25 May 17:46 +0200
(name . Mathieu Othacehe)(address . othacehe@gnu.org)
87d06sc90t.fsf@gnu.org
Jan Nieuwenhuizen writes:
Hello Mathieu, Ludo',
Toggle quote (13 lines)>>> 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 thefile /servers/exec. I suspected translator magic...but luckily Ludoinsisted he thinks that /servers/exec only needs to exist.
So, using current wip-hurd-vm, I tried this script:
Toggle snippet (12 lines)set -excp -f $(./pre-inst-env guix system disk-image --no-grafts --target=i586-pc-gnu gnu/system/examples/bare-hurd.tmpl) /tmp/disk-image.imgsudo losetup -P /dev/loop0 /tmp/disk-image.imgsudo mount /dev/loop0p1 /mntls -l /mnt/servers/execsudo rm -f /mnt/servers/execsudo touch /mnt/servers/execls -l /mnt/servers/execsudo umount /mntsudo losetup -d /dev/loop0
...which indeed produces a working VM!
Turns out that creating /servers/exec in the store getshard-linked/deduplicated or something...look:
Toggle snippet (8 lines)+ 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
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 andpush that yet. Can we prevent creation of hard links in another way?
Greetings,Janneke

$ git diff
Toggle diff (25 lines)diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scmindex 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.orgFreelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com
L
L
Ludovic Courtès wrote on 27 May 10:43 +0200
Re: [bug#41350] [PATCH v3 1/3] utils: Move 'reset-timestamps' out of database.
(name . Jan (janneke) Nieuwenhuizen)(address . janneke@gnu.org)(address . 41350@debbugs.gnu.org)
87zh9tlqdh.fsf@gnu.org
Hi!
"Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:
Toggle quote (6 lines)> 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 oneis visible. :-)
Toggle quote (8 lines)> --- 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 inthe host (guix config), which is bad because it’s user-specific:
Toggle snippet (10 lines)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))
Or we have to remember to do the ((guix config) => ,(make-config.scm))dance.
What’s the problem with loading sqlite3?
Thanks,Ludo’.
L
L
Ludovic Courtès wrote on 27 May 10:45 +0200
Re: [bug#41350] [PATCH v3 2/3] system: vm: Do not register-closures when cross-building to the Hurd.
(name . Jan (janneke) Nieuwenhuizen)(address . janneke@gnu.org)(address . 41350@debbugs.gnu.org)
87v9khlqa3.fsf@gnu.org
"Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:
Toggle quote (7 lines)> 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.
[...]
Toggle quote (4 lines)> - (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’.
L
L
Ludovic Courtès wrote on 27 May 10:59 +0200
Re: [bug#41350] [PATCH v3 1/3] utils: Move 'reset-timestamps' out of database.
(name . Jan (janneke) Nieuwenhuizen)(address . janneke@gnu.org)(address . 41350@debbugs.gnu.org)
87imghlpmw.fsf@gnu.org
Ludovic Courtès <ludo@gnu.org> skribis:
Toggle quote (3 lines)> 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…
J
J
Jan Nieuwenhuizen wrote on 27 May 11:10 +0200
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 41350@debbugs.gnu.org)
87r1v5agl5.fsf@gnu.org
Ludovic Courtès writes:
Hi!
Toggle quote (11 lines)> "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. :-/
Toggle quote (20 lines)>> --- 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!
Toggle quote (5 lines)> 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 filesfor TARGET are skipped and .SCM load fine, except for sqlite. It failstrying to load the sqlite3.so
Greetings,Janneke
-- Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.orgFreelance IT http://JoyofSource.com| Avatar® http://AvatarAcademy.com
J
J
Jan Nieuwenhuizen wrote on 27 May 11:13 +0200
Re: [bug#41350] [PATCH v3 2/3] system: vm: Do not register-closures when cross-building to the Hurd.
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 41350@debbugs.gnu.org)
87mu5tagfw.fsf@gnu.org
Ludovic Courtès writes:
Toggle quote (17 lines)> "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 wedon't have because it's for the wrong architecture. So as long as weavoid sqlite, we can cross-build a working VM.
Toggle quote (3 lines)> 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 buildin this weird way, i.e., using a native qemu! Other cross-builds ofvm-images are done using qemu-TARGET, only for the Hurd that doesnot work.
Greetings,Janneke
-- Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.orgFreelance IT http://JoyofSource.com| Avatar® http://AvatarAcademy.com
L
L
Ludovic Courtès wrote on 27 May 11:30 +0200
Re: [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd.
(name . Mathieu Othacehe)(address . othacehe@gnu.org)
878shdlo7v.fsf@gnu.org
Hi!
Mathieu Othacehe <othacehe@gnu.org> skribis:
Toggle quote (37 lines)>> 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 whenwe fix it.
Thanks,Ludo’.
L
L
Ludovic Courtès wrote on 28 May 00:54 +0200
(name . Mathieu Othacehe)(address . othacehe@gnu.org)
87zh9tf0qa.fsf@gnu.org
Hi!
Mathieu Othacehe <othacehe@gnu.org> skribis:
Toggle quote (22 lines)>> 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 patchesaddressing 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 ‘-Mvirt -nographic’ and remove ‘-enable-kvm’, but that’s a secondaryissue.)
Likewise, this produces what looks like a valid image, except probablyfor 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 sureI’ll do it before the week-end.
Toggle quote (4 lines)> 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!
Toggle quote (2 lines)> 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 someof the API in (guix system vm), at least for the ‘guix system vm’command.
Thanks,Ludo’.
From 1ccd6f8e853be17fa4ec244a660fa53ffcec979f Mon Sep 17 00:00:00 2001From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>Date: Wed, 27 May 2020 17:40:14 +0200Subject: [PATCH 1/7] system: 'system-linux-image-file-name' takes an optional parameter.
* gnu/system.scm (system-linux-image-file-name): Make 'target' anoptional parameter.--- gnu/system.scm | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
Toggle diff (31 lines)diff --git a/gnu/system.scm b/gnu/system.scmindex 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
From 56d8d921199bfdf151d899639052f579f24fdd00 Mon Sep 17 00:00:00 2001From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>Date: Wed, 27 May 2020 23:04:48 +0200Subject: [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(-)
Toggle diff (86 lines)diff --git a/gnu/build/vm.scm b/gnu/build/vm.scmindex 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 avoiddiff --git a/gnu/system/vm.scm b/gnu/system/vm.scmindex 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
From a2b70d97aa80f70cba56d419470ee8d2221dcc1e Mon Sep 17 00:00:00 2001From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>Date: Wed, 27 May 2020 23:08:15 +0200Subject: [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(-)
Toggle diff (30 lines)diff --git a/gnu/system/vm.scm b/gnu/system/vm.scmindex 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
From db7a12bf54585c8979602956a03fbb6502381dcd Mon Sep 17 00:00:00 2001From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>Date: Thu, 28 May 2020 00:37:33 +0200Subject: [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(-)
Toggle diff (64 lines)diff --git a/gnu/system/vm.scm b/gnu/system/vm.scmindex 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
From a9270c1261b747dc9a82b52d1ce38314862c51cd Mon Sep 17 00:00:00 2001From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>Date: Wed, 27 May 2020 23:09:49 +0200Subject: [PATCH 5/7] vm: <virtual-machine> compiler honors system and target.
* gnu/system/vm.scm (system-qemu-image/shared-store): Add #:systemand #: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(-)
Toggle diff (64 lines)diff --git a/gnu/system/vm.scm b/gnu/system/vm.scmindex 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
From dc3f04a9f412045a85ac810f9436648368c36adc Mon Sep 17 00:00:00 2001From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>Date: Wed, 27 May 2020 23:11:14 +0200Subject: [PATCH 6/7] vm: Shared-store script runs that native QEMU and Bash.
* gnu/system/vm.scm (system-qemu-image/shared-store-script): Use #+ forQEMU and BASH.--- gnu/system/vm.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
Toggle diff (25 lines)diff --git a/gnu/system/vm.scm b/gnu/system/vm.scmindex 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
From 6e936131ca85aba24f82d35c4616afe835ac7da5 Mon Sep 17 00:00:00 2001From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>Date: Wed, 27 May 2020 23:57:41 +0200Subject: [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(-)
Toggle diff (20 lines)diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scmindex 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
M
M
Mathieu Othacehe wrote on 28 May 08:36 +0200
(name . Ludovic Courtès)(address . ludo@gnu.org)
87d06o36sc.fsf@gnu.org
Toggle quote (2 lines)> So it took me the whole day, but I ended up with the following patches
Hey Ludo,
Toggle quote (5 lines)> 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 :)
Toggle quote (8 lines)> 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:
Toggle snippet (3 lines)qemu-system-arm -M machine help
for the complete list. Depending on the selected machine, the requiredbootloader differs. For the "virt" machine, it seems that we could passthe bootloader as Qemu "bios" argument[1], but I'm not sure we can domuch better.
Toggle quote (4 lines)> 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.
Toggle quote (5 lines)> 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 forboth disk-images and vm-images!
Mathieu
[1]:https://github.com/ARM-software/u-boot/blob/master/doc/README.qemu-arm
M
M
Mathieu Othacehe wrote on 28 May 09:00 +0200
(name . Ludovic Courtès)(address . ludo@gnu.org)
878shc35of.fsf@gnu.org
Hey Ludo,
Toggle quote (2 lines)> Could you boil the problem down to a “guix build --target” command?
No, but I just found a small reproducer:
Toggle snippet (18 lines)(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))))
This should fail with:
Toggle snippet (13 lines)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>
Thanks,
Mathieu
J
J
Jan Nieuwenhuizen wrote on 28 May 14:29 +0200
(name . Mathieu Othacehe)(address . othacehe@gnu.org)
87o8q8gs3w.fsf@gnu.org
Mathieu Othacehe writes:
Hello!
Toggle quote (4 lines)>> So it took me the whole day, but I ended up with the following patches>> Hey Ludo,
Thanks so much for helping out!
Toggle quote (7 lines)>> 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
Toggle quote (8 lines)>> 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 forwip-hurd-vm minus vm-image support) on it: it looks nice and works forme building a disk-impage.
Building a vm-image still needs quite some work: I tried building avm-image without hurd-specific vm-image patches (bisecting a bit:register-closures/grub/qemu-image preserve-target stuff)...but in theend I still needed all these
Toggle snippet (8 lines)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.
(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-imagework for the Hurd and reset wip-hurd-vm to my current gitlabwip-hurd-disk (or possibly push wip-hurd-disk...) WDYT?
Toggle quote (8 lines)>> 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 infor the Hurd?
Greetings,Janneke
-- Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.orgFreelance IT http://JoyofSource.com| Avatar® http://AvatarAcademy.com
L
L
Ludovic Courtès wrote on 28 May 17:39 +0200
(name . Jan Nieuwenhuizen)(address . janneke@gnu.org)
878shccblp.fsf@gnu.org
Hi!
Jan Nieuwenhuizen <janneke@gnu.org> skribis:
Toggle quote (5 lines)> 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.)
Toggle quote (4 lines)> 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!
Toggle quote (11 lines)>>> 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 theHurd.
But maybe we can just rebase ‘system-qemu-image’ & co. on top of (gnuimage)? What prevents us from doing that, Mathieu?
If we can do that, then indeed, there’s no point in insisting on fixingcross-compilation support in (gnu system vm).
Thanks for your feedback!
Ludo’.
J
J
Jan Nieuwenhuizen wrote on 28 May 19:07 +0200
(name . Ludovic Courtès)(address . ludo@gnu.org)
87mu5s7ztn.fsf@gnu.org
Ludovic Courtès writes:
Hello!
Toggle quote (9 lines)> 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).
Toggle quote (6 lines)>> 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/
Toggle quote (14 lines)>>>> 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, theyare clean and there's some value in them, I think.
Toggle quote (3 lines)> But maybe we can just rebase ‘system-qemu-image’ & co. on top of (gnu> image)? What prevents us from doing that, Mathieu?
+1
Toggle quote (3 lines)> 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.orgFreelance IT http://JoyofSource.com| Avatar® http://AvatarAcademy.com
M
M
Mathieu Othacehe wrote on 28 May 19:10 +0200
(name . Ludovic Courtès)(address . ludo@gnu.org)
87o8q8yohx.fsf@gnu.org
Hey Ludo & Jan,
Toggle quote (6 lines)> 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 thereis fixed in Ludo's serie. So we would need to rebase it on top ofeverything & finally push it.
Do you think that makes sense?
Thanks,
Mathieu
J
J
Jan Nieuwenhuizen wrote on 28 May 20:19 +0200
(name . Mathieu Othacehe)(address . othacehe@gnu.org)
87sgfj6hy3.fsf@gnu.org
Mathieu Othacehe writes:
Hi Mathieu, Ludo
Toggle quote (14 lines)> 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 itnow :-)
I push a fresh wip-hurd-vm, which is the above: wip-hurd-disk rebaseonto Ludo's series...almost the same.
Toggle quote (6 lines)> * 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...exceptfor leaving my hurd-specific qemu-image/vm-image work rest.
Hope that's OK!Janneke
-- Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.orgFreelance IT http://JoyofSource.com| Avatar® http://AvatarAcademy.com
L
L
Ludovic Courtès wrote on 29 May 10:18 +0200
(name . Mathieu Othacehe)(address . othacehe@gnu.org)
87o8q75f2r.fsf@gnu.org
Hi,
Mathieu Othacehe <othacehe@gnu.org> skribis:
Toggle quote (10 lines)>> 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’tfix anything for GNU/Hurd (to my surprise). So I’ll maybe check againonce the relevant Hurd bits are on master, instead of checking ARMcross-compilation.
Anyway it’s much less important now that (gnu image) can be used for thetask!
Toggle quote (2 lines)> * Then we could review & merge Jan's wip-hurd-disk.
Do I get it right that we first needhttps://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 beenkind of a big bang; big bangs are great because they lead to somethingnew 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, andthen #3.
I do not want any of #4 :-), because I really think it could lead tomaintenance headaches down the road, which would make the kind ofchanges we’re making today practically impossible in the future.
Thoughts?
Ludo’.
J
J
Jan Nieuwenhuizen wrote on 29 May 11:06 +0200
(name . Ludovic Courtès)(address . ludo@gnu.org)
871rn3rtza.fsf@gnu.org
Ludovic Courtès writes:
Toggle quote (17 lines)> 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 fromthat 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 whatwe had on wip-hurd-vm...
Because your fixes look clean and don't break anything, I think weshould maybe apply them to master -- and that's why I kept them atthe bottom of "wip-hurd-vm" for now.
Toggle quote (6 lines)> 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 fromtop-priority to probably not going to be used for the Hurd ;)
Toggle quote (13 lines)>> * 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.
Toggle quote (2 lines)> 4. Hacks to work around vm.scm defects: uses of ‘with-parameters’,
Together with dropping qemu-image support for the Hurd, I have removedmost of this; what remains is in
Toggle snippet (14 lines)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))
Toggle quote (2 lines)> ‘hurd-target?’, disabling sqlite3, and #~#$ tricks.
I think this is mostly gone, two instances of hurd-target? remain. I'lllook more sharply at that too!
Toggle quote (5 lines)> 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...
Toggle quote (3 lines)> 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.
Toggle quote (6 lines)> 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.orgFreelance IT http://JoyofSource.com| Avatar® http://AvatarAcademy.com
J
J
Jan Nieuwenhuizen wrote on 30 May 12:08 +0200
(name . Ludovic Courtès)(address . ludo@gnu.org)
87d06ld9bj.fsf@gnu.org
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 kernelarguments --system=, --load=, and system/boot.
I'll be pushing a couple of squash commits onto wip-hurd-vm forthat.
Janneke
-- Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.orgFreelance IT http://JoyofSource.com| Avatar® http://AvatarAcademy.com
L
L
Ludovic Courtès wrote on 30 May 15:54 +0200
(name . Jan Nieuwenhuizen)(address . janneke@gnu.org)
87r1v1v88j.fsf@gnu.org
Hi,
Jan Nieuwenhuizen <janneke@gnu.org> skribis:
Toggle quote (4 lines)> 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’.
?