unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Use genimage for disk-image creation.
@ 2020-03-25 13:18 Mathieu Othacehe
  2020-03-26  9:55 ` Vincent Legoll
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Mathieu Othacehe @ 2020-03-25 13:18 UTC (permalink / raw)
  To: guix-devel


Hello,

I recently spent some time generating a lot of Guix System disk-images
(embedded system images, installation tests). The mechanism Guix and Nix
are using: spawning a VM to create the disk-image does not scale at all
when the disk-image size increase.

So, I looked at what the competition does. Buildroot is using
genimage[1] to generate disk-images. Yocto is using wic[2], that's based
on mic[3]. Both are able to create disk-images as unprivileged users,
without resorting to VM.

While, Yocto solution is tied to the rest of their framework, genimage
is standalone. In fact, Danny has already packaged it and made some
research about it.

I think we could use genimage to replace our current mechanism to
generate disk-images. Here's a small proof of concept.

Let say I want to create a disk-image with one ext4 partition starting
at offset 10M. I can write the following genimage config file:

--8<---------------cut here---------------start------------->8---
image system {
	hdimage {}

	partition rootfs {
		partition-type = 0x83
		image = "rootfs.ext4"
		size = 8G
		offset = 10M
	}
}

image rootfs.ext4 {
        name = "rootfs"
        ext4 {
                label = "rootfs"
		use-mke2fs = true
        }
        size = 8G
        mountpoint = "/"
}
--8<---------------cut here---------------end--------------->8---

and run the command:

--8<---------------cut here---------------start------------->8---
fakeroot genimage --config ~/tmp/genimage.cfg --rootpath=/home/mathieu/image-root/
--8<---------------cut here---------------end--------------->8---

where image-root is a directory containing the result of a `guix system
init`. The directory size is about 6GiB.

It takes 8 minutes to generate this disk-image, versus 2h30 using `guix
system disk-image`.

I'm aware that this might not be a fair comparison but, I think its
already significant.

Danny, Ludo, WDYT? Could we modify "system-disk-image" to use genimage
as a backend instead of spawning a VM?

Thanks,

Mathieu

[1]: https://github.com/pengutronix/genimage
[2]: https://www.yoctoproject.org/docs/2.4.2/dev-manual/dev-manual.html#creating-partitioned-images-using-wic
[3]: https://source.tizen.org/documentation/reference/mic-image-creator
[4]: https://lists.gnu.org/archive/html/guix-devel/2019-09/msg00009.html

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

end of thread, other threads:[~2020-03-31 15:24 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-25 13:18 Use genimage for disk-image creation Mathieu Othacehe
2020-03-26  9:55 ` Vincent Legoll
2020-03-26 10:18   ` Efraim Flashner
2020-03-28 20:47   ` Mathieu Othacehe
2020-03-28 21:25     ` Vincent Legoll
2020-03-26 14:19 ` Ludovic Courtès
2020-03-26 15:01   ` Vincent Legoll
2020-03-29 18:13   ` Mathieu Othacehe
2020-03-26 23:24 ` Danny Milosavljevic
2020-03-29 14:44   ` Ludovic Courtès
2020-03-29 15:07     ` Danny Milosavljevic
2020-03-29 19:06       ` Vagrant Cascadian
2020-03-31 15:24         ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).