[PATCH] Test and fix the ISO Image Installer

  • Done
  • quality assurance status badge
Details
3 participants
  • Danny Milosavljevic
  • Ludovic Courtès
  • Christopher Baines
Owner
unassigned
Submitted by
Christopher Baines
Severity
important
C
C
Christopher Baines wrote on 30 Aug 2017 08:17
(address . guix-patches@gnu.org)
20170830071714.75f88e47@cbaines.net
Hey,

So at the GNU Hackers Meeting, I attempted to build the installer system
as an ISO image, and test installing Guix on a Bytemark VM with this. I
encountered problems, and therefore set about writing a system test to
see if this could be reproduced.

The failures did seem reproducible locally, and Ludo helped with some
code changes. I'll send the work in progress patches to this bug.
-----BEGIN PGP SIGNATURE-----

iQKSBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlmmWGpfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9XcfXw/4mzuu9gs9Rki31SrV6LmMxsaQN2ZT7HuEfDQQmX5Gu+74pVTgnbGveytW
QFfRhfnfrtN702p86RTTpWE7vC6JNMzyHo4Qk8SCTCjuzuemTiMazCIB07UCa9lZ
Vv3D6HcR8RgVuK4Y7PE86PgG4aRtprYn09Ie1OkDe/B/+4WRr/TVDOx9KKSRgFr9
jW+Ewo416nsbxn2QFgwUNkLQ/m0ikUH8ekaZ9vtIJIp1bGFKSY9aIG53ezfPOZud
x3PvCt1sdU+Y/KCPIXVD96h6nzY1Bf2P62M3Ji4qam5wGor9ZCtAHFWjRAaTJnHv
dKZQi6d1YrDyzUR9sshWhfYJmsymbHc/N0Kyq2ZAC4AZrBCLL2lxxdZIX3cdsvq7
0a6rxdZ63YE5UtatCNPK2jOLQM9BRWWjhWcFhgwfgqAz9Mu7UPgfk1/wZtJcSsum
eQCoeJv5Ntax77WAtONQUO5TE9WCHRibZOYxaN/8hHOy1C9rQ7mwwONELLFGeTGl
W3lcTnNn6I2BHTrd/auc5Bmx3c7rDCzsMmewqDY6LnKPjkg8UFN/cUxxB/EIVvrS
+ysIv7NbNNs+r3BunGaE75DFkKOaqF2SgtSCP7Y42rMK/LvbAkJN6Ynmvbc4W+q3
O+gFXTZzGwPxs7mpaNFB9ZWocZqEXvtnEiQDvyYqXrr/Q+wSGg==
=w858
-----END PGP SIGNATURE-----


C
C
Christopher Baines wrote on 30 Aug 2017 08:20
[PATCH 1/2] tests: Add test for installing from an ISO Image.
(address . 28288@debbugs.gnu.org)
20170830062010.11902-1-mail@cbaines.net
* gnu/tests/install.scm (%test-iso-image-installer): New variable.
(run-install): Add #:installation-disk-image-file-system-type as a keyword
argument.
---
gnu/tests/install.scm | 48 +++++++++++++++++++++++++++++++++++++-----------
1 file changed, 37 insertions(+), 11 deletions(-)

