guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

04/05: system: image: Support GPT vfat partitions.


From: guix-commits
Subject: 04/05: system: image: Support GPT vfat partitions.
Date: Mon, 23 May 2022 04:27:50 -0400 (EDT)

mothacehe pushed a commit to branch master
in repository guix.

commit 6e99c020b8c19e140635d1a52815d5b3298ed1ec
Author: Pavel Shlyak <p.shlyak@pantherx.org>
AuthorDate: Sun May 22 16:53:30 2022 +0300

    system: image: Support GPT vfat partitions.
    
    * gnu/system/image.scm (system-disk-image): Support them.
    
    Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
---
 gnu/system/image.scm | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/gnu/system/image.scm b/gnu/system/image.scm
index cdb6c09633..e86e8c0867 100644
--- a/gnu/system/image.scm
+++ b/gnu/system/image.scm
@@ -320,12 +320,21 @@ used in the image."
                             file-system)))))))))
 
     (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)))
+      ;; Return the genimage GPT partition type code corresponding to the
+      ;; given PARTITION.  See:
+      ;; https://github.com/pengutronix/genimage/blob/master/README.rst
+      (let ((flags (partition-flags partition))
+            (file-system (partition-file-system partition)))
         (cond
-          ((member 'esp flags) "U")
-          (else "L"))))
+         ((member 'esp flags) "U")
+         ((string-prefix? "ext" file-system) "L")
+         ((string=? file-system "vfat") "F")
+         (else
+          (raise (condition
+                  (&message
+                   (message
+                    (format #f (G_ "unsupported partition type: ~a")
+                            file-system)))))))))
 
     (define (partition-image partition)
       ;; Return as a file-like object, an image of the given PARTITION.  A



reply via email to

[Prev in Thread] Current Thread [Next in Thread]