system: image: Support GPT vfat partitions.

* gnu/system/image.scm (system-disk-image): Support them.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
This commit is contained in:
Pavel Shlyak 2022-05-22 16:53:30 +03:00 committed by Mathieu Othacehe
parent 76139eb253
commit 6e99c020b8
No known key found for this signature in database
GPG key ID: 8354763531769CA6

View file

@ -320,12 +320,21 @@ (define (partition->dos-type partition)
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"))))
((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