Toggle diff (89 lines)
diff --git a/gnu/tests/install.scm b/gnu/tests/install.scm
index 866bf885c..7596347a3 100644
--- a/gnu/tests/install.scm
+++ b/gnu/tests/install.scm
@@ -37,6 +37,7 @@
#:use-module (guix utils)
#:export (%test-installed-os
%test-installed-extlinux-os
+ %test-iso-image-installer
%test-separate-store-os
%test-separate-home-os
%test-raid-root-os
@@ -196,6 +197,7 @@ reboot\n")
(kernel-arguments '("console=ttyS0")))
#:imported-modules '((gnu services herd)
(guix combinators))))
+ (installation-disk-image-file-system-type "ext4")
(target-size (* 1200 MiB)))
"Run SCRIPT (a shell script following the GuixSD installation procedure) in
OS to install TARGET-OS. Return a VM image of TARGET-SIZE bytes containing
@@ -213,7 +215,9 @@ packages defined in installation-os."
(image (system-disk-image
(operating-system-with-gc-roots
os (list target))
- #:disk-image-size (* 1500 MiB))))
+ #:disk-image-size (* 1500 MiB)
+ #:file-system-type
+ installation-disk-image-file-system-type)))
(define install
(with-imported-modules '((guix build utils)
(gnu build marionette))
@@ -229,16 +233,24 @@ packages defined in installation-os."
(define marionette
(make-marionette
- (cons (which #$(qemu-command system))
- (cons* "-no-reboot" "-m" "800"
- "-drive"
- (string-append "file=" #$image
- ",if=virtio,readonly")
- "-drive"
- (string-append "file=" #$output ",if=virtio")
- (if (file-exists? "/dev/kvm")
- '("-enable-kvm")
- '())))))
+ `(,(which #$(qemu-command system))
+ "-no-reboot"
+ "-m" "800"
+ ,@(case installation-disk-image-file-system-type
+ (("ext4")
+ `("-drive"
+ ,(string-append "file=" #$image
+ ",if=virtio,readonly")))
+ (("iso9660") '("-cdrom" #$image))
+ (else
+ (error
+ "unsupported installation-disk-image-file-system-type"
+ installation-disk-image-file-system-type)))
+ "-drive"
+ ,(string-append "file=" #$output ",if=virtio")
+ ,@(if (file-exists? "/dev/kvm")
+ '("-enable-kvm")
+ '()))))
(pk 'uname (marionette-eval '(uname) marionette))
@@ -312,6 +324,20 @@ per %test-installed-os, this test is expensive in terms of CPU and storage.")
(run-basic-test %minimal-extlinux-os command
"installed-extlinux-os")))))
+(define %test-iso-image-installer
+ (system-test
+ (name "iso-image-installer")
+ (description
+ "")
+ (value
+ (mlet* %store-monad ((image (run-install
+ %minimal-os
+ %minimal-os-source
+ #:installation-disk-image-file-system-type
+ "iso9660"))
+ (command (qemu-command/writable-image image)))
+ (run-basic-test %minimal-os command name)))))
+
;;;
;;; Separate /home.
--
2.14.1
C
C
Christopher Baines wrote on 30 Aug 2017 08:20
[PATCH 2/2] WIP
(address . 28288@debbugs.gnu.org)
20170830062010.11902-2-mail@cbaines.net
---
gnu/build/vm.scm | 19 +++++++++++++++++--
gnu/system/vm.scm | 16 +++++++++++-----
2 files changed, 28 insertions(+), 7 deletions(-)

Toggle diff (92 lines)
diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm
index 727494ad9..e2659cb5e 100644
--- a/gnu/build/vm.scm
+++ b/gnu/build/vm.scm
@@ -366,12 +366,27 @@ SYSTEM-DIRECTORY is the name of the directory of the 'system' derivation."
(error "failed to create GRUB EFI image"))))
(define* (make-iso9660-image grub config-file os-drv target
- #:key (volume-id "GuixSD_image") (volume-uuid #f))
+ #:key (volume-id "GuixSD_image") (volume-uuid #f)
+ register-closures? (closures '()))
"Given a GRUB package, creates an iso image as TARGET, using CONFIG-FILE as
GRUB configuration and OS-DRV as the stuff in it."
- (let ((grub-mkrescue (string-append grub "/bin/grub-mkrescue")))
+ (let ((grub-mkrescue (string-append grub "/bin/grub-mkrescue"))
+ (target-store (string-append "/tmp/root" (%store-directory))))
(mkdir-p "/tmp/root/var/run")
(mkdir-p "/tmp/root/run")
+
+ ;; XXX: 'guix-register' wants to palpate the things it registers, so
+ ;; bind-mount the store on the target.
+ (mkdir-p target-store)
+ (mount (%store-directory) target-store "" MS_BIND)
+
+ (when register-closures?
+ (display "registering closures...\n")
+ (for-each (lambda (closure)
+ (register-closure target
+ (string-append "/xchg/" closure)))
+ closures))
+
(unless (zero? (apply system*
`(,grub-mkrescue "-o" ,target
,(string-append "boot/grub/grub.cfg=" config-file)
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index 4494af003..b106dff0a 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -192,6 +192,7 @@ made available under the /xchg CIFS share."
os-drv
bootcfg-drv
bootloader
+ register-closures?
(inputs '()))
"Return a bootable, stand-alone iso9660 image.
@@ -207,8 +208,13 @@ INPUTS is a list of inputs (as for packages)."
(let ((inputs
'#$(append (list qemu parted e2fsprogs dosfstools xorriso)
(map canonical-package
- (list sed grep coreutils findutils gawk))))
+ (list sed grep coreutils findutils gawk))
+ (if register-closures? (list guix) '())))
+
+ (graphs '#$(match inputs
+ (((names . _) ...)
+ names)))
;; This variable is unused but allows us to add INPUTS-TO-COPY
;; as inputs.
(to-register
@@ -222,6 +228,8 @@ INPUTS is a list of inputs (as for packages)."
#$bootcfg-drv
#$os-drv
"/xchg/guixsd.iso"
+ #:register-closures? #$register-closures?
+ #:closures graphs
#:volume-id #$file-system-label
#:volume-uuid #$file-system-uuid)
(reboot))))
@@ -391,6 +399,7 @@ to USB sticks meant to be read-only."
#:file-system-label root-label
#:file-system-uuid #f
#:os-drv os-drv
+ #:register-closures? #t
#:bootcfg-drv bootcfg
#:bootloader (bootloader-configuration-bootloader
(operating-system-bootloader os))
@@ -403,10 +412,7 @@ to USB sticks meant to be read-only."
(operating-system-bootloader os))
#:disk-image-size disk-image-size
#:disk-image-format "raw"
- #:file-system-type (if (string=? "iso9660"
- file-system-type)
- "ext4"
- file-system-type)
+ #:file-system-type file-system-type
#:file-system-label root-label
#:copy-inputs? #t
#:register-closures? #t
--
2.14.1
C
C
Christopher Baines wrote on 30 Aug 2017 08:31
(address . 28288@debbugs.gnu.org)(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
20170830073113.426bf8d3@cbaines.net
Currently, I get the following error when running this test.

registering closures...
error: initialising database schema: disk I/O error
ERROR: In procedure scm-error:
ERROR: failed to register store items "/xchg/system"


I also need the patch from
even run the test.

Danny, I guess you have been looking at installing from an ISO image as
well, as I spotted you added it to the release target. Have you been
able to successfully use it yet?

When attempting to use it initially, I encountered a problem where a
glibc in the store was partially deleted. /var/guix/db/db.sqlite also
initially didn't exist, which the WIP patch here attempts to address.
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlmmW7FfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9XdqaBAAi9jYJNv3jjrcuCXPLMOKmFy/mwY/qJc5tDHsQ+6Y7pQHyKxM5jvvf47e
2lfBSNR1nxVcRnIWSZR+D7ROiZ17Pojy/ipcNkKpJ8KmKrrpnz0Vd1Hj3eBSVufF
MndqI+AWIY04DM5IsZ7m/FChlFctRhN9kk5pCjHfmjC/M7qv/EetJpePyyA1tYHX
KBao1otepFbQ7DT5u7jj+rT+vnzducTM71zdpi8AsXRSCy0zxBtkAcHamdwgSp59
tI6SkA8QW4N1uWmL+nkX+93taq3I9JhGpG+2OfdGBOf0XXavtbURPPO646KyAB5f
mT/lCpgBI9htZ6goLgNuBR9qVs41G3zKjSngz1xLsMatU45j+yulC2FDk9qb0jA1
N1vDSB+YmowjEH+HHjN8SNKuWXcW4+AQ9ZbCEHmmCt9mBQRix24cx2UWQbWnhpCV
PXZyiNgapupvM0eIdrMBKxdeHp0zlFs/QWXd4H5BjcweG37X76/A6eM30Fl+jNTG
74VSKeyyALiIV2Lq8UinRjw7ldqmLRDxW4eTOHUe706sFm/kqxBljp+iea2pmwtT
jD/r2yy6cqp/ka110QSMq2PRcP3hXrX36iYJFIGElBasMNXQhxQu+EOJLoyP/l3z
cL7e8F8SeGLsjkpmPShcZ5wsV2qokI4StaMuBHeLl8V4AUrN5vs=
=vQ6g
-----END PGP SIGNATURE-----


D
D
Danny Milosavljevic wrote on 30 Aug 2017 10:38
(name . Christopher Baines)(address . mail@cbaines.net)(address . 28288@debbugs.gnu.org)
20170830103800.09ea6e31@scratchpost.org
Hi Christopher,

On Wed, 30 Aug 2017 07:31:13 +0100
Christopher Baines <mail@cbaines.net> wrote:

Toggle quote (16 lines)
> Currently, I get the following error when running this test.
>
> registering closures...
> error: initialising database schema: disk I/O error
> ERROR: In procedure scm-error:
> ERROR: failed to register store items "/xchg/system"
>
>
> I also need the patch from
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=28273 otherwise I can't
> even run the test.
>
> Danny, I guess you have been looking at installing from an ISO image as
> well, as I spotted you added it to the release target. Have you been
> able to successfully use it yet?

Does that mean with the wip-installer-2 branch?

Otherwise in master I always tested it using gnu/system/install.scm until it has booted up successfully, which it did.

I've asked about the installation part before but there was no response.

Toggle quote (4 lines)
> When attempting to use it initially, I encountered a problem where a
> glibc in the store was partially deleted. /var/guix/db/db.sqlite also
> initially didn't exist, which the WIP patch here attempts to address.

Hmm, do you have logs of the release creation process? Maybe xorriso complained?
D
D
Danny Milosavljevic wrote on 30 Aug 2017 20:26
(name . Christopher Baines)(address . mail@cbaines.net)(address . 28288@debbugs.gnu.org)
20170830202637.6b6ace8b@scratchpost.org
Toggle quote (5 lines)
> + ;; XXX: 'guix-register' wants to palpate the things it registers, so
> + ;; bind-mount the store on the target.
> + (mkdir-p target-store)
> + (mount (%store-directory) target-store "" MS_BIND)

What does this do?

gnu/build/vm.scm make-iso9660-image already provides /gnu/store a few lines down:

(unless (zero? (apply system*
`(,grub-mkrescue "-o" ,target
,(string-append "boot/grub/grub.cfg=" config-file)
,(string-append "gnu/store=" os-drv "/..")
^^^^

Maybe I'm missing something...

Otherwise LGTM!
C
C
Christopher Baines wrote on 31 Aug 2017 00:56
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
20170830235647.1def024c@cbaines.net
On Wed, 30 Aug 2017 10:38:00 +0200
Danny Milosavljevic <dannym@scratchpost.org> wrote:

Toggle quote (23 lines)
> Hi Christopher,
>
> On Wed, 30 Aug 2017 07:31:13 +0100
> Christopher Baines <mail@cbaines.net> wrote:
>
> > Currently, I get the following error when running this test.
> >
> > registering closures...
> > error: initialising database schema: disk I/O error
> > ERROR: In procedure scm-error:
> > ERROR: failed to register store items "/xchg/system"
> >
> >
> > I also need the patch from
> > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=28273 otherwise I
> > can't even run the test.
> >
> > Danny, I guess you have been looking at installing from an ISO
> > image as well, as I spotted you added it to the release target.
> > Have you been able to successfully use it yet?
>
> Does that mean with the wip-installer-2 branch?

I've just been testing with the master branch, and with the changes I
sent to this bug. Are there any changes on the wip-installer-2 that are
not solely related to the installer (which if I understand correctly is
something more complicated than running guix system init).

Toggle quote (6 lines)
> Otherwise in master I always tested it using gnu/system/install.scm
> until it has booted up successfully, which it did.
>
> I've asked about the installation part before but there was no
> response.

Ok, that's good to know. I would guess it's pretty close now, great
work on moving the ISO stuff forward!

Toggle quote (8 lines)
> > When attempting to use it initially, I encountered a problem where a
> > glibc in the store was partially deleted. /var/guix/db/db.sqlite
> > also initially didn't exist, which the WIP patch here attempts to
> > address.
>
> Hmm, do you have logs of the release creation process? Maybe xorriso
> complained?

From talking to Ludo at the GHM, I think there is some extra steps
needed to make installing from the ISO possible, but I don't yet
understand this. I'll CC Ludo, as he might be able to explain better.
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlmnQq9fFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9XdB8xAAnBSNLrJl/3YXua8Xi42talpiWmAcJHH9i5fcrArKUC+Z6ANR9lB8eLD4
UIolLVj3LEg8imcFVIhg3anUqo3kZgP7lYo6LnpD6kA19zF8Jya0MlqXoDbFbrHJ
rPPmxzedhzUM/elI32Mc0z0jy4Z+O4ashEnFYHETd6k7MMpwRUXxaVlGYjb0EL80
pUQ4Vne67WhI7DDC693oR7L19lZW5AmOTUG+F5dnLvmg3L9lMoBYOTWp535T0L7H
72Q1yklgTVB02VsZA8jDaSkag3i108kzaYWteo8tLjVjh00ifDK3F7UBGbLJeBMP
VgidFHaiwiNCNiyIQqevE7Y0nqejY0/UHgfJH0HpxLaz9QZgaONU7EA1tvkRQsbx
Aflq+GcKm00be7UIFGqMsApJyHNMOCUQuIFucMWkM9TNiGl0apR7IVAOjklUifkK
ZCOg8Y+6EeZcgJZ9BQ2/DfJTxl9sPAuUaavwtOWZQ8ZSyhdelEysuZ+vfX6/kaXC
uqcpcpnqViAX9SxKoapLbLvbz0w4+XLWDIZwcobMBL2q8xJM6umeTSb44XV2CSwX
sXxKutr+jclG/syjyVunmiA2YLO5kSTmYeD8/3GeYiCackdqZrFzPyR2XMJdik/j
lmPYpV+dOpcX5RkGppT+Jf27hqsqAe8VxwJY56CxYjHseeQC2yc=
=o73k
-----END PGP SIGNATURE-----


L
L
Ludovic Courtès wrote on 31 Aug 2017 12:27
control message for bug #28288
(address . control@debbugs.gnu.org)
87val4uj4o.fsf@gnu.org
severity 28288 important
D
D
Danny Milosavljevic wrote on 31 Aug 2017 15:04
Re: [bug#28288] [PATCH 2/2] WIP
(name . Christopher Baines)(address . mail@cbaines.net)
20170831150448.41b0f41e@scratchpost.org
On Wed, 30 Aug 2017 23:56:47 +0100
Christopher Baines <mail@cbaines.net> wrote:

Toggle quote (4 lines)
> I've just been testing with the master branch, and with the changes I
> sent to this bug. Are there any changes on the wip-installer-2 that are
> not solely related to the installer

No

Toggle quote (2 lines)
>(which if I understand correctly is something more complicated than running guix system init).

Yes
C
C
Christopher Baines wrote on 31 Aug 2017 23:47
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)(address . 28288@debbugs.gnu.org)
20170831224728.59e79444@cbaines.net
On Thu, 31 Aug 2017 15:04:48 +0200
Danny Milosavljevic <dannym@scratchpost.org> wrote:

Toggle quote (14 lines)
> On Wed, 30 Aug 2017 23:56:47 +0100
> Christopher Baines <mail@cbaines.net> wrote:
>
> > I've just been testing with the master branch, and with the changes
> > I sent to this bug. Are there any changes on the wip-installer-2
> > that are not solely related to the installer
>
> No
>
> >(which if I understand correctly is something more complicated than
> >running guix system init).
>
> Yes

Great, ok, good to know I haven't missed anything.

I'll hopefully be able to make some time soonish to take a look at
getting the ISO image in to a state where running guix system init from
it works, unless someone beats me to it!
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlmog/BfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9Xd8eQ//RhGH89BwqPRQCF8lenUNLiDL4sjWgfTGuYGneJneMWt9vqSVr6sj6yVw
e0F1QmVgSDyfdIbHw6rs/h78WWC2ETMLMdMwpsddka5HjR13Tis+pNS9Jvv++Wva
OMQoHH80C6z6VoOnqGb/xVJMDWoO/cHYwmMCW4VHX6X9GGhj/Y7XtKHHHwr5eMl/
BfWnNnkZ4+Eb3Xh7DtGSZiqIbnEWZNU4UT6BCKonfc1cDk4Grb6eFO9xq+e4BPcC
IuTQMUXgLkaxpIay6gGS6bLeseuAgXnQk5rp4EuaSrRnztwAOxmuxvX3FwM7edg9
Xtm7jmCIURHf3fotPgROQhxtVsdxSlcY6173ZJoWLPaIRrI+z2sYbtO7Ojk8lpvJ
cGkMiWqiNvreQeCVhWeBjQNpZ3sZRzrzVyY9RwXg/UEwX4YICjqbpfM30AZPzSXW
yngSgRvU0nuJTX7w81TZfNfuhZNu8+m9ZaS8Tz2Jl3Fk9iGywHJkvc/QV/sDoZwg
e27cPN/9zeauH8uqHS9rjn32digRcXZHQkqOdNjPeBMIOX5c8v6bYn5JV3Hunb1b
TdrTykGOXleZh1A+cveqAhD97cdc0llMtNjwyksdNzbUr4563oxokl1nh/evBsbC
nkMKF/hG3iqqlYH4Q0Xxfq85FdfXOY3NJ0AUzLV+03t65OseB68=
=LqV3
-----END PGP SIGNATURE-----


C
C
Christopher Baines wrote on 3 Sep 2017 12:50
[PATCH 3/5] vm: Add support for registering closures to iso9660-image.
(address . 28288@debbugs.gnu.org)
20170903105041.2925-3-mail@cbaines.net
* gnu/system/vm.scm (iso9660-image): Add support for registering closures.
---
gnu/system/vm.scm | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

Toggle diff (38 lines)
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index 4494af003..fc55935aa 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -192,6 +192,7 @@ made available under the /xchg CIFS share."
os-drv
bootcfg-drv
bootloader
+ register-closures?
(inputs '()))
"Return a bootable, stand-alone iso9660 image.
@@ -207,8 +208,13 @@ INPUTS is a list of inputs (as for packages)."
(let ((inputs
'#$(append (list qemu parted e2fsprogs dosfstools xorriso)
(map canonical-package
- (list sed grep coreutils findutils gawk))))
+ (list sed grep coreutils findutils gawk))
+ (if register-closures? (list guix) '())))
+
+ (graphs '#$(match inputs
+ (((names . _) ...)
+ names)))
;; This variable is unused but allows us to add INPUTS-TO-COPY
;; as inputs.
(to-register
@@ -222,6 +228,8 @@ INPUTS is a list of inputs (as for packages)."
#$bootcfg-drv
#$os-drv
"/xchg/guixsd.iso"
+ #:register-closures? #$register-closures?
+ #:closures graphs
#:volume-id #$file-system-label
#:volume-uuid #$file-system-uuid)
(reboot))))
--
2.14.1
C
C
Christopher Baines wrote on 3 Sep 2017 12:50
[PATCH 1/5] vm: Add support for registering closures to make-iso9660-image.
(address . 28288@debbugs.gnu.org)
20170903105041.2925-1-mail@cbaines.net
This mimics the functionality in the root-partition-initializer used in
creating the QEMU image. This helps when trying to run guix system init from
the generated ISO image.

* gnu/build/vm.scm (make-iso9660-image): Add support for registering closures.
---
gnu/build/vm.scm | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)

Toggle diff (36 lines)
diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm
index 727494ad9..606257d8c 100644
--- a/gnu/build/vm.scm
+++ b/gnu/build/vm.scm
@@ -366,12 +366,27 @@ SYSTEM-DIRECTORY is the name of the directory of the 'system' derivation."
(error "failed to create GRUB EFI image"))))
(define* (make-iso9660-image grub config-file os-drv target
- #:key (volume-id "GuixSD_image") (volume-uuid #f))
+ #:key (volume-id "GuixSD_image") (volume-uuid #f)
+ register-closures? (closures '()))
"Given a GRUB package, creates an iso image as TARGET, using CONFIG-FILE as
GRUB configuration and OS-DRV as the stuff in it."
- (let ((grub-mkrescue (string-append grub "/bin/grub-mkrescue")))
+ (let ((grub-mkrescue (string-append grub "/bin/grub-mkrescue"))
+ (target-store (string-append "/tmp/root" (%store-directory))))
(mkdir-p "/tmp/root/var/run")
(mkdir-p "/tmp/root/run")
+
+ (mkdir-p target-store)
+ (mount (%store-directory) target-store "" MS_BIND)
+
+ (when register-closures?
+ (display "registering closures...\n")
+ (for-each (lambda (closure)
+ (register-closure
+ "/tmp/root"
+ (string-append "/xchg/" closure)
+ #:deduplicate? #f))
+ closures))
+
(unless (zero? (apply system*
`(,grub-mkrescue "-o" ,target
,(string-append "boot/grub/grub.cfg=" config-file)
--
2.14.1
C
C
Christopher Baines wrote on 3 Sep 2017 12:50
[PATCH 2/5] vm: Create /mnt in the generated ISO image in make-iso9660-image.
(address . 28288@debbugs.gnu.org)
20170903105041.2925-2-mail@cbaines.net
This is used in the installation process, as the mountpoint for the target
filesystem.

* gnu/build/vm.scm (make-iso9660-image): Create /mnt within the generated ISO
image.
---
gnu/build/vm.scm | 5 +++++
1 file changed, 5 insertions(+)

Toggle diff (25 lines)
diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm
index 606257d8c..f6228b40b 100644
--- a/gnu/build/vm.scm
+++ b/gnu/build/vm.scm
@@ -374,6 +374,7 @@ GRUB configuration and OS-DRV as the stuff in it."
(target-store (string-append "/tmp/root" (%store-directory))))
(mkdir-p "/tmp/root/var/run")
(mkdir-p "/tmp/root/run")
+ (mkdir-p "/tmp/root/mnt")
(mkdir-p target-store)
(mount (%store-directory) target-store "" MS_BIND)
@@ -393,6 +394,10 @@ GRUB configuration and OS-DRV as the stuff in it."
,(string-append "gnu/store=" os-drv "/..")
"var=/tmp/root/var"
"run=/tmp/root/run"
+ ;; /mnt is used as part of the installation
+ ;; process, as the mount point for the target
+ ;; filesystem, so create it.
+ "mnt=/tmp/root/mnt"
"--"
;; Store two copies of the headers.
;; The resulting ISO-9660 image has a DOS MBR and
--
2.14.1
C
C
Christopher Baines wrote on 3 Sep 2017 12:50
[PATCH 5/5] tests: Add test for installing from an ISO Image.
(address . 28288@debbugs.gnu.org)
20170903105041.2925-5-mail@cbaines.net
* gnu/tests/install.scm (%test-iso-image-installer): New variable.
(run-install): Add #:installation-disk-image-file-system-type as a keyword
argument.
---
gnu/tests/install.scm | 110 +++++++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 99 insertions(+), 11 deletions(-)

Toggle diff (151 lines)
diff --git a/gnu/tests/install.scm b/gnu/tests/install.scm
index 866bf885c..93c8a89cd 100644
--- a/gnu/tests/install.scm
+++ b/gnu/tests/install.scm
@@ -37,6 +37,7 @@
#:use-module (guix utils)
#:export (%test-installed-os
%test-installed-extlinux-os
+ %test-iso-image-installer
%test-separate-store-os
%test-separate-home-os
%test-raid-root-os
@@ -196,6 +197,7 @@ reboot\n")
(kernel-arguments '("console=ttyS0")))
#:imported-modules '((gnu services herd)
(guix combinators))))
+ (installation-disk-image-file-system-type "ext4")
(target-size (* 1200 MiB)))
"Run SCRIPT (a shell script following the GuixSD installation procedure) in
OS to install TARGET-OS. Return a VM image of TARGET-SIZE bytes containing
@@ -213,7 +215,9 @@ packages defined in installation-os."
(image (system-disk-image
(operating-system-with-gc-roots
os (list target))
- #:disk-image-size (* 1500 MiB))))
+ #:disk-image-size (* 1500 MiB)
+ #:file-system-type
+ installation-disk-image-file-system-type)))
(define install
(with-imported-modules '((guix build utils)
(gnu build marionette))
@@ -229,16 +233,25 @@ packages defined in installation-os."
(define marionette
(make-marionette
- (cons (which #$(qemu-command system))
- (cons* "-no-reboot" "-m" "800"
- "-drive"
- (string-append "file=" #$image
- ",if=virtio,readonly")
- "-drive"
- (string-append "file=" #$output ",if=virtio")
- (if (file-exists? "/dev/kvm")
- '("-enable-kvm")
- '())))))
+ `(,(which #$(qemu-command system))
+ "-no-reboot"
+ "-m" "800"
+ #$@(cond
+ ((string=? "ext4" installation-disk-image-file-system-type)
+ `("-drive"
+ ,(file-append "file=" image
+ ",if=virtio,readonly")))
+ ((string=? "iso9660" installation-disk-image-file-system-type)
+ `("-cdrom" ,image))
+ (else
+ (error
+ "unsupported installation-disk-image-file-system-type:"
+ installation-disk-image-file-system-type)))
+ "-drive"
+ ,(string-append "file=" #$output ",if=virtio")
+ ,@(if (file-exists? "/dev/kvm")
+ '("-enable-kvm")
+ '()))))
(pk 'uname (marionette-eval '(uname) marionette))
@@ -313,6 +326,81 @@ per %test-installed-os, this test is expensive in terms of CPU and storage.")
"installed-extlinux-os")))))
+;;;
+;;; Installation through an ISO image.
+;;;
+
+(define-os-with-source (%minimal-os-on-vda %minimal-os-on-vda-source)
+ ;; The OS we want to install.
+ (use-modules (gnu) (gnu tests) (srfi srfi-1))
+
+ (operating-system
+ (host-name "liberigilo")
+ (timezone "Europe/Paris")
+ (locale "en_US.UTF-8")
+
+ (bootloader (grub-configuration (target "/dev/vda")))
+ (kernel-arguments '("console=ttyS0"))
+ (file-systems (cons (file-system
+ (device "my-root")
+ (title 'label)
+ (mount-point "/")
+ (type "ext4"))
+ %base-file-systems))
+ (users (cons (user-account
+ (name "alice")
+ (comment "Bob's sister")
+ (group "users")
+ (supplementary-groups '("wheel" "audio" "video"))
+ (home-directory "/home/alice"))
+ %base-user-accounts))
+ (services (cons (service marionette-service-type
+ (marionette-configuration
+ (imported-modules '((gnu services herd)
+ (guix combinators)))))
+ %base-services))))
+
+(define %simple-installation-script-for-/dev/vda
+ ;; Shell script of a simple installation.
+ "\
+. /etc/profile
+set -e -x
+guix --version
+
+export GUIX_BUILD_OPTIONS=--no-grafts
+guix build isc-dhcp
+parted --script /dev/vda mklabel gpt \\
+ mkpart primary ext2 1M 3M \\
+ mkpart primary ext2 3M 1G \\
+ set 1 boot on \\
+ set 1 bios_grub on
+mkfs.ext4 -L my-root /dev/vda2
+mount /dev/vda2 /mnt
+df -h /mnt
+herd start cow-store /mnt
+mkdir /mnt/etc
+cp /etc/target-config.scm /mnt/etc/config.scm
+guix system init /mnt/etc/config.scm /mnt --no-substitutes
+sync
+reboot\n")
+
+(define %test-iso-image-installer
+ (system-test
+ (name "iso-image-installer")
+ (description
+ "")
+ (value
+ (mlet* %store-monad ((image (run-install
+ %minimal-os-on-vda
+ %minimal-os-on-vda-source
+ #:script
+ %simple-installation-script-for-/dev/vda
+ #:installation-disk-image-file-system-type
+ "iso9660"))
+ (command (qemu-command/writable-image image)))
+ (run-basic-test %minimal-os-on-vda command name)))))
+
+
;;;
;;; Separate /home.
;;;
--
2.14.1
C
C
Christopher Baines wrote on 3 Sep 2017 12:50
[PATCH 4/5] vm: Call iso9660-image with #:register-closures? as #t.
(address . 28288@debbugs.gnu.org)
20170903105041.2925-4-mail@cbaines.net
* gnu/system/vm.scm (system-disk-image): Call iso9660-image with
#:register-closures? as #t.
---
gnu/system/vm.scm | 1 +
1 file changed, 1 insertion(+)

Toggle diff (14 lines)
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index fc55935aa..9cd973385 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -399,6 +399,7 @@ to USB sticks meant to be read-only."
#:file-system-label root-label
#:file-system-uuid #f
#:os-drv os-drv
+ #:register-closures? #t
#:bootcfg-drv bootcfg
#:bootloader (bootloader-configuration-bootloader
(operating-system-bootloader os))
--
2.14.1
C
C
Christopher Baines wrote on 3 Sep 2017 12:58
Re: [bug#28288] [PATCH 5/5] tests: Add test for installing from an ISO Image.
(address . 28288@debbugs.gnu.org)
20170903115838.0bc74483@cbaines.net
On Sun, 3 Sep 2017 11:50:41 +0100
Christopher Baines <mail@cbaines.net> wrote:

Toggle quote (8 lines)
> * gnu/tests/install.scm (%test-iso-image-installer): New variable.
> (run-install): Add #:installation-disk-image-file-system-type as a
> keyword argument.
> ---
> gnu/tests/install.scm | 110
> +++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 99
> insertions(+), 11 deletions(-)

This test now passes! I've also successfully generated an ISO image
that I used to install GuixSD to a Bytemark VM [1].

Most of the changes are educated guesses, mostly from copying the code
relating to QEMU images, so it would good to get some review of these.

-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlmr4F5fFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9XezBQ/9FNUWhMFPImQn8HHLbMtaMa2Qdd8j5U6nZvbGuyqcBU/YnG0F03MQddUI
n+RnwGu6vkdIAr+Mpyj5fjrYjJ651nfl5exfaiEia6A/swgCNR23LkdsbYB9dOI3
2qZZZwhG8MHUjm9cpLSKfrPcGpbCN/OZ0dTxm74bFO4G+Ngg8vWXmof35o4AVp0S
Jt1nYW+Gh7cgHEBUruBFzm9r9GY2sy443lVO/PueJHjTkvpCs1+949QWhnmB09eP
6DSQGxH8FRe/b525RfdhTodTlXgC8zm7GmSGXPHzoGAAK79V7R/+dHkFA3bRMuto
Urd5h0ZtL4oyOF9YTnl8QGcqmX8cv6il8U9DylY/kFv2Do0IW0C6phcF+G12GovG
tBjivLS1K7HOOs+6+0nAaBA58u30Yco6CvZh7RxmvV9PGUsI4Q30Jn4G1QeSM/qp
Hm3es321OqwKR6iwT0JjltRMZi1pLFSna5umOAYzSQdsi70eXBiaWv6SJ/xX0Yc1
B/J2+WpSw7sBUZdrDdHH+ZArhFTTitzav2AJsrwlNRM7DQP3Cdu72C9jJ0DBTO5/
tFfNgIVqW8bmtvOJyeFoRpT39dVnnlvgz3hpstdel5jb2kTw5muwuTwA4KX+XbEI
h67lh8T0V75KZWtKjy3rOU36e+9Y6AiAW4DGakRrcjLccQa8djI=
=1e8G
-----END PGP SIGNATURE-----


D
D
Danny Milosavljevic wrote on 5 Sep 2017 14:56
Re: [bug#28288] [PATCH 4/5] vm: Call iso9660-image with #:register-closures? as #t.
(name . Christopher Baines)(address . mail@cbaines.net)(address . 28288@debbugs.gnu.org)
20170905145654.507c1c51@scratchpost.org
LGTM!
D
D
Danny Milosavljevic wrote on 5 Sep 2017 14:57
Re: [bug#28288] [PATCH 3/5] vm: Add support for registering closures to iso9660-image.
(name . Christopher Baines)(address . mail@cbaines.net)(address . 28288@debbugs.gnu.org)
20170905145736.3956109f@scratchpost.org
LGTM!
D
D
Danny Milosavljevic wrote on 5 Sep 2017 14:58
Re: [bug#28288] [PATCH 2/5] vm: Create /mnt in the generated ISO image in make-iso9660-image.
(name . Christopher Baines)(address . mail@cbaines.net)(address . 28288@debbugs.gnu.org)
20170905145804.4a65b5bc@scratchpost.org
LGTM!
L
L
Ludovic Courtès wrote on 5 Sep 2017 15:17
Re: [bug#28288] [PATCH 1/5] vm: Add support for registering closures to make-iso9660-image.
(name . Christopher Baines)(address . mail@cbaines.net)(address . 28288@debbugs.gnu.org)
877exds2s3.fsf@gnu.org
Hi!

Christopher Baines <mail@cbaines.net> skribis:

Toggle quote (6 lines)
> This mimics the functionality in the root-partition-initializer used in
> creating the QEMU image. This helps when trying to run guix system init from
> the generated ISO image.
>
> * gnu/build/vm.scm (make-iso9660-image): Add support for registering closures.

[...]

Toggle quote (9 lines)
> + (when register-closures?
> + (display "registering closures...\n")
> + (for-each (lambda (closure)
> + (register-closure
> + "/tmp/root"
> + (string-append "/xchg/" closure)
> + #:deduplicate? #f))
> + closures))

Was there any specific reason for #:deduplicate? #f here?

Otherwise LGTM!

Ludo’.
L
L
Ludovic Courtès wrote on 5 Sep 2017 15:18
Re: [bug#28288] [PATCH 5/5] tests: Add test for installing from an ISO Image.
(name . Christopher Baines)(address . mail@cbaines.net)(address . 28288@debbugs.gnu.org)
873781s2qp.fsf@gnu.org
Christopher Baines <mail@cbaines.net> skribis:

Toggle quote (14 lines)
> On Sun, 3 Sep 2017 11:50:41 +0100
> Christopher Baines <mail@cbaines.net> wrote:
>
>> * gnu/tests/install.scm (%test-iso-image-installer): New variable.
>> (run-install): Add #:installation-disk-image-file-system-type as a
>> keyword argument.
>> ---
>> gnu/tests/install.scm | 110
>> +++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 99
>> insertions(+), 11 deletions(-)
>
> This test now passes! I've also successfully generated an ISO image
> that I used to install GuixSD to a Bytemark VM [1].

Woohoo, really nice! \o/

Thanks for persevering!

Ludo’.
L
L
Ludovic Courtès wrote on 5 Sep 2017 15:18
Re: [bug#28288] [PATCH 4/5] vm: Call iso9660-image with #:register-closures? as #t.
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
87y3ptqo5s.fsf@gnu.org
Danny Milosavljevic <dannym@scratchpost.org> skribis:

Toggle quote (2 lines)
> LGTM!

+1!

Excellent.

Ludo'.
C
C
Christopher Baines wrote on 6 Sep 2017 09:05
Re: [bug#28288] [PATCH 1/5] vm: Add support for registering closures to make-iso9660-image.
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 28288@debbugs.gnu.org)
20170906080515.4764be7b@cbaines.net
On Tue, 05 Sep 2017 15:17:32 +0200
ludo@gnu.org (Ludovic Courtès) wrote:

Toggle quote (24 lines)
> Hi!
>
> Christopher Baines <mail@cbaines.net> skribis:
>
> > This mimics the functionality in the root-partition-initializer
> > used in creating the QEMU image. This helps when trying to run guix
> > system init from the generated ISO image.
> >
> > * gnu/build/vm.scm (make-iso9660-image): Add support for
> > registering closures.
>
> [...]
>
> > + (when register-closures?
> > + (display "registering closures...\n")
> > + (for-each (lambda (closure)
> > + (register-closure
> > + "/tmp/root"
> > + (string-append "/xchg/" closure)
> > + #:deduplicate? #f))
> > + closures))
>
> Was there any specific reason for #:deduplicate? #f here?

Yep, the image creation process fails if this is not specified.

error: cannot link
`/tmp/root/gnu/store/.links/1wj8bqv0ygz606a0day0gk7w37prsnbg5z2im2yf025r0y6lqfs0'
to
`/tmp/root/gnu/store/00lgsgxvv1hfhl22yqmzsa3lrs5qa9my-firmware/lib/firmware/b43-open':
Invalid cross-device link

There is probably another way around this though. I'm not sure what
impact skipping the deduplication has on the size of the image.

Toggle quote (3 lines)
> Otherwise LGTM!
>
> Ludo’.
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlmvnjxfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9XfJ/w/+KF+vED7ESj9+SI91bVgaGeUoTa1iMI9IZypuknPkjntJPiobGCAx5P2y
Iq7b/y+svPgQEPNdXI7yOacbKrz8UyY7prnXgAuQeE73u+bPiKef999fCRVRVkUv
qWeNXMNCL9FlqHz4ASQxlsAKqVW974w2e2fgO6qYyeR6gVoV1+Cqe0rJS4EG0dK9
YgTKu+3WXepGhsAOU2LEqCYo3+PTCROjjx6Xb2Y25G2I7WZOIquyUjR++78X7+h6
BBmRY3kZ1IUA4NQ48IssbIpf9voB7rD6j/XYppDncKqSSoic3CwueczsyakF5LaT
xODRlTJiI8U3JUtrdhDlWuivfl0HQu9cXjzTqPxpspgoL01O0K0Ma3gm7a/fmCg+
rfs+iGJj8kgvyCaMIxe/UzRvFTHdpcUA1kbD4nIL6d4DaPWcR30g719Fb+2Yeidy
am3Wg1xC30cWqztNfLnklVeRY8oLFDGq8oORFiObpjB4bm8p3IEF7FHtFWjuj5kc
Y3N4WkfXQS6OHZyq4XDDv17qPMq2npsc9cS7/1YiBLjUOA+vmkqwBxYv5yJPjxIp
/wY5ZyDlHB3S1tpWdG4/sUAzaSd3DNV5KjyI7Oq8ZWqGfbUufg860JTaq3o6T1/W
XxSHsQ6kr+yZsPXW08pmE0fQebcgTIJ7U/yC9uBhWJv9klKNGRE=
=AC6Y
-----END PGP SIGNATURE-----


C
C
Christopher Baines wrote on 6 Sep 2017 09:46
Re: [bug#28288] [PATCH 5/5] tests: Add test for installing from an ISO Image.
(address . 28288-done@debbugs.gnu.org)
20170906084649.5835480e@cbaines.net
On Tue, 05 Sep 2017 15:18:22 +0200
ludo@gnu.org (Ludovic Courtès) wrote:

Toggle quote (20 lines)
> Christopher Baines <mail@cbaines.net> skribis:
>
> > On Sun, 3 Sep 2017 11:50:41 +0100
> > Christopher Baines <mail@cbaines.net> wrote:
> >
> >> * gnu/tests/install.scm (%test-iso-image-installer): New variable.
> >> (run-install): Add #:installation-disk-image-file-system-type as
> >> a keyword argument.
> >> ---
> >> gnu/tests/install.scm | 110
> >> +++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed,
> >> 99 insertions(+), 11 deletions(-)
> >
> > This test now passes! I've also successfully generated an ISO image
> > that I used to install GuixSD to a Bytemark VM [1].
>
> Woohoo, really nice! \o/
>
> Thanks for persevering!

Danny, Ludo, thanks for reviewing :) I've now pushed these changes.
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlmvp+lfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9Xf5WxAApqKcpX6cGIRvUvkr17Sj1S5gahcddKUvsWLBo+I4yEMIz0GrNzZSd7eD
vskZUBh9WAfCjGHBwO7+3gs/56OefK+2sn30k9JKqjmLOwQYS6wlaeAySEVTN4KT
Hl6IGKK5Deb92Jal41EtiSzntv+zCmjTmWYI1T7QYBzFP+Fl+4xHwLezVwjKeDVU
CN4jqabRMnAcdc9z7iNdINf0gqDXv137jPpJ3Z9+/ONFHhe4mPIPxLY0ChOl7wIv
arnLLvs/gTMVapFS60L8M/9bPVbT2275GIn1KoZDXyTQ6ySQoOANCfDx3RS/8gPS
Ka2KKn4TYkr5cIV/bL+b8DQdFI8eGBJT255lVpR90Bc+EdD1dX2EfUvZRQhQAjvg
SN52biPO+xB+pi+tg3/dRLZoaJW3ckGKq+c9LLjXCma/Yx4sdLR13rRlqjbASK8G
mplHV4e6oyGM2jrom225tsWkl4vJCqpzcZOZKEVl9iihVBCpBVSiXHkBUaBbFojR
hyame2bkbzzYW7CuphPfQZHgVByQrsOY/XLFDbsceU7dgFNEZ8cGt9Ylf499YNYw
YDsA+YPNzqQP68U+qFhEXRpxG2yZJGWRgdKFmgig6QnUIecyD6PkLBhMOLPmT4K2
h6DsC3Bl/ONFTCJtzfASqQHeSvB1TYbpiyG3kgyK1jmfwNlVOMM=
=q8sS
-----END PGP SIGNATURE-----


Closed
L
L
Ludovic Courtès wrote on 6 Sep 2017 15:20
Re: [bug#28288] [PATCH 1/5] vm: Add support for registering closures to make-iso9660-image.
(name . Christopher Baines)(address . mail@cbaines.net)(address . 28288@debbugs.gnu.org)
87wp5c0xqr.fsf@gnu.org
Christopher Baines <mail@cbaines.net> skribis:

Toggle quote (35 lines)
> On Tue, 05 Sep 2017 15:17:32 +0200
> ludo@gnu.org (Ludovic Courtès) wrote:
>
>> Hi!
>>
>> Christopher Baines <mail@cbaines.net> skribis:
>>
>> > This mimics the functionality in the root-partition-initializer
>> > used in creating the QEMU image. This helps when trying to run guix
>> > system init from the generated ISO image.
>> >
>> > * gnu/build/vm.scm (make-iso9660-image): Add support for
>> > registering closures.
>>
>> [...]
>>
>> > + (when register-closures?
>> > + (display "registering closures...\n")
>> > + (for-each (lambda (closure)
>> > + (register-closure
>> > + "/tmp/root"
>> > + (string-append "/xchg/" closure)
>> > + #:deduplicate? #f))
>> > + closures))
>>
>> Was there any specific reason for #:deduplicate? #f here?
>
> Yep, the image creation process fails if this is not specified.
>
> error: cannot link
> `/tmp/root/gnu/store/.links/1wj8bqv0ygz606a0day0gk7w37prsnbg5z2im2yf025r0y6lqfs0'
> to
> `/tmp/root/gnu/store/00lgsgxvv1hfhl22yqmzsa3lrs5qa9my-firmware/lib/firmware/b43-open':
> Invalid cross-device link

Hmm, OK. Looks like it’s trying to deduplicate between /tmp/root and
some other store. (Or are we using a bind mount here?)

Toggle quote (3 lines)
> There is probably another way around this though. I'm not sure what
> impact skipping the deduplication has on the size of the image.

It probably doesn’t matter much, so it’s not a blocker IMO.

Maybe leave an XXX comment mentioning the cross-device link issue.

Thanks!

Ludo’.
C
C
Christopher Baines wrote on 10 Sep 2017 12:45
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 28288@debbugs.gnu.org)
20170910114532.58628283@cbaines.net
On Wed, 06 Sep 2017 15:20:44 +0200
ludo@gnu.org (Ludovic Courtès) wrote:

Toggle quote (40 lines)
> Christopher Baines <mail@cbaines.net> skribis:
>
> > On Tue, 05 Sep 2017 15:17:32 +0200
> > ludo@gnu.org (Ludovic Courtès) wrote:
> >
> >> Hi!
> >>
> >> Christopher Baines <mail@cbaines.net> skribis:
> >>
> >> > This mimics the functionality in the root-partition-initializer
> >> > used in creating the QEMU image. This helps when trying to run
> >> > guix system init from the generated ISO image.
> >> >
> >> > * gnu/build/vm.scm (make-iso9660-image): Add support for
> >> > registering closures.
> >>
> >> [...]
> >>
> >> > + (when register-closures?
> >> > + (display "registering closures...\n")
> >> > + (for-each (lambda (closure)
> >> > + (register-closure
> >> > + "/tmp/root"
> >> > + (string-append "/xchg/" closure)
> >> > + #:deduplicate? #f))
> >> > + closures))
> >>
> >> Was there any specific reason for #:deduplicate? #f here?
> >
> > Yep, the image creation process fails if this is not specified.
> >
> > error: cannot link
> > `/tmp/root/gnu/store/.links/1wj8bqv0ygz606a0day0gk7w37prsnbg5z2im2yf025r0y6lqfs0'
> > to
> > `/tmp/root/gnu/store/00lgsgxvv1hfhl22yqmzsa3lrs5qa9my-firmware/lib/firmware/b43-open':
> > Invalid cross-device link
>
> Hmm, OK. Looks like it’s trying to deduplicate between /tmp/root and
> some other store. (Or are we using a bind mount here?)

I think there is a bind mount in use here, so maybe that has something
to do with it.

Toggle quote (7 lines)
> > There is probably another way around this though. I'm not sure what
> > impact skipping the deduplication has on the size of the image.
>
> It probably doesn’t matter much, so it’s not a blocker IMO.
>
> Maybe leave an XXX comment mentioning the cross-device link issue.

Yep, I'll put in a comment :)
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlm1F8xfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9XewhQ/+LlfUZtsQ0zvNhcjJ0DCCK7uHbL27VgBnJhYbbq37WEWOjXTx8y2/MtTG
6o0KBhoudHLjy375ktzSpu9zfI76qFsHUiPbosB4XlelJWrfNZpjVCM8Ro4nmeFj
Md+lmDbpCmVKsG1obwwPLvOHRYeziKv50tq5sNbgikvHOepBNgk6WMXiJ9QeiSl9
zT/VzOLXgpo6eIWY6/UYUUJfOqBbq3WUQiq3vDD8dmUViTE/2SMPUXYozeTo4iTL
m7bFTcsf1mBc2SVKEze36IEtctmXG4CSl3wqPtQADtN44/FeVuEf4Nr80Xb+6eYl
jlh2mA0NIZR9Qn22cuAs5Ovil41alLf5Yhwn3s655QTEMbY5tVsVMAoN4w+YdihR
7M7QcSrPnTtndCWcmRfuqkX4FwPgDGZHhId1obf6zjSrNNZKEIGUmNFqPgDHb4Mb
QkASak5pser3OSNtWTgyicF9l4uPey24U1/iehgIwLni4dKh7Tc5fOki8mfkS7Eh
t8Aw8Oh8n+ihNmgkP4ysDoLdCKQnxrS4vnfQN5Disc/TITvyK1z6pp0S5f5m7IgD
d03qpls9DjmPvvVcJVKE+OK/q2GrtjCzOPzn534JHAa+07Fha7qUQTUieUGGiuTv
Ody6GYXbvGJ3yabDXq1uW9OqXTGMjEnQMnRs0xWUhsVD3p20FfQ=
=9AZJ
-----END PGP SIGNATURE-----


?