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 20:01:45 +0300 [thread overview]
Message-ID: <332533F2-B819-4EF4-9EAA-FBB55AAD13E5@pantherx.org> (raw)
In-Reply-To: <3078A40B-22B0-4492-BFD2-72D725F31689@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 227 bytes --]
I have written a small patch to partially fix the issue. Flags are still not set. GPT is still not fixed. There’s no need to return file systems that are not supported in make-partition-image function in gnu/build/image.scm
[-- Attachment #2: mbr-support-vfat-partitions.patch --]
[-- Type: application/octet-stream, Size: 1027 bytes --]
diff --git a/gnu/system/image.scm b/gnu/system/image.scm
index 42e215f614..a83f844682 100644
--- a/gnu/system/image.scm
+++ b/gnu/system/image.scm
@@ -304,10 +304,15 @@ (define (format->image-type format)
(define (partition->dos-type partition)
;; Return the MBR partition type corresponding to the given PARTITION.
;; See: https://en.wikipedia.org/wiki/Partition_type.
- (let ((flags (partition-flags partition)))
+ (let ((flags (partition-flags partition)) (file-system (partition-file-system partition)))
(cond
- ((member 'esp flags) "0xEF")
- (else "0x83"))))
+ ((member 'esp flags) "0xEF")
+ ((string-prefix? "ext" file-system) "0x83")
+ ((string=? file-system "vfat") "0x0E")
+ (else
+ (raise (condition
+ (&message
+ (message "unsupported partition type"))))))))
(define (partition->gpt-type partition)
;; Return the genimage GPT partition type code corresponding to PARTITION.
next prev parent reply other threads:[~2022-05-20 17:28 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 ` Pavel Shlyak [this message]
2022-05-20 19:54 ` bug#55406: WIP: Image API support for fat16 partitions Pavel Shlyak
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=332533F2-B819-4EF4-9EAA-FBB55AAD13E5@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).