[bug#35657] installer: Create btrfs file system.
diff mbox series

Message ID 20190509174537.7407-1-dannym@scratchpost.org
State New
Headers show
Series
  • [bug#35657] installer: Create btrfs file system.
Related show

Checks

Context Check Description
cbaines/applying patch success Successfully applied

Commit Message

Danny Milosavljevic May 9, 2019, 5:45 p.m. UTC
* gnu/installer/parted.scm (create-btrfs-file-system): New procedure.
(format-user-partitions): Use it.
---
 gnu/installer/parted.scm | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Ludovic Courtès May 10, 2019, 1:09 p.m. UTC | #1
Hi Danny,

Danny Milosavljevic <dannym@scratchpost.org> skribis:

> * gnu/installer/parted.scm (create-btrfs-file-system): New procedure.
> (format-user-partitions): Use it.

LGTM!

Actually I didn’t know one could choose Btrfs in the graphical
installer.  :-)  That’s in the manual partitioning scheme, right?

Thanks,
Ludo’.

Patch
diff mbox series

diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm
index 7cc2217cbe..fc8c9de6f1 100644
--- a/gnu/installer/parted.scm
+++ b/gnu/installer/parted.scm
@@ -1042,6 +1042,11 @@  bit bucket."
       (with-error-to-port (%make-void-port "w")
         (lambda () exp ...)))))
 
+(define (create-btrfs-file-system partition)
+  "Create an btrfs file-system for PARTITION file-name."
+  (with-null-output-ports
+   (invoke "mkfs.btrfs" "-f" partition)))
+
 (define (create-ext4-file-system partition)
   "Create an ext4 file-system for PARTITION file-name."
   (with-null-output-ports
@@ -1106,6 +1111,10 @@  NEED-FORMATING? field set to #t."
          (luks-format-and-open user-partition))
 
        (case fs-type
+         ((btrfs)
+          (and need-formatting?
+               (not (eq? type 'extended))
+               (create-btrfs-file-system file-name)))
          ((ext4)
           (and need-formatting?
                (not (eq? type 'extended))