From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id WIbpLXAic2SktwAASxT56A (envelope-from ) for ; Sun, 28 May 2023 11:44:16 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id AP8ALXAic2SLpQAAG6o9tA (envelope-from ) for ; Sun, 28 May 2023 11:44:16 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2E48C11055 for ; Sun, 28 May 2023 11:44:16 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q3CwX-0008Dx-CD; Sun, 28 May 2023 05:44:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q3CwU-0008Da-GP for guix-patches@gnu.org; Sun, 28 May 2023 05:44:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q3CwU-0003JZ-8j for guix-patches@gnu.org; Sun, 28 May 2023 05:44:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q3CwU-0001bN-4v for guix-patches@gnu.org; Sun, 28 May 2023 05:44:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63766] [PATCH 2/4] gnu: image: Add support for unformatted partitions. Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-CC: , guix-patches@gnu.org Resent-Date: Sun, 28 May 2023 09:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63766 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63766@debbugs.gnu.org Cc: Efraim Flashner , ( , Christopher Baines , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Raghav Gururajan , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice , jgart X-Debbugs-Original-Xcc: ( , Christopher Baines , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Raghav Gururajan , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice , jgart Received: via spool by 63766-submit@debbugs.gnu.org id=B63766.16852670286105 (code B ref 63766); Sun, 28 May 2023 09:44:02 +0000 Received: (at 63766) by debbugs.gnu.org; 28 May 2023 09:43:48 +0000 Received: from localhost ([127.0.0.1]:53295 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3CwG-0001aO-Ay for submit@debbugs.gnu.org; Sun, 28 May 2023 05:43:48 -0400 Received: from mail-wm1-f52.google.com ([209.85.128.52]:45308) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3CwA-0001Zg-9M for 63766@debbugs.gnu.org; Sun, 28 May 2023 05:43:43 -0400 Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-3f6cbdf16d2so14473805e9.2 for <63766@debbugs.gnu.org>; Sun, 28 May 2023 02:43:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685267016; x=1687859016; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=iQg9ql3ZIuaP1nOqFaG3LeLoMOfUqmLDaS+XeSF4iWI=; b=JDCcC+1A9qXR6h4ZaE8QL4cdjyg5U4R0FbDxKFTSdznHxVqZ1uBXYewZ7Ne7zEtj48 +rpzwgUhduqnr5jBoKDgXOLysIA8MCWlWw6l5A8B6yaOdtDIMYcOGW7eKnj5heD6fVGt IRKoYAeuha9Q6cFp88PHMsxk3+RinhNkgpxqTsshMaiR9IGv1JmNOUWPDNXjWm7jBaMS wvx+etRI7/y2ZSQ2qt5ULh9HBliXBySLEKWih8J50zaMfWLz8N+RC7VXRCt+VhQIGK46 lf/rnClne3ZCCjZa8Zl26Z0q5t5LuwUo0287yyw6rW9Z0HYQFfc26pKxwdhs+tHbnK4b AOSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685267016; x=1687859016; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=iQg9ql3ZIuaP1nOqFaG3LeLoMOfUqmLDaS+XeSF4iWI=; b=ATOIXrbndNf4ccMF1TKeWjMmsVIqwGTpAvRgcVfwAkb71HVAFCQGyLayH16yWwn++g qj52jy2GmFcbC1B3OWj6ymzOoxCQwUCTTg3IV64h7etQwzHEEyrls8vLGQAHyxiORg20 N4dw6zVyA+sPeFDYmES89Z17J/BWNY0vSzxVzW2Mf50SStItrz0ZMYW0luv7nv1AIfes 2UgSMuaBJR3hxnT58Uuq2/8VOBfhwggB7uNmqrg1mcOv4eoZszZmb3WJ7AcOK7ZcIOUe 0TWK5PHtFc4gocx/eQfgLRgkFhqkHAgNkQSUwAE6rlw+FMdXuWTy7Ol3l10b70O8pMWB 7hpg== X-Gm-Message-State: AC+VfDywFeaE5PTyLjuBTtzZxx6SYd4znmEOsahZpqFPKNm4ZE/wlQDB GOifWnxrEJOSVWRROt/bHuDDECPErIAfnw== X-Google-Smtp-Source: ACHHUZ5rxZkVmOmu3IPMBHsoMs+V5QVgNtrQfToRim6a5Zt1DoCr88EgwyXOAEE89AGzFvfxu/hlzA== X-Received: by 2002:a1c:7319:0:b0:3f7:5d:4a08 with SMTP id d25-20020a1c7319000000b003f7005d4a08mr1215262wmb.1.1685267016451; Sun, 28 May 2023 02:43:36 -0700 (PDT) Received: from localhost ([37.46.46.3]) by smtp.gmail.com with ESMTPSA id q21-20020a1ce915000000b003f421979398sm14196469wmc.26.2023.05.28.02.43.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 May 2023 02:43:36 -0700 (PDT) From: Efraim Flashner Date: Sun, 28 May 2023 12:44:19 +0300 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Seal: i=1; s=key1; d=yhetil.org; t=1685267056; a=rsa-sha256; cv=none; b=jKm765X0Yxg82UAwFUMU7DIXYrFp0Pn57v3mpeuN/MlBTRF9AN/2aXsUMFt0yS/z3TyqY5 fWrKeGIZx/kwjZTKBiJnHuv3NVqkrVogyTPmizPpHanWZotEqbaWhWZ/L1g2FlKnR6FDiO +hcWxZc67bpD7GIo0q/SbE7yDIS0XlAFV1dMyQ3Txpr7kef7/0TTEm9oQ1bziWOIANtcGH zEv3IUo5G0xIX5654KanimbDuTC2b2/mhiQ5tECozT7wHfBSFml4PwCXqMUykbOSVrNRb6 4y4SaiQqocDUgKzopJHrBTYcgc7ZQhniHqJDuFx+lH9hN47J1iZ+aLpypS5dpQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=JDCcC+1A; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1685267056; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=iQg9ql3ZIuaP1nOqFaG3LeLoMOfUqmLDaS+XeSF4iWI=; b=Kb5JKsA7xqyNOKoecXlsfyKmXD+s5NxxaxOnTyiNzsQKAbvgpqWr7kLfOYwoRNz2wqfiSM E/TmAfloAQ4xlHaSK4qbl3hsYmcoqbU58qYihY8biQBQe0JOfUlsLTR6dGol700arlQAFR kYsfpAPeTEaQgimL0mCwBPvxZVRXORi4Qxr+6Mh2YRC9I2fVaeSbP3YANXcrJfIl8a2/72 WSNI27fzcRzrecCYmWr+QBV8CPfogbExPsFIE2jTgAeVbcUDLxcf99MaT7/l54ymi31NDK LxN9eFjW3PjGGB2QnMWIimh4U8c5+klCtdT2dyGWF7+lzN0Sxa8k6tJYDm0uhQ== X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=JDCcC+1A; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 1.85 X-Spam-Score: 1.85 X-Migadu-Queue-Id: 2E48C11055 X-TUID: xclZjmof4UBU * gnu/build/image.scm (make-unformatted-image): New procedure. (make-partition-image): Add support for unformatted partition. * gnu/system/image.scm (system-disk-image)[partition->gpt-type]: Add case for using unformatted partition uuid. [partition-image]: Add coreutils to image-builder closure. --- gnu/build/image.scm | 8 ++++++++ gnu/system/image.scm | 10 +++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/gnu/build/image.scm b/gnu/build/image.scm index 65a0373980..d47cb31aa0 100644 --- a/gnu/build/image.scm +++ b/gnu/build/image.scm @@ -7,6 +7,7 @@ ;;; Copyright © 2020 Mathieu Othacehe ;;; Copyright © 2022 Pavel Shlyak ;;; Copyright © 2022 Denis 'GNUtoo' Carikli +;;; Copyright © 2023 Efraim Flashner ;;; ;;; This file is part of GNU Guix. ;;; @@ -122,6 +123,11 @@ (define* (make-vfat-image partition target root fs-bits) (string-append "::" file)))) (scandir root)))) +(define* (make-unformatted-image partition target) + "Make an unformatted partition of a certain size." + (let ((size (partition-size partition))) + (invoke "truncate" "--size" (number->string size) target))) + (define* (make-partition-image partition-sexp target root) "Create and return the image of PARTITION-SEXP as TARGET. Use the given ROOT directory to populate the image." @@ -134,6 +140,8 @@ (define* (make-partition-image partition-sexp target root) (make-vfat-image partition target root 16)) ((string=? type "fat32") (make-vfat-image partition target root 32)) + ((string=? type "unformatted") + (make-unformatted-image partition target)) (else (raise (condition (&message diff --git a/gnu/system/image.scm b/gnu/system/image.scm index afef79185f..3fe813f096 100644 --- a/gnu/system/image.scm +++ b/gnu/system/image.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2022 Pavel Shlyak ;;; Copyright © 2022 Denis 'GNUtoo' Carikli ;;; Copyright © 2022 Alex Griffin +;;; Copyright © 2023 Efraim Flashner ;;; ;;; This file is part of GNU Guix. ;;; @@ -390,6 +391,9 @@ (define* (system-disk-image image ((or (string=? file-system "vfat") (string=? file-system "fat16") (string=? file-system "fat32")) "F") + ((and (string=? file-system "unformatted") + (partition-uuid partition)) + (uuid->string (partition-uuid partition))) (else (raise (condition (&message @@ -414,7 +418,11 @@ (define* (system-disk-image image (with-imported-modules* (let ((initializer (or #$(partition-initializer partition) initialize-root-partition)) - (inputs '#+(list e2fsprogs fakeroot dosfstools mtools)) + (inputs '#+(list e2fsprogs ; ext2/3/4 + fakeroot + dosfstools ; vfat + mtools ; vfat + coreutils)) ; truncate (image-root "tmp-root")) (sql-schema #$schema) -- Efraim Flashner רנשלפ םירפא GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted