From: Pavel Shlyak <p.shlyak@pantherx.org>
To: 55663@debbugs.gnu.org
Subject: [bug#55663] [PATCH] Image API: add FAT32 support
Date: Sun, 29 May 2022 17:35:50 +0300 [thread overview]
Message-ID: <4054081F-9D51-49E0-958F-C9B1BFA7FB24@pantherx.org> (raw)
In-Reply-To: <3EE7299C-64ED-4062-BA31-ADF3A6AD6A37@pantherx.org>
[-- Attachment #1: Type: text/plain, Size: 254 bytes --]
I have updated the patch so now it automatically sets block size for non-esp partitions. The previous behavior (for esp) was retained not to break things I’m not quite aware of.
Now I finally got correct/bootable partition layout with Raspberry PI4.
[-- Attachment #2: 0001-Image-API-support-FAT32-partitions.patch --]
[-- Type: application/octet-stream, Size: 3421 bytes --]
From 9049891a4fe9e9f4d66c78526fcdac9d5f0531bc Mon Sep 17 00:00:00 2001
From: Pavel Shlyak <p.shlyak@pantherx.org>
Date: Thu, 26 May 2022 21:00:51 +0300
Subject: [PATCH] Image API: support FAT32 partitions
---
gnu/build/image.scm | 24 ++++++++++++++----------
gnu/system/image.scm | 9 +++++++--
2 files changed, 21 insertions(+), 12 deletions(-)
diff --git a/gnu/build/image.scm b/gnu/build/image.scm
index 3e8b94e2d6..692fd1f28a 100644
--- a/gnu/build/image.scm
+++ b/gnu/build/image.scm
@@ -95,16 +95,18 @@ (define* (make-ext-image partition target root
(estimate-partition-size root)
size)))))))
-(define* (make-vfat-image partition target root)
+(define* (make-vfat-image partition target root fs_bits)
"Handle the creation of VFAT partition images. See 'make-partition-image'."
(let ((size (partition-size partition))
- (label (partition-label partition)))
- (invoke "fakeroot" "mkdosfs" "-n" label "-C" target
- "-F" "16" "-S" "1024"
- (size-in-kib
- (if (eq? size 'guess)
- (estimate-partition-size root)
- size)))
+ (label (partition-label partition))
+ (flags (partition-flags partition)))
+ (apply invoke "fakeroot" "mkdosfs" "-n" label "-C" target
+ "-F" (number->string fs_bits)
+ (size-in-kib
+ (if (eq? size 'guess)
+ (estimate-partition-size root)
+ size))
+ (if (member 'esp flags) (list "-S" "1024") '()))
(for-each (lambda (file)
(unless (member file '("." ".."))
(invoke "mcopy" "-bsp" "-i" target
@@ -120,8 +122,10 @@ (define* (make-partition-image partition-sexp target root)
(cond
((string-prefix? "ext" type)
(make-ext-image partition target root))
- ((string=? type "vfat")
- (make-vfat-image partition target root))
+ ((or (string=? type "vfat") (string=? type "fat16"))
+ (make-vfat-image partition target root 16))
+ ((string=? type "fat32")
+ (make-vfat-image partition target root 32))
(else
(raise (condition
(&message
diff --git a/gnu/system/image.scm b/gnu/system/image.scm
index dd32e58c2d..7e45f750d9 100644
--- a/gnu/system/image.scm
+++ b/gnu/system/image.scm
@@ -312,7 +312,8 @@ (define (partition->dos-type partition)
(cond
((member 'esp flags) "0xEF")
((string-prefix? "ext" file-system) "0x83")
- ((string=? file-system "vfat") "0x0E")
+ ((or (string=? file-system "vfat") (string=? file-system "fat16")) "0x0E")
+ ((string=? file-system "fat32") "0x0C")
(else
(raise (condition
(&message
@@ -329,7 +330,11 @@ (define (partition->gpt-type partition)
(cond
((member 'esp flags) "U")
((string-prefix? "ext" file-system) "L")
- ((string=? file-system "vfat") "F")
+ (
+ (or (string=? file-system "vfat")
+ (string=? file-system "fat16")
+ (string=? file-system "fat32")
+ ) "F")
(else
(raise (condition
(&message
--
2.32.1 (Apple Git-133)
next prev parent reply other threads:[~2022-05-29 14:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-26 18:02 [bug#55663] [PATCH] Image API: add FAT32 support Pavel Shlyak
2022-05-26 18:07 ` Tobias Geerinckx-Rice via Guix-patches via
2022-05-26 20:54 ` Pavel Shlyak
2022-05-29 11:46 ` Pavel Shlyak
2022-05-29 14:35 ` Pavel Shlyak [this message]
2022-05-30 7:01 ` Mathieu Othacehe
2022-05-30 9:01 ` Pavel Shlyak
2022-05-31 13:07 ` bug#55663: " 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4054081F-9D51-49E0-958F-C9B1BFA7FB24@pantherx.org \
--to=p.shlyak@pantherx.org \
--cc=55663@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 external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.