GNU bug report logs - #73612
[PATCH 0/2] Add btrfs support and vfat file system options

Previous Next

Package: guix-patches;

Reported by: Roman Scherer <roman <at> burningswell.com>

Date: Thu, 3 Oct 2024 12:12:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 73612 <at> debbugs.gnu.org (full text, mbox):

From: Roman Scherer <roman <at> burningswell.com>
To: 73612 <at> debbugs.gnu.org
Cc: Roman Scherer <roman <at> burningswell.com>
Subject: [PATCH 1/2] image: Use file system options in make-vfat-image.
Date: Thu,  3 Oct 2024 14:13:31 +0200
* gnu/build/image.scm (make-vfat-image): Use file system options.

Change-Id: I791aadd2803d1ef96fc79cf8910a74a0083d2b6e
---
 doc/guix.texi       |  3 ++-
 gnu/build/image.scm | 24 ++++++++++++++----------
 2 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 52e36e4354..87904761f0 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -47918,7 +47918,8 @@ partition Reference
 @item @code{file-system-options} (default: @code{'()})
 The partition file system creation options that should be passed to the
 partition creation tool, as a list of strings.  This is only supported
-when creating @code{"ext4"} partitions.
+when creating @code{"vfat"}, @code{"fat16"}, @code{"fat32"} or
+@code{"ext4"} partitions.
 
 See the @code{"extended-options"} man page section of the
 @code{"mke2fs"} tool for a more complete reference.
diff --git a/gnu/build/image.scm b/gnu/build/image.scm
index 6ca0a428e0..50518585f8 100644
--- a/gnu/build/image.scm
+++ b/gnu/build/image.scm
@@ -105,17 +105,21 @@ (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))
-        (flags (partition-flags partition)))
+        (flags (partition-flags partition))
+        (fs-options (partition-file-system-options 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))
-                    ;; u-boot in particular needs the formatted block
-                    ;; size and the physical block size to be equal.
-                    ;; TODO: What about 4k blocks?
-                    (if (member 'esp flags) (list "-S" "512") '()))
+           "-F" (number->string fs-bits)
+           (size-in-kib
+            (if (eq? size 'guess)
+                (estimate-partition-size root)
+                size))
+           ;; u-boot in particular needs the formatted block
+           ;; size and the physical block size to be equal.
+           ;; TODO: What about 4k blocks?
+           (if (and (member 'esp flags)
+                    (not (member "-S" fs-options)))
+               (append (list "-S" "512") fs-options)
+               fs-options))
     (for-each (lambda (file)
                 (unless (member file '("." ".."))
                   (invoke "mcopy" "-bsp" "-i" target
-- 
2.46.0





This bug report was last modified 214 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.