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 2DBcGHn6GmQ/bgAASxT56A (envelope-from ) for ; Wed, 22 Mar 2023 13:54:17 +0100 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 ONRZF3n6GmSmZQEAG6o9tA (envelope-from ) for ; Wed, 22 Mar 2023 13:54:17 +0100 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 1D4D8178A3 for ; Wed, 22 Mar 2023 13:54:16 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pexye-0005nb-6x; Wed, 22 Mar 2023 08:54:04 -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 1pexyc-0005nL-Ql for guix-patches@gnu.org; Wed, 22 Mar 2023 08:54: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 1pexyc-0005Yt-8F for guix-patches@gnu.org; Wed, 22 Mar 2023 08:54:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pexyc-0002yq-4S for guix-patches@gnu.org; Wed, 22 Mar 2023 08:54:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62223] [PATCH v2] image: Prefer gpt partition table for efi images References: <20230316173137.25074-1-sarg@sarg.org.ru> In-Reply-To: <20230316173137.25074-1-sarg@sarg.org.ru> Resent-From: Sergey Trofimov Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 22 Mar 2023 12:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62223 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 62223@debbugs.gnu.org Cc: Josselin Poiret , Sergey Trofimov Received: via spool by 62223-submit@debbugs.gnu.org id=B62223.167948961511420 (code B ref 62223); Wed, 22 Mar 2023 12:54:02 +0000 Received: (at 62223) by debbugs.gnu.org; 22 Mar 2023 12:53:35 +0000 Received: from localhost ([127.0.0.1]:33802 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pexyB-0002y8-FJ for submit@debbugs.gnu.org; Wed, 22 Mar 2023 08:53:35 -0400 Received: from mail-ed1-f53.google.com ([209.85.208.53]:34731) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pexy9-0002xu-59 for 62223@debbugs.gnu.org; Wed, 22 Mar 2023 08:53:33 -0400 Received: by mail-ed1-f53.google.com with SMTP id b20so39563634edd.1 for <62223@debbugs.gnu.org>; Wed, 22 Mar 2023 05:53:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sarg.org.ru; s=google; t=1679489607; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=oi9kOQOPJjJ59xt8hinWk8GxnLwItG5vafMwsZ6DurY=; b=Lop8iRs1D4ThaJiIiq2XdwZsrb8jAccAGvr5Ps+FVM9uGTTRQlpvmAGCz86qQH8wlT qfjYVA8gpGEFBQptBVIHYjeesGoF1Dc/0QCIXNsIb304T/2VcLw7GmX1V28yT7j5Mrxx +NJTHrYH4YD8V5GatzMfGTaAX1X0bEZWyuTV4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679489607; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=oi9kOQOPJjJ59xt8hinWk8GxnLwItG5vafMwsZ6DurY=; b=lGtsLZv+jGJEKSPhEM/tlBU6OShWPlsOZJfgTjbn3dF7pFEKY9eG4qidznak1Qyg7J M64XXvwlbCKPkNM3sw3yTcbzKI/FuUoSJYWUG3jhq4J2TxY+OTov37hjsA1BmS+Aulrm oOlFRoPOw6Uo/P93IcvvqxMzGFRUX5fiASs8zNgV6f7ioNLMlK3vu68cElsNvmCZnUZh D9gZWbMC8jYdeoTLJQr2Q9eTe6adH7ga3HluVqsYkpHWiPeGlPNWJI7cwpHS3mUA5RpU BuW6NGqrNI8xQ11wNCV7N+xgDc5GC/xgfqLhlp3mGH/0ltmlOtvvmnBmizBKmza9YBPo 9Bnw== X-Gm-Message-State: AO0yUKUZx3C/v6QA+MvspT/jtNoEaCfhcudW5jWgOEEuX5jk5PVSJ287 Wwd9ORxLJAhEfgmg4+D4OVCH6rXl00qllvG+FXlOtA== X-Google-Smtp-Source: AK7set91rvlpvJuYs9ScWntqAF2zi9WuGT2EppSGG9CBG5gHxre27EqOOy3/2SLDZsVT8u1Jk6DuiA== X-Received: by 2002:a17:906:32c4:b0:932:40f4:5c44 with SMTP id k4-20020a17090632c400b0093240f45c44mr6828632ejk.36.1679489607179; Wed, 22 Mar 2023 05:53:27 -0700 (PDT) Received: from localhost ([95.168.147.255]) by smtp.gmail.com with ESMTPSA id v2-20020a170906292200b009321cd80e15sm6803105ejd.73.2023.03.22.05.53.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Mar 2023 05:53:27 -0700 (PDT) From: Sergey Trofimov Date: Wed, 22 Mar 2023 13:53:28 +0100 Message-Id: <20230322125328.23578-1-sarg@sarg.org.ru> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 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=1679489657; a=rsa-sha256; cv=none; b=lMGKlVIHZoxR+yghqW8h8q8YpO9W3UHrfLYipX4Mn23PN3dEMbnWvMZXrFFnCzGtWlpnA/ na9VqB/eEE+/7xNpWyr3U3q1OSDlxDcRpbM/lSrLwpcFGibEYM7YKzZXv1TYZQFwU12cOb S6JsvkoaZW3rw5OsYUsKzoefjCaUTzUbkqT7t+nfDKIwyaqDIBHMNwc69Ott3lDKbELnjt RTOfVadYq12zbyTYVfKYArMC8rjM+8weP3iEHS8SR1I8FulGEhRjiLJLAVTDkd7ZEAe4QP YhigmTEWCcWVbLEzuryYwPD4DuN8TF0yI47C5w64/4mRMZ3ZST7oSsHl+utPEA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=sarg.org.ru header.s=google header.b=Lop8iRs1; 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"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1679489657; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: 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=oi9kOQOPJjJ59xt8hinWk8GxnLwItG5vafMwsZ6DurY=; b=GtmXGt1kFiG4hUlb79UAwpzRrFlAvP7vcLV7W3N3+gE/FXvfe5kR54UNJJsMtLU3kTZo12 b/y39QhWK7rEcdM/+KPrHlwwNroBjWbta0aZ5kwaqVXnWcV9o/ALq7Dlx9AnDZcZ7uSPQ0 L8TSnS6PRAcjiXd537c/bGFTgNCpNGkhP8pVyA/Grs8oZGrzaPVVDVTA8ceHrxewnGSPet 3Yo+vWQ3TitSB2vmmBNf/X3EJAQlKnSEoXq0yS5GLy+4peNwXIhX2mx77aZcJGpYjMGMcz HYWMrQ8x8stN6Xs26sFnl3n3N6sdj4XW33sKMglkd4ImqzLeCsUXThF/ELJ1aA== X-Migadu-Spam-Score: 0.75 X-Spam-Score: 0.75 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=sarg.org.ru header.s=google header.b=Lop8iRs1; 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"; dmarc=none X-Migadu-Queue-Id: 1D4D8178A3 X-Migadu-Scanner: scn1.migadu.com X-TUID: zDoARwF9ivoo * gnu/system/image.scm (efi-disk-image): Use gpt partition-table-type. (efi32-disk-image): Use gpt partition-table-type. (qcow2-image-type): Use mbr partition-table-type explicitly. * gnu/tests/image.scm: Assert partition table type of efi-disk-image. --- gnu/system/image.scm | 3 +++ gnu/tests/image.scm | 23 ++++++++++++++++++----- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/gnu/system/image.scm b/gnu/system/image.scm index afef79185f..699feaf05d 100644 --- a/gnu/system/image.scm +++ b/gnu/system/image.scm @@ -147,11 +147,13 @@ (define root-partition (define efi-disk-image (image-without-os (format 'disk-image) + (partition-table-type 'gpt) (partitions (list esp-partition root-partition)))) (define efi32-disk-image (image-without-os (format 'disk-image) + (partition-table-type 'gpt) (partitions (list esp32-partition root-partition)))) (define iso9660-image @@ -214,6 +216,7 @@ (define qcow2-image-type (constructor (cut image-with-os (image (inherit efi-disk-image) + (partition-table-type 'mbr) (name 'image.qcow2) (format 'compressed-qcow2)) <>)))) diff --git a/gnu/tests/image.scm b/gnu/tests/image.scm index 99d34b7670..be6852cae0 100644 --- a/gnu/tests/image.scm +++ b/gnu/tests/image.scm @@ -20,7 +20,7 @@ (define-module (gnu tests image) #:use-module (gnu) #:use-module (gnu image) #:use-module (gnu tests) - #:autoload (gnu system image) (system-image root-offset) + #:autoload (gnu system image) (system-image root-offset image-with-os efi-disk-image) #:use-module (gnu system uuid) #:use-module (gnu system vm) #:use-module (gnu packages guile) @@ -153,6 +153,10 @@ (define i5 (flags '(boot)) (initializer dummy-initializer)))))) +;; A efi disk image with default partitions +(define i6 + (image-with-os efi-disk-image %simple-efi-os)) + (define (run-images-test) (define test (with-imported-modules '((srfi srfi-64) @@ -202,10 +206,10 @@ (define d2-device (disk-get-primary-partition-count (disk-new d2-device))) (test-equal "test" - (let* ((disk (disk-new d2-device)) - (partitions (disk-partitions disk)) - (boot-partition (find normal-partition? partitions))) - (partition-get-name boot-partition))) + (let* ((disk (disk-new d2-device)) + (partitions (disk-partitions disk)) + (boot-partition (find normal-partition? partitions))) + (partition-get-name boot-partition))) ;; Image i3. (define i3-image @@ -259,6 +263,15 @@ (define (sector->byte sector) (filter data-partition? (disk-partitions (disk-new d5-device))))) + ;; Image i6. + (define i6-image + #$(system-image i6)) + (define d6-device + (get-device i6-image)) + + (test-equal "gpt" + (disk-type-name (disk-probe d6-device))) + (test-end))))) (gexp->derivation "images-test" test)) -- 2.39.2