From unknown Tue Jun 24 17:29:30 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#42634] [PATCH 0/3] Add image-type support. Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 31 Jul 2020 14:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 42634 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42634@debbugs.gnu.org Cc: Mathieu Othacehe X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.159620692124237 (code B ref -1); Fri, 31 Jul 2020 14:49:01 +0000 Received: (at submit) by debbugs.gnu.org; 31 Jul 2020 14:48:41 +0000 Received: from localhost ([127.0.0.1]:38400 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k1WKu-0006Ir-ML for submit@debbugs.gnu.org; Fri, 31 Jul 2020 10:48:40 -0400 Received: from lists.gnu.org ([209.51.188.17]:56312) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k1WKr-0006Ii-1A for submit@debbugs.gnu.org; Fri, 31 Jul 2020 10:48:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58024) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k1WKq-0004gs-Le for guix-patches@gnu.org; Fri, 31 Jul 2020 10:48:36 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:51637) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k1WKo-00012B-U9; Fri, 31 Jul 2020 10:48:36 -0400 Received: by mail-wm1-x329.google.com with SMTP id p14so8778196wmg.1; Fri, 31 Jul 2020 07:48:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yDcs2mNrjr3GAahU96fY0uw6/PIKrMfx0hVojQ0GlyU=; b=d7rSk/Vm58YWXo/NdwVAxdjG1SQvHVB9epbQOJy0FhY/ALZOvCY6smLpDT++yDsFdQ WoFi1UCed1shKsjdjkFQ2FBhQp3aCjB/SgtzgOAEHLsAVGKTvrVqg/OATKwjZnuFPwbF VfQScyKDNbn2oi78xiNvpqFsZghdGGvQyepmDDE5a/RpYx4Ds6FTc5HvJt7NRwp76jnh GZQm+7Ve/aIF9ELm1o1wR7TJiAZUQMTYV6dltMaroRS4aLm/EpXAIyuvSCgmF4QMr7Sr O3oKKMJdMal9FCbxTMinuc/XqrYfb8L2N965RXmLqujV/RBFblYnUos/Pkrz/EBvEuup Q56g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yDcs2mNrjr3GAahU96fY0uw6/PIKrMfx0hVojQ0GlyU=; b=qijzKlUM1B0Mzm8F98aDPJVsa8WHBf0iOd7nKyxpmoYHbTO6QurU7WPRF76Im/CrbT CLlFCr/iGnEhN5mXAqRjqQ/jiF7JPyGjdV06N0S90efQV/zBc5QckL5yeNpN0QShQFMH Z2oJ/aCYE/Qda/dXWbUBV9nH1HepQRkyaChfUJWBTfBOrg2rL8laDymAI3pbBCkgo6vd HiYmAZIWva8JPIPa+dOC8H5s2JvwcGB3LGKhTos5dp+Tjq8A4yAeZH7gNXhQ4RKeg6TX i2xpsobKNtQjr3xgBzNVraEPwEn+JmyZKNtWkH/bHO9Jb/1kXICk9jAsEU/K0tdsRxfi rvKw== X-Gm-Message-State: AOAM5317vqa8WYqOZbN7uZc9rMIj4wBE5YKfVXtBvyxJCWoLTR8gMB9I NABGEM8vVwcWDGeTD7AEu8UrfVXV X-Google-Smtp-Source: ABdhPJzbjcX+rHGYpUN57Qyi3olJiu6rm3wAV/2yvs3k/nMBZEjk7sUbWHNBpcb6VDOmd9jQQ0LX9Q== X-Received: by 2002:a1c:7d81:: with SMTP id y123mr4011984wmc.87.1596206911935; Fri, 31 Jul 2020 07:48:31 -0700 (PDT) Received: from cervin.home ([2a01:cb18:832e:5f00:c08f:7d21:ea98:a1c5]) by smtp.gmail.com with ESMTPSA id 12sm3123595wme.22.2020.07.31.07.48.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jul 2020 07:48:31 -0700 (PDT) From: Mathieu Othacehe X-Google-Original-From: Mathieu Othacehe Date: Fri, 31 Jul 2020 16:48:25 +0200 Message-Id: <20200731144825.703211-1-othacehe@gnu.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=m.othacehe@gmail.com; helo=mail-wm1-x329.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Hello, This is the missing piece for the new image API. It has been previously discussed here[1]. I think this is close to what Ludo suggested and it addresses janneke concerns about composability. The idea is to introduce the concept of "image-type". An image type is a converter from an record to an record. I have created in this serie 4 new image type records: - raw - iso9660 - uncompressed-iso9660 - hurd-raw I also adapted the "guix system" command by removing the "file-system-type" argument and replaced it by the "image-type" argument. The default is still to create a raw disk-image, but one can now call: guix system disk-image -t iso9660 my-config.scm guix system disk-image -t uncompressed-iso9660 my-config.scm guix system disk-image -t hurd-raw my-config.scm and so on. Maybe we should also rename "disk-image" command to "image" that would be somehow more accurate. The only missing bit is the documentation update, as I prefer to wait for this change to be approved first. WDYT? Thanks, Mathieu [1]: https://lists.gnu.org/archive/html/guix-devel/2020-05/msg00417.html Mathieu Othacehe (3): image: Add image-type support. system: image: Add image-type support. scripts: system: Add support for image-type. gnu/image.scm | 29 ++++++++++++++- gnu/system/image.scm | 75 ++++++++++++++++++++++++++++++++++++-- gnu/system/images/hurd.scm | 13 +++++-- guix/scripts/system.scm | 56 +++++++++++++++++----------- 4 files changed, 145 insertions(+), 28 deletions(-) -- 2.26.2 From unknown Tue Jun 24 17:29:30 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#42634] [PATCH 1/3] image: Add image-type support. References: <20200731144825.703211-1-othacehe@gnu.org> In-Reply-To: <20200731144825.703211-1-othacehe@gnu.org> Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 31 Jul 2020 14:50:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42634 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42634@debbugs.gnu.org Cc: Mathieu Othacehe Received: via spool by 42634-submit@debbugs.gnu.org id=B42634.159620698724391 (code B ref 42634); Fri, 31 Jul 2020 14:50:03 +0000 Received: (at 42634) by debbugs.gnu.org; 31 Jul 2020 14:49:47 +0000 Received: from localhost ([127.0.0.1]:38409 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k1WLy-0006LL-PX for submit@debbugs.gnu.org; Fri, 31 Jul 2020 10:49:47 -0400 Received: from mail-wr1-f51.google.com ([209.85.221.51]:35535) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k1WLw-0006L6-Ri for 42634@debbugs.gnu.org; Fri, 31 Jul 2020 10:49:45 -0400 Received: by mail-wr1-f51.google.com with SMTP id f1so27700490wro.2 for <42634@debbugs.gnu.org>; Fri, 31 Jul 2020 07:49:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8b2BV/WlZ9M1vWEGVfEgHbdiMBnuYCqTL08PwiTe/6k=; b=o046SWUTcn7aBn5keAI/PtHSsLDaFbjyxLyFuTjotZFMAOdNZs4vSG5T2qI+Fg4ARu YjurRtOWgxrHVNzUzW0rVfoDkmrWaXgDFRelwQ8o6xTVL/j9M6xi0V13WMjaN3fbaa+Z aSdGQawjm9G2QCs8nVnclZSYekqrBupN/D1Z3592dZQ0X6uhGOQYMYAMyPk7GG9X7CrY x1p+uSYP37/mitbGDa9Tmh/ERqRyKGNftwz3Sn3wJXy/+FC85vvYVX7aLAQJLc8o0M3/ ZLxubEXDD0ZfyNpy6mM8TWeZHfDslYM20CtDssWiFH1NNQeSguh4nHtmEOFpgiRu8QkD CvEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8b2BV/WlZ9M1vWEGVfEgHbdiMBnuYCqTL08PwiTe/6k=; b=o4kiVdUAny1zt3V9QZAFgqJyhAoze/B4DFBXaxf6pAiuyOVzghtY+7Df4uIClVTbY4 M/XV+H797xBTibYlTI5V4fAtM4xCmzr62a2sy2k7ezs5L4QyC0eBDvQY7YtmU6okXlgt e9S4uYw4SPU9WVvxCsHpl2ajzOPP2GUqg9eQYW71Jj8IrYwmenon3PTeqA7Cjm+xvyOo KBlD89GEp5mjLcxneJ4AYrOn5HOHcAr+HHf8EOTOcfddntDOGeu8Kts6EVxIui0tRmmE UAQ64gNWSRiU/bd8Jx9RJgy6YGWV1E6eTcF0S56z/Bwz3jKOVru0pw7djOj4MaYche// R/4A== X-Gm-Message-State: AOAM5330bA3PimWsuT82e2qhZ8mSGhZ9ZmxDOv2P8eMR0wgJI/caBiUu TvfPdTiAQ8KtoBvFsuOagZ3e8nHd X-Google-Smtp-Source: ABdhPJxWakB/zqRmkwS8slcudy4RnCFi88OHTbJg+c/BF3dEiQ2QxjBxSHU3x0cfdbw6oH4rx/U/Cg== X-Received: by 2002:adf:bbca:: with SMTP id z10mr3687332wrg.425.1596206978406; Fri, 31 Jul 2020 07:49:38 -0700 (PDT) Received: from cervin.home ([2a01:cb18:832e:5f00:c08f:7d21:ea98:a1c5]) by smtp.gmail.com with ESMTPSA id n189sm12648951wmn.40.2020.07.31.07.49.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jul 2020 07:49:37 -0700 (PDT) From: Mathieu Othacehe X-Google-Original-From: Mathieu Othacehe Date: Fri, 31 Jul 2020 16:49:27 +0200 Message-Id: <20200731144929.703345-1-othacehe@gnu.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/image.scm (): New record, (image-type, image-type?, image-type-name, image-type-constructor, os->image): new procedures. --- gnu/image.scm | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/gnu/image.scm b/gnu/image.scm index dc66f2c533..6f8f4828ac 100644 --- a/gnu/image.scm +++ b/gnu/image.scm @@ -39,7 +39,14 @@ image-partitions image-compression? image-volatile-root? - image-substitutable?)) + image-substitutable? + + image-type + image-type? + image-type-name + image-type-constructor + + os->image)) ;;; @@ -84,3 +91,23 @@ (default #t)) (substitutable? image-substitutable? ;boolean (default #t))) + + +;;; +;;; Image type. +;;; + +(define-record-type* + image-type make-image-type + image-type? + (name image-type-name) ;string + (constructor image-type-constructor)) ; -> + + +;;; +;;; Image creation. +;;; + +(define* (os->image os #:key type) + (let ((constructor (image-type-constructor type))) + (constructor os))) -- 2.26.2 From unknown Tue Jun 24 17:29:30 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#42634] [PATCH 2/3] system: image: Add image-type support. Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 31 Jul 2020 14:50:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42634 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42634@debbugs.gnu.org Cc: Mathieu Othacehe Received: via spool by 42634-submit@debbugs.gnu.org id=B42634.159620699124414 (code B ref 42634); Fri, 31 Jul 2020 14:50:03 +0000 Received: (at 42634) by debbugs.gnu.org; 31 Jul 2020 14:49:51 +0000 Received: from localhost ([127.0.0.1]:38412 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k1WM3-0006Lg-1g for submit@debbugs.gnu.org; Fri, 31 Jul 2020 10:49:51 -0400 Received: from mail-wr1-f43.google.com ([209.85.221.43]:36111) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k1WLx-0006L8-To for 42634@debbugs.gnu.org; Fri, 31 Jul 2020 10:49:50 -0400 Received: by mail-wr1-f43.google.com with SMTP id 88so28227266wrh.3 for <42634@debbugs.gnu.org>; Fri, 31 Jul 2020 07:49:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ToTsMo410aZEmHCcvhvcJh6u7fw+3mCmL20awHZ5Bwo=; b=W0XNrlAR8thNsv84IKPhHXR/CvPKsNacR6EY7FZwyNnZ9Fxp9dZko8SINd2uRh7si6 XK0AOm+ZV3ghNQieB64vDY6AV+PXB72DgLCmPjYw0fDdqk0UQvKWLY+inOXNtJwyFTUf fiic4ruwxFy/zUrvns2tAkNGWZ6HOiOwciKP7sS6H1r/iYgFWO+0ssNR5KtA4uJZNyOi qW21uhku5hiobfOzb9R2IeEK7/VxeZTVIGeMtldaeQDnFvw3uSOTJHKYpD1Z1Kw6CP3m BsLv3IJr1wMU8r3CTS1NKvmHE+ozIhyLP7qVRXsndXnscusNWbKyQKEz2vGbhYszYzXO vexA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ToTsMo410aZEmHCcvhvcJh6u7fw+3mCmL20awHZ5Bwo=; b=TW2Shhy0eNgjla2YrUIbdBEaYxXWPK2nN93sTDaxhnuh5CFUkwgWLqwjH+A3YTzb1M Z8RR5z6BXYaq0QvCIIHRXZYD46wxqpro+8PRoPZvCB8SGoyYWkmHhQ/HX2gPxRNifYSR uezMEJHaT3BiDHD4BSziChrOsImh2qYcQvg9RXfZ7E/05bfZnm7j0r39AkimgoH2lEGl OHrcWb8qIZkrSnrAKoGnZERWPi3a/s+gDMnpUvnC4/eAekLXGuAEqt0ttXfp8bt3ar0C MT30VTPi2eqiCdsfWVfXQeJBxPwcnuTGhT5gMwCfMJdEsqrvicyHiwe1WWVajzmv+zLu O2sA== X-Gm-Message-State: AOAM532YeMtY8CRde3BEmy8lF9JrpaMxj1ehHuD6pz4d9J+KeLrjwCtJ 3NE67Bot6KwsvV8xD5AeVdXmkzU4 X-Google-Smtp-Source: ABdhPJwe+SzP/4berr/x+akOk2qy5lukhYsFcQj4tYH17xxAQO6Ojrl4KVgSBcpb2gOCFRa6uNgAZQ== X-Received: by 2002:a05:6000:10cd:: with SMTP id b13mr3757021wrx.216.1596206979631; Fri, 31 Jul 2020 07:49:39 -0700 (PDT) Received: from cervin.home ([2a01:cb18:832e:5f00:c08f:7d21:ea98:a1c5]) by smtp.gmail.com with ESMTPSA id n189sm12648951wmn.40.2020.07.31.07.49.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jul 2020 07:49:39 -0700 (PDT) From: Mathieu Othacehe X-Google-Original-From: Mathieu Othacehe Date: Fri, 31 Jul 2020 16:49:28 +0200 Message-Id: <20200731144929.703345-2-othacehe@gnu.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200731144929.703345-1-othacehe@gnu.org> References: <20200731144929.703345-1-othacehe@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/system/image.scm (image-with-os): New macro. Rename the old "image-with-os" procedure to ... (image-with-os*): ... this new procedure, (system-image): adapt according, (raw-image-type, iso-image-type, uncompressed-iso-image-type %image-types): new variables, (lookup-image-type-by-name): new procedure. (find-image): remove it. * gnu/system/images/hurd.scm (hurd-image-type): New variable, use it to define ... (hurd-disk-image): ... this variable, using "os->image" procedure. * gnu/tests/install.scm (run-install): Rename installation-disk-image-file-system-type parameter to installation-image-type, use os->config instead of find-image to compute the image passed to system-image, (%test-iso-image-installer) adapt accordingly, (guided-installation-test): ditto. --- gnu/system/image.scm | 88 ++++++++++++++++++++++++++++++-------- gnu/system/images/hurd.scm | 13 ++++-- gnu/tests/install.scm | 46 ++++++++++---------- 3 files changed, 103 insertions(+), 44 deletions(-) diff --git a/gnu/system/image.scm b/gnu/system/image.scm index 36f56e237d..deee8a6412 100644 --- a/gnu/system/image.scm +++ b/gnu/system/image.scm @@ -18,6 +18,7 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu system image) + #:use-module (guix discovery) #:use-module (guix gexp) #:use-module (guix modules) #:use-module (guix monads) @@ -62,8 +63,15 @@ efi-disk-image iso9660-image - find-image - system-image)) + image-with-os + raw-image-type + iso-image-type + uncompressed-iso-image-type + + system-image + + %image-types + lookup-image-type-by-name)) ;;; @@ -110,6 +118,37 @@ (label "GUIX_IMAGE") (flags '(boot))))))) + +;;; +;;; Images types. +;;; + +(define-syntax-rule (image-with-os base-image os) + "Return an image inheriting from BASE-IMAGE, with the operating-system field +set to the given OS." + (image + (inherit base-image) + (operating-system os))) + +(define raw-image-type + (image-type + (name "raw") + (constructor (cut image-with-os efi-disk-image <>)))) + +(define iso-image-type + (image-type + (name "iso9660") + (constructor (cut image-with-os iso9660-image <>)))) + +(define uncompressed-iso-image-type + (image-type + (name "uncompressed-iso9660") + (constructor (cut image-with-os + (image + (inherit iso9660-image) + (compression? #f)) + <>)))) + ;; ;; Helpers. @@ -426,7 +465,7 @@ used in the image. " image-size) (else root-size)))) -(define* (image-with-os base-image os) +(define* (image-with-os* base-image os) "Return an image based on BASE-IMAGE but with the operating-system field set to OS. Also set the UUID and the size of the root partition." (define root-file-system @@ -507,7 +546,7 @@ image, depending on IMAGE format." (with-parameters ((%current-target-system target)) (let* ((os (operating-system-for-image image)) - (image* (image-with-os image os)) + (image* (image-with-os* image os)) (register-closures? (has-guix-service-type? os)) (bootcfg (operating-system-bootcfg os)) (bootloader (bootloader-configuration-bootloader @@ -539,18 +578,33 @@ image, depending on IMAGE format." #:grub-mkrescue-environment '(("MKRESCUE_SED_MODE" . "mbr_only")))))))) -(define (find-image file-system-type target) - "Find and return an image built that could match the given FILE-SYSTEM-TYPE, -built for TARGET. This is useful to adapt to interfaces written before the -addition of the record." - (match file-system-type - ("iso9660" iso9660-image) - (_ (cond - ((and target - (hurd-triplet? target)) - (module-ref (resolve-interface '(gnu system images hurd)) - 'hurd-disk-image)) - (else - efi-disk-image))))) + +;; +;; Image detection. +;; + +(define (image-modules) + "Return the list of image modules." + (cons (resolve-interface '(gnu system image)) + (all-modules (map (lambda (entry) + `(,entry . "gnu/system/images/")) + %load-path) + #:warn warn-about-load-error))) + +(define %image-types + ;; The list of publically-known image types. + (delay (fold-module-public-variables (lambda (obj result) + (if (image-type? obj) + (cons obj result) + result)) + '() + (image-modules)))) + +(define (lookup-image-type-by-name name) + "Return the image type called NAME." + (or (srfi-1:find (lambda (image-type) + (string=? name (image-type-name image-type))) + (force %image-types)) + (leave (G_ "~a: no such image type.~%") name))) ;;; image.scm ends here diff --git a/gnu/system/images/hurd.scm b/gnu/system/images/hurd.scm index d87640e8e3..67f657d289 100644 --- a/gnu/system/images/hurd.scm +++ b/gnu/system/images/hurd.scm @@ -29,8 +29,10 @@ #:use-module (gnu system file-systems) #:use-module (gnu system hurd) #:use-module (gnu system image) + #:use-module (srfi srfi-26) #:export (hurd-barebones-os hurd-disk-image + hurd-image-type hurd-barebones-disk-image)) (define hurd-barebones-os @@ -82,8 +84,13 @@ (flags '(boot)) (initializer hurd-initialize-root-partition)))))) +(define hurd-image-type + (image-type + (name "hurd-raw") + (constructor (cut image-with-os hurd-disk-image <>)))) + (define hurd-barebones-disk-image (image - (inherit hurd-disk-image) - (name 'hurd-barebones-disk-image) - (operating-system hurd-barebones-os))) + (inherit + (os->image hurd-barebones-os #:type hurd-image-type)) + (name 'hurd-barebones-disk-image))) diff --git a/gnu/tests/install.scm b/gnu/tests/install.scm index 9656e5f41f..0be9ee2892 100644 --- a/gnu/tests/install.scm +++ b/gnu/tests/install.scm @@ -218,7 +218,7 @@ reboot\n") #:imported-modules '((gnu services herd) (gnu installer tests) (guix combinators)))) - (installation-disk-image-file-system-type "ext4") + (installation-image-type "raw") (install-size 'guess) (target-size (* 2200 MiB))) "Run SCRIPT (a shell script following the system installation procedure) in @@ -228,10 +228,6 @@ packages defined in installation-os." (mlet* %store-monad ((_ (set-grafting #f)) (system (current-system)) - (target (current-target-system)) - (base-image -> (find-image - installation-disk-image-file-system-type - target)) ;; Since the installation system has no network access, ;; we cheat a little bit by adding TARGET to its GC @@ -239,18 +235,20 @@ packages defined in installation-os." ;; succeed. Also add guile-final, which is pulled in ;; through provenance.drv and may not always be present. (target (operating-system-derivation target-os)) + (base-image -> + (os->image + (operating-system-with-gc-roots + os (list target guile-final)) + #:type (lookup-image-type-by-name + installation-image-type))) (image -> - (system-image - (image - (inherit base-image) - (size install-size) - (operating-system - (operating-system-with-gc-roots - os (list target guile-final))) - ;; Do not compress to speed-up the tests. - (compression? #f) - ;; Don't provide substitutes; too big. - (substitutable? #f))))) + (system-image + (image + (inherit base-image) + (size install-size) + + ;; Don't provide substitutes; too big. + (substitutable? #f))))) (define install (with-imported-modules '((guix build utils) (gnu build marionette)) @@ -270,16 +268,16 @@ packages defined in installation-os." "-no-reboot" "-m" "1200" #$@(cond - ((string=? "ext4" installation-disk-image-file-system-type) + ((string=? "raw" installation-image-type) #~("-drive" ,(string-append "file=" #$image ",if=virtio,readonly"))) - ((string=? "iso9660" installation-disk-image-file-system-type) + ((string-contains installation-image-type "iso9660") #~("-cdrom" #$image)) (else (error - "unsupported installation-disk-image-file-system-type:" - installation-disk-image-file-system-type))) + "unsupported installation-image-type:" + installation-image-type))) "-drive" ,(string-append "file=" #$output ",if=virtio") ,@(if (file-exists? "/dev/kvm") @@ -443,8 +441,8 @@ reboot\n") %minimal-os-on-vda-source #:script %simple-installation-script-for-/dev/vda - #:installation-disk-image-file-system-type - "iso9660")) + #:installation-image-type + "uncompressed-iso9660")) (command (qemu-command/writable-image image))) (run-basic-test %minimal-os-on-vda command name))))) @@ -1309,8 +1307,8 @@ build (current-guix) and then store a couple of full system images.") #:os installation-os-for-gui-tests #:install-size install-size #:target-size target-size - #:installation-disk-image-file-system-type - "iso9660" + #:installation-image-type + "uncompressed-iso9660" #:gui-test (lambda (marionette) (gui-test-program -- 2.26.2 From unknown Tue Jun 24 17:29:30 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#42634] [PATCH 3/3] scripts: system: Add support for image-type. Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 31 Jul 2020 14:50:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42634 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42634@debbugs.gnu.org Cc: Mathieu Othacehe Received: via spool by 42634-submit@debbugs.gnu.org id=B42634.159620699224420 (code B ref 42634); Fri, 31 Jul 2020 14:50:03 +0000 Received: (at 42634) by debbugs.gnu.org; 31 Jul 2020 14:49:52 +0000 Received: from localhost ([127.0.0.1]:38414 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k1WM3-0006Lj-IV for submit@debbugs.gnu.org; Fri, 31 Jul 2020 10:49:51 -0400 Received: from mail-wr1-f49.google.com ([209.85.221.49]:34557) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k1WM0-0006LC-5o for 42634@debbugs.gnu.org; Fri, 31 Jul 2020 10:49:50 -0400 Received: by mail-wr1-f49.google.com with SMTP id f7so28284501wrw.1 for <42634@debbugs.gnu.org>; Fri, 31 Jul 2020 07:49:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rj55eyo1MddXUL+Dj/dKuR27TbnyLe8uhAD+U0ZfGFU=; b=VI2oJzT9UKqUDEs5Qhh7LTTLdHrv5xaggkWEKfNuVmQegvGqS9rvMFshqVZpd03OYq RC9aUBBWAi1WcyHQZz5BbGYuUXw7ZguByT+V1IW95sFX+uCXcZKkeojdIT9qT2d2S9Nt 2O8egbYH+ebFWWykdsBQdt9FhC5RY1ga9D1NwEieWy/Rh00CfG1M4qc+VCg9GNGIsZZz dumXXRzCmegmELcrxuJhhGa3EmkreAT6lRR4pejpK0brqlkM38ZM4vpRkRVNkep7dO7M EhCUqfKvRcI5xeAd2LMWXcLI2tt1+qzl4KOSgcx1zkjfxGM2VkA2zobP4hQuMp9Y5BXc YpaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rj55eyo1MddXUL+Dj/dKuR27TbnyLe8uhAD+U0ZfGFU=; b=SZVCIWyyBkqM80aB+VO4ciLHQoNyokhNNCZ7l+AZBsplc+cpI6cksgy/dNjA1Ub3Dj CB5gTzzebrjU73qfakKPQ8WtWcEWE1xZXTT7KzwHUSIE4tz71yrQHoK4UZc6/kmfBqGD FOVN/e1ufbf273HIoNXMblItkNgKSbRiQA2x4nuDkPjv87aJr7Y8WyCPKMXqbfuNYw2y XWVq7Q1XNS8JY1qcskHSSRK8kboIIh9q6IB77gt7USvNiozB+31D3ZNLB49y49cyvTUt fgHQNw0dbuRUB443TgHj0fmz/65L90FlRZFNxS9Hp4T2z/zqTAZ+ZDZYm9tFzoNJ7khy s93Q== X-Gm-Message-State: AOAM532ENA9YgqstbUNNLbvF/9wBfe96jksTunJZbluxoTxO75Afm5f+ 8kGHNY88oxAcxafpuFDsVX/UdYVb X-Google-Smtp-Source: ABdhPJz+NgAV7WT/rpmwN2iBDqHHPh25zMdgFk8fj3Y63NRpKSrQNGYfMf8OIT/zYeMqSgePYolwYA== X-Received: by 2002:a5d:4c82:: with SMTP id z2mr3712104wrs.287.1596206981827; Fri, 31 Jul 2020 07:49:41 -0700 (PDT) Received: from cervin.home ([2a01:cb18:832e:5f00:c08f:7d21:ea98:a1c5]) by smtp.gmail.com with ESMTPSA id n189sm12648951wmn.40.2020.07.31.07.49.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jul 2020 07:49:41 -0700 (PDT) From: Mathieu Othacehe X-Google-Original-From: Mathieu Othacehe Date: Fri, 31 Jul 2020 16:49:29 +0200 Message-Id: <20200731144929.703345-3-othacehe@gnu.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200731144929.703345-1-othacehe@gnu.org> References: <20200731144929.703345-1-othacehe@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * guix/scripts/system.scm (list-image-types): New procedure, (%options): add "image-type" and "list-image-types" options, remove "file-system-type" option, (show-help): adapt accordingly, (%default-options): also adapt, and set the default "image-type" to "raw", (perform-action): add image-type argument and remove file-system-type argument, (process-action): adapt perform-action call, (system-derivation-for-action): remove base-image argument, add image-type argument, and use it to create the image passed to "system-image". --- guix/scripts/system.scm | 56 +++++++++++++++++++++++++---------------- 1 file changed, 35 insertions(+), 21 deletions(-) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index bfd50c7a79..4962401f36 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -659,8 +659,8 @@ checking this by themselves in their 'check' procedure." ;;; Action. ;;; -(define* (system-derivation-for-action os base-image action - #:key image-size file-system-type +(define* (system-derivation-for-action os action + #:key image-size image-type full-boot? container-shared-network? mappings) "Return as a monadic value the derivation for OS according to ACTION." @@ -686,9 +686,8 @@ checking this by themselves in their 'check' procedure." (lower-object (system-image (image - (inherit base-image) - (size image-size) - (operating-system os))))) + (inherit (os->image os #:type image-type)) + (size image-size))))) ((docker-image) (system-docker-image os #:shared-network? container-shared-network?)))) @@ -741,16 +740,17 @@ and TARGET arguments." install-bootloader? dry-run? derivations-only? use-substitutes? bootloader-target target - image-size file-system-type full-boot? - container-shared-network? + image-size image-type + full-boot? container-shared-network? (mappings '()) (gc-root #f)) "Perform ACTION for OS. INSTALL-BOOTLOADER? specifies whether to install bootloader; BOOTLOADER-TAGET is the target for the bootloader; TARGET is the target root directory; IMAGE-SIZE is the size of the image to be built, for -the 'vm-image' and 'disk-image' actions. The root file system is created as a -FILE-SYSTEM-TYPE file system. FULL-BOOT? is used for the 'vm' action; it -determines whether to boot directly to the kernel or to the bootloader. +the 'vm-image' and 'disk-image' actions. IMAGE-TYPE is the type of image to +be built. +FULL-BOOT? is used for the 'vm' action; it determines whether to boot directly +to the kernel or to the bootloader. CONTAINER-SHARED-NETWORK? determines if the container will use a separate network namespace. @@ -792,10 +792,8 @@ static checks." (check-initrd-modules os))) (mlet* %store-monad - ((target* (current-target-system)) - (image -> (find-image file-system-type target*)) - (sys (system-derivation-for-action os image action - #:file-system-type file-system-type + ((sys (system-derivation-for-action os action + #:image-type image-type #:image-size image-size #:full-boot? full-boot? #:container-shared-network? container-shared-network? @@ -876,6 +874,17 @@ upgrade, and restart each service that was not automatically restarted.\n")))))) #:node-type (shepherd-service-node-type shepherds) #:reverse-edges? #t))) + +;;; +;;; Images. +;;; + +(define (list-image-types) + "Print the available image types." + (display (G_ "The available image types are:\n")) + (newline) + (format #t "~{ - ~a ~%~}" (map image-type-name (force %image-types)))) + ;;; ;;; Options. @@ -935,9 +944,9 @@ Some ACTIONS support additional ARGS.\n")) apply STRATEGY (one of nothing-special, backtrace, or debug) when an error occurs while reading FILE")) (display (G_ " - --file-system-type=TYPE - for 'disk-image', produce a root file system of TYPE - (one of 'ext4', 'iso9660')")) + --list-image-types list available image types")) + (display (G_ " + -t, --image-type=TYPE for 'disk-image', produce an image of TYPE")) (display (G_ " --image-size=SIZE for 'vm-image', produce an image of SIZE")) (display (G_ " @@ -994,10 +1003,14 @@ Some ACTIONS support additional ARGS.\n")) (lambda (opt name arg result) (alist-cons 'on-error (string->symbol arg) result))) - (option '(#\t "file-system-type") #t #f + (option '(#\t "image-type") #t #f (lambda (opt name arg result) - (alist-cons 'file-system-type arg + (alist-cons 'image-type arg result))) + (option '("list-image-types") #f #f + (lambda (opt name arg result) + (list-image-types) + (exit 0))) (option '("image-size") #t #f (lambda (opt name arg result) (alist-cons 'image-size (size->number arg) @@ -1063,7 +1076,7 @@ Some ACTIONS support additional ARGS.\n")) (debug . 0) (verbosity . #f) ;default (validate-reconfigure . ,ensure-forward-reconfigure) - (file-system-type . "ext4") + (image-type . "raw") (image-size . guess) (install-bootloader? . #t))) @@ -1150,7 +1163,8 @@ resulting from command-line parsing." (assoc-ref opts 'skip-safety-checks?) #:validate-reconfigure (assoc-ref opts 'validate-reconfigure) - #:file-system-type (assoc-ref opts 'file-system-type) + #:image-type (lookup-image-type-by-name + (assoc-ref opts 'image-type)) #:image-size (assoc-ref opts 'image-size) #:full-boot? (assoc-ref opts 'full-boot?) #:container-shared-network? -- 2.26.2 From unknown Tue Jun 24 17:29:30 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#42634] [PATCH 0/3] Add image-type support. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 24 Sep 2020 15:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42634 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Mathieu Othacehe Cc: Mathieu Othacehe , 42634@debbugs.gnu.org Received: via spool by 42634-submit@debbugs.gnu.org id=B42634.160096167131004 (code B ref 42634); Thu, 24 Sep 2020 15:35:01 +0000 Received: (at 42634) by debbugs.gnu.org; 24 Sep 2020 15:34:31 +0000 Received: from localhost ([127.0.0.1]:41353 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kLTGR-000840-Mc for submit@debbugs.gnu.org; Thu, 24 Sep 2020 11:34:31 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44078) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kLTGQ-00083o-Q5 for 42634@debbugs.gnu.org; Thu, 24 Sep 2020 11:34:31 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:35038) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLTGL-0006dW-HU; Thu, 24 Sep 2020 11:34:25 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=57560 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kLTGH-0008Hx-TM; Thu, 24 Sep 2020 11:34:23 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20200731144825.703211-1-othacehe@gnu.org> Date: Thu, 24 Sep 2020 17:34:20 +0200 In-Reply-To: <20200731144825.703211-1-othacehe@gnu.org> (Mathieu Othacehe's message of "Fri, 31 Jul 2020 16:48:25 +0200") Message-ID: <87h7rn6ver.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi! Mathieu Othacehe skribis: > I think this is close to what Ludo suggested and it addresses janneke con= cerns > about composability. > > The idea is to introduce the concept of "image-type". An image type is a > converter from an record to an record. > > I have created in this serie 4 new image type records: > - raw > - iso9660 > - uncompressed-iso9660 > - hurd-raw > > I also adapted the "guix system" command by removing the "file-system-typ= e" > argument and replaced it by the "image-type" argument. > > The default is still to create a raw disk-image, but one can now call: > > guix system disk-image -t iso9660 my-config.scm > guix system disk-image -t uncompressed-iso9660 my-config.scm > guix system disk-image -t hurd-raw my-config.scm Neat! > and so on. Maybe we should also rename "disk-image" command to "image" th= at > would be somehow more accurate. Yes. We can do that separately, but I agree that it would make sense. I wonder if =E2=80=98docker-image=E2=80=99 could also fit in there. Apologies for taking so long to reply! Ludo=E2=80=99. From unknown Tue Jun 24 17:29:30 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#42634] [PATCH 1/3] image: Add image-type support. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 24 Sep 2020 15:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42634 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Mathieu Othacehe Cc: Mathieu Othacehe , 42634@debbugs.gnu.org Received: via spool by 42634-submit@debbugs.gnu.org id=B42634.160096173231139 (code B ref 42634); Thu, 24 Sep 2020 15:36:02 +0000 Received: (at 42634) by debbugs.gnu.org; 24 Sep 2020 15:35:32 +0000 Received: from localhost ([127.0.0.1]:41364 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kLTHP-00086B-Vf for submit@debbugs.gnu.org; Thu, 24 Sep 2020 11:35:32 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44220) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kLTHO-00085y-Hz for 42634@debbugs.gnu.org; Thu, 24 Sep 2020 11:35:30 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:35045) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLTHJ-0006tb-8b; Thu, 24 Sep 2020 11:35:25 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=57562 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kLTHG-0008PG-NO; Thu, 24 Sep 2020 11:35:24 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20200731144825.703211-1-othacehe@gnu.org> <20200731144929.703345-1-othacehe@gnu.org> Date: Thu, 24 Sep 2020 17:35:21 +0200 In-Reply-To: <20200731144929.703345-1-othacehe@gnu.org> (Mathieu Othacehe's message of "Fri, 31 Jul 2020 16:49:27 +0200") Message-ID: <87d02b6vd2.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Mathieu Othacehe skribis: > * gnu/image.scm (): New record, > (image-type, image-type?, image-type-name, > image-type-constructor, os->image): new procedures. [...] > +(define-record-type* > + image-type make-image-type > + image-type? > + (name image-type-name) ;string It=E2=80=99s subjective, but I=E2=80=99d make it a symbol, like we do for s= ervice types for instance. Ludo=E2=80=99. From unknown Tue Jun 24 17:29:30 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#42634] [PATCH 2/3] system: image: Add image-type support. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 24 Sep 2020 15:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42634 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Mathieu Othacehe Cc: Mathieu Othacehe , 42634@debbugs.gnu.org Received: via spool by 42634-submit@debbugs.gnu.org id=B42634.160096188831424 (code B ref 42634); Thu, 24 Sep 2020 15:39:01 +0000 Received: (at 42634) by debbugs.gnu.org; 24 Sep 2020 15:38:08 +0000 Received: from localhost ([127.0.0.1]:41378 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kLTJv-0008Am-Nq for submit@debbugs.gnu.org; Thu, 24 Sep 2020 11:38:07 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44704) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kLTJt-0008AC-Rr for 42634@debbugs.gnu.org; Thu, 24 Sep 2020 11:38:06 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:35065) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLTJn-0007FP-7M; Thu, 24 Sep 2020 11:38:00 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=57564 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kLTJj-00005e-2e; Thu, 24 Sep 2020 11:37:56 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20200731144929.703345-1-othacehe@gnu.org> <20200731144929.703345-2-othacehe@gnu.org> Date: Thu, 24 Sep 2020 17:37:53 +0200 In-Reply-To: <20200731144929.703345-2-othacehe@gnu.org> (Mathieu Othacehe's message of "Fri, 31 Jul 2020 16:49:28 +0200") Message-ID: <878scz6v8u.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Mathieu Othacehe skribis: > * gnu/system/image.scm (image-with-os): New macro. Rename the old > "image-with-os" procedure to ... > (image-with-os*): ... this new procedure, > (system-image): adapt according, > (raw-image-type, iso-image-type, uncompressed-iso-image-type > %image-types): new variables, > (lookup-image-type-by-name): new procedure. > (find-image): remove it. > * gnu/system/images/hurd.scm (hurd-image-type): New variable, > use it to define ... > (hurd-disk-image): ... this variable, using "os->image" procedure. > * gnu/tests/install.scm (run-install): Rename > installation-disk-image-file-system-type parameter to installation-image-= type, > use os->config instead of find-image to compute the image passed to syste= m-image, > (%test-iso-image-installer) adapt accordingly, > (guided-installation-test): ditto. [...] > +(define (lookup-image-type-by-name name) > + "Return the image type called NAME." > + (or (srfi-1:find (lambda (image-type) > + (string=3D? name (image-type-name image-type))) > + (force %image-types)) > + (leave (G_ "~a: no such image type.~%") name))) I=E2=80=99d raise a =E2=80=98&formatted-message=E2=80=99 condition instead.= That allows you to remove (guix ui) from the loop. You can also remove the period from the message here sine it=E2=80=99s not a sentence. Otherwise LGTM! Ludo=E2=80=99. From unknown Tue Jun 24 17:29:30 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#42634] [PATCH 3/3] scripts: system: Add support for image-type. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 24 Sep 2020 15:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42634 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Mathieu Othacehe Cc: Mathieu Othacehe , 42634@debbugs.gnu.org Received: via spool by 42634-submit@debbugs.gnu.org id=B42634.160096198631568 (code B ref 42634); Thu, 24 Sep 2020 15:40:02 +0000 Received: (at 42634) by debbugs.gnu.org; 24 Sep 2020 15:39:46 +0000 Received: from localhost ([127.0.0.1]:41382 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kLTLW-0008D5-2I for submit@debbugs.gnu.org; Thu, 24 Sep 2020 11:39:46 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44974) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kLTLT-0008Ct-QO for 42634@debbugs.gnu.org; Thu, 24 Sep 2020 11:39:44 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:35086) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLTLO-0007Ts-Hl; Thu, 24 Sep 2020 11:39:38 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=57566 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kLTLK-0000Cl-Qc; Thu, 24 Sep 2020 11:39:36 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20200731144929.703345-1-othacehe@gnu.org> <20200731144929.703345-3-othacehe@gnu.org> Date: Thu, 24 Sep 2020 17:39:33 +0200 In-Reply-To: <20200731144929.703345-3-othacehe@gnu.org> (Mathieu Othacehe's message of "Fri, 31 Jul 2020 16:49:29 +0200") Message-ID: <874knn6v62.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Mathieu Othacehe skribis: > * guix/scripts/system.scm (list-image-types): New procedure, > (%options): add "image-type" and "list-image-types" options, remove > "file-system-type" option, > (show-help): adapt accordingly, > (%default-options): also adapt, and set the default "image-type" to "raw", > (perform-action): add image-type argument and remove file-system-type arg= ument, > (process-action): adapt perform-action call, > (system-derivation-for-action): remove base-image > argument, add image-type argument, and use it to create the image passed = to > "system-image". LGTM (with corresponding doc)! Perhaps you can also add a =E2=80=98guix system list-image-types=E2=80=99 c= ommand to tests/guix-system.sh for good measure. That=E2=80=99d at least catch broken modules and similar. Thanks, Ludo=E2=80=99. From unknown Tue Jun 24 17:29:30 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#42634] [PATCH 0/3] Add image-type support. Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 30 Sep 2020 09:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42634 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 42634@debbugs.gnu.org Received: via spool by 42634-submit@debbugs.gnu.org id=B42634.16014594472334 (code B ref 42634); Wed, 30 Sep 2020 09:51:02 +0000 Received: (at 42634) by debbugs.gnu.org; 30 Sep 2020 09:50:47 +0000 Received: from localhost ([127.0.0.1]:58267 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kNYl5-0000ba-IN for submit@debbugs.gnu.org; Wed, 30 Sep 2020 05:50:47 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59694) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kNYl2-0000bL-6l for 42634@debbugs.gnu.org; Wed, 30 Sep 2020 05:50:45 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58938) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kNYku-00042F-J1; Wed, 30 Sep 2020 05:50:37 -0400 Received: from 91-166-111-102.subs.proxad.net ([91.166.111.102]:47300 helo=cervin) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kNYku-0000XS-5G; Wed, 30 Sep 2020 05:50:36 -0400 From: Mathieu Othacehe In-Reply-To: <87h7rn6ver.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Thu, 24 Sep 2020 17:34:20 +0200") References: <20200731144825.703211-1-othacehe@gnu.org> <87h7rn6ver.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Date: Wed, 30 Sep 2020 11:50:33 +0200 Message-ID: <878scrd252.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hey Ludo, > I wonder if =E2=80=98docker-image=E2=80=99 could also fit in there. Yes I think that 'docker-image' and 'vm-image' can both be absorbed by the upcoming 'image' option. Turns out, 'hurd-qcow2' image type already produces what would be expected from 'vm-image'. Thanks for reviewing :) Mathieu From unknown Tue Jun 24 17:29:30 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Mathieu Othacehe Subject: bug#42634: closed (Re: [bug#42634] [PATCH 3/3] scripts: system: Add support for image-type.) Message-ID: References: <874knfd23e.fsf@gnu.org> <20200731144825.703211-1-othacehe@gnu.org> X-Gnu-PR-Message: they-closed 42634 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 42634@debbugs.gnu.org Date: Wed, 30 Sep 2020 09:52:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1601459522-2461-1" This is a multi-part message in MIME format... ------------=_1601459522-2461-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #42634: [PATCH 0/3] Add image-type support. which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 42634@debbugs.gnu.org. --=20 42634: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D42634 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1601459522-2461-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 42634-done) by debbugs.gnu.org; 30 Sep 2020 09:51:44 +0000 Received: from localhost ([127.0.0.1]:58271 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kNYlz-0000dD-RA for submit@debbugs.gnu.org; Wed, 30 Sep 2020 05:51:44 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59986) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kNYlx-0000cz-4O for 42634-done@debbugs.gnu.org; Wed, 30 Sep 2020 05:51:42 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58948) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kNYlr-0004B0-PJ; Wed, 30 Sep 2020 05:51:35 -0400 Received: from [2a01:e0a:19b:d9a0:d549:2a8f:de3b:c9c0] (port=56748 helo=cervin) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kNYlq-0000Ze-SN; Wed, 30 Sep 2020 05:51:35 -0400 From: Mathieu Othacehe To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#42634] [PATCH 3/3] scripts: system: Add support for image-type. References: <20200731144929.703345-1-othacehe@gnu.org> <20200731144929.703345-3-othacehe@gnu.org> <874knn6v62.fsf@gnu.org> Date: Wed, 30 Sep 2020 11:51:33 +0200 In-Reply-To: <874knn6v62.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Thu, 24 Sep 2020 17:39:33 +0200") Message-ID: <874knfd23e.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 42634-done Cc: 42634-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Perhaps you can also add a =E2=80=98guix system list-image-types=E2=80=99= command to > tests/guix-system.sh for good measure. That=E2=80=99d at least catch bro= ken > modules and similar. Sure, fixed. I pushed this serie with the according documentation update. Thanks, Mathieu ------------=_1601459522-2461-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 31 Jul 2020 14:48:41 +0000 Received: from localhost ([127.0.0.1]:38400 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k1WKu-0006Ir-ML for submit@debbugs.gnu.org; Fri, 31 Jul 2020 10:48:40 -0400 Received: from lists.gnu.org ([209.51.188.17]:56312) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k1WKr-0006Ii-1A for submit@debbugs.gnu.org; Fri, 31 Jul 2020 10:48:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58024) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k1WKq-0004gs-Le for guix-patches@gnu.org; Fri, 31 Jul 2020 10:48:36 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:51637) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k1WKo-00012B-U9; Fri, 31 Jul 2020 10:48:36 -0400 Received: by mail-wm1-x329.google.com with SMTP id p14so8778196wmg.1; Fri, 31 Jul 2020 07:48:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yDcs2mNrjr3GAahU96fY0uw6/PIKrMfx0hVojQ0GlyU=; b=d7rSk/Vm58YWXo/NdwVAxdjG1SQvHVB9epbQOJy0FhY/ALZOvCY6smLpDT++yDsFdQ WoFi1UCed1shKsjdjkFQ2FBhQp3aCjB/SgtzgOAEHLsAVGKTvrVqg/OATKwjZnuFPwbF VfQScyKDNbn2oi78xiNvpqFsZghdGGvQyepmDDE5a/RpYx4Ds6FTc5HvJt7NRwp76jnh GZQm+7Ve/aIF9ELm1o1wR7TJiAZUQMTYV6dltMaroRS4aLm/EpXAIyuvSCgmF4QMr7Sr O3oKKMJdMal9FCbxTMinuc/XqrYfb8L2N965RXmLqujV/RBFblYnUos/Pkrz/EBvEuup Q56g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yDcs2mNrjr3GAahU96fY0uw6/PIKrMfx0hVojQ0GlyU=; b=qijzKlUM1B0Mzm8F98aDPJVsa8WHBf0iOd7nKyxpmoYHbTO6QurU7WPRF76Im/CrbT CLlFCr/iGnEhN5mXAqRjqQ/jiF7JPyGjdV06N0S90efQV/zBc5QckL5yeNpN0QShQFMH Z2oJ/aCYE/Qda/dXWbUBV9nH1HepQRkyaChfUJWBTfBOrg2rL8laDymAI3pbBCkgo6vd HiYmAZIWva8JPIPa+dOC8H5s2JvwcGB3LGKhTos5dp+Tjq8A4yAeZH7gNXhQ4RKeg6TX i2xpsobKNtQjr3xgBzNVraEPwEn+JmyZKNtWkH/bHO9Jb/1kXICk9jAsEU/K0tdsRxfi rvKw== X-Gm-Message-State: AOAM5317vqa8WYqOZbN7uZc9rMIj4wBE5YKfVXtBvyxJCWoLTR8gMB9I NABGEM8vVwcWDGeTD7AEu8UrfVXV X-Google-Smtp-Source: ABdhPJzbjcX+rHGYpUN57Qyi3olJiu6rm3wAV/2yvs3k/nMBZEjk7sUbWHNBpcb6VDOmd9jQQ0LX9Q== X-Received: by 2002:a1c:7d81:: with SMTP id y123mr4011984wmc.87.1596206911935; Fri, 31 Jul 2020 07:48:31 -0700 (PDT) Received: from cervin.home ([2a01:cb18:832e:5f00:c08f:7d21:ea98:a1c5]) by smtp.gmail.com with ESMTPSA id 12sm3123595wme.22.2020.07.31.07.48.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jul 2020 07:48:31 -0700 (PDT) From: Mathieu Othacehe X-Google-Original-From: Mathieu Othacehe To: guix-patches@gnu.org Subject: [PATCH 0/3] Add image-type support. Date: Fri, 31 Jul 2020 16:48:25 +0200 Message-Id: <20200731144825.703211-1-othacehe@gnu.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=m.othacehe@gmail.com; helo=mail-wm1-x329.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: submit Cc: Mathieu Othacehe X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Hello, This is the missing piece for the new image API. It has been previously discussed here[1]. I think this is close to what Ludo suggested and it addresses janneke concerns about composability. The idea is to introduce the concept of "image-type". An image type is a converter from an record to an record. I have created in this serie 4 new image type records: - raw - iso9660 - uncompressed-iso9660 - hurd-raw I also adapted the "guix system" command by removing the "file-system-type" argument and replaced it by the "image-type" argument. The default is still to create a raw disk-image, but one can now call: guix system disk-image -t iso9660 my-config.scm guix system disk-image -t uncompressed-iso9660 my-config.scm guix system disk-image -t hurd-raw my-config.scm and so on. Maybe we should also rename "disk-image" command to "image" that would be somehow more accurate. The only missing bit is the documentation update, as I prefer to wait for this change to be approved first. WDYT? Thanks, Mathieu [1]: https://lists.gnu.org/archive/html/guix-devel/2020-05/msg00417.html Mathieu Othacehe (3): image: Add image-type support. system: image: Add image-type support. scripts: system: Add support for image-type. gnu/image.scm | 29 ++++++++++++++- gnu/system/image.scm | 75 ++++++++++++++++++++++++++++++++++++-- gnu/system/images/hurd.scm | 13 +++++-- guix/scripts/system.scm | 56 +++++++++++++++++----------- 4 files changed, 145 insertions(+), 28 deletions(-) -- 2.26.2 ------------=_1601459522-2461-1--