From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mathieu Othacehe Subject: Image generation Date: Tue, 21 Apr 2020 20:59:31 +0200 Message-ID: <878sior7fw.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:48682) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQy7M-000236-CA for guix-devel@gnu.org; Tue, 21 Apr 2020 14:59:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jQy7L-00043f-Oa for guix-devel@gnu.org; Tue, 21 Apr 2020 14:59:36 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:33052) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jQy7L-00042B-B0 for guix-devel@gnu.org; Tue, 21 Apr 2020 14:59:35 -0400 Received: by mail-wr1-x42f.google.com with SMTP id s10so8687370wrr.0 for ; Tue, 21 Apr 2020 11:59:34 -0700 (PDT) Received: from meru ([2a01:cb18:832e:5f00:1d35:d245:4470:8434]) by smtp.gmail.com with ESMTPSA id y40sm5450961wrd.20.2020.04.21.11.59.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2020 11:59:32 -0700 (PDT) List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane-mx.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org Hello, I made some progress on the image generation topic. As discussed previously, the goal is to use the same principles as genimage[1], to achieve faster image generation, without resorting to VM. A very related topic, is to bring the possibility to create Guix System images with custom layouts. That includes position, size and type of the bootloader partition, offset of the root partition and so on. While this is not really important for desktop usage, it is almost mandatory for embedded usage. The wip-disk-image branch allows to define a Guix System image along the lines of: --8<---------------cut here---------------start------------->8--- (define my-image (image (format 'disk-image) (operating-system my-os) (partitions (list (partition (size (* 40 (expt 2 20))) (label "GNU-ESP") (file-system "vfat") (flags '(esp)) (initializer (gexp initialize-efi-partition))) (partition (size 'guess) (label "Guix_image") (file-system "ext4") (flags '(boot)) (initializer (gexp initialize-root-partition))))))) --8<---------------cut here---------------end--------------->8--- then, you can call '(system-image my-image) and get a bootable disk-image. On this branch, it is already possible to generate an EFI disk-image, with the traditional command: --8<---------------cut here---------------start------------->8--- ./pre-inst-env guix system disk-image gnu/system/examples/desktop.tmpl --8<---------------cut here---------------end--------------->8--- On my computer, this takes 6m50 versus 2h30 for the master version. I tested the image in QEMU, everything seems fine. Now there's still plenty of work. This branch needs some more cleaning. Then we need to: * Add support for ISO images. * Extend support to grub (non-efi), extlinux and u-boot bootloaders. * Check everything works with --system and --target arguments. I've re-implemented some parts of genimage in (gnu build disk-image) module. Now, we could also go further and remove the use of this tool completely. Please tell me what you think, Thanks, Mathieu [1]: https://github.com/pengutronix/genimage