unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Pavel Shlyak <p.shlyak@pantherx.org>
To: 55406@debbugs.gnu.org
Subject: bug#55406: WIP: Image API support for fat16 partitions
Date: Fri, 20 May 2022 22:54:47 +0300	[thread overview]
Message-ID: <B63F3183-7556-484F-97C3-3B18CBA354CD@pantherx.org> (raw)
In-Reply-To: <3078A40B-22B0-4492-BFD2-72D725F31689@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 108 bytes --]

This patch fixes GPT support for fat partitions. Should be applied after gpt-support-vfat-partitions.patch

[-- Attachment #2: gpt-support-vfat-partitions.patch --]
[-- Type: application/octet-stream, Size: 991 bytes --]

diff --git a/gnu/system/image.scm b/gnu/system/image.scm
index a83f844682..a6267feab2 100644
--- a/gnu/system/image.scm
+++ b/gnu/system/image.scm
@@ -317,10 +317,15 @@ (define (partition->dos-type partition)
     (define (partition->gpt-type partition)
       ;; Return the genimage GPT partition type code corresponding to PARTITION.
       ;; See https://github.com/pengutronix/genimage/blob/master/README.rst
-      (let ((flags (partition-flags partition)))
+      (let ((flags (partition-flags partition)) (file-system (partition-file-system partition)))
         (cond
           ((member 'esp flags) "U")
-          (else "L"))))
+          ((string-prefix? "ext" file-system) "L")
+          ((string=? file-system "vfat") "F")
+          (else
+            (raise (condition
+              (&message
+               (message "unsupported partition type"))))))))
 
     (define (partition-image partition)
       ;; Return as a file-like object, an image of the given PARTITION.  A

  parent reply	other threads:[~2022-05-20 20:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-13 21:46 bug#55406: GUIX Image API: wrong fs type and flag Pavel Shlyak
2022-05-15 17:00 ` Pavel Shlyak
2022-05-15 17:11 ` Pavel Shlyak
2022-05-20 17:01 ` bug#55406: WIP: Image API support for fat16 partitions Pavel Shlyak
2022-05-20 19:54 ` Pavel Shlyak [this message]
2022-05-21 13:09 ` bug#55406: Patch to handle boot flag in Image API Pavel Shlyak
2022-05-22 13:33   ` bug#55406: GUIX Image API: wrong fs type and flag Mathieu Othacehe
2022-05-22 14:02     ` bug#55406: [PATCH] GUIX Image API support for vfat and boot flag Pavel Shlyak
2022-05-23  8:30       ` bug#55406: GUIX Image API: wrong fs type and flag Mathieu Othacehe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=B63F3183-7556-484F-97C3-3B18CBA354CD@pantherx.org \
    --to=p.shlyak@pantherx.org \
    --cc=55406@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).