guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

16/17: installer: Support XFS.


From: guix-commits
Subject: 16/17: installer: Support XFS.
Date: Thu, 23 Sep 2021 12:20:57 -0400 (EDT)

nckx pushed a commit to branch master
in repository guix.

commit f34b8087411cffb0a572c0ecdce92084f0593fd4
Author: Tobias Geerinckx-Rice <me@tobias.gr>
AuthorDate: Thu Sep 23 13:05:43 2021 +0200

    installer: Support XFS.
    
    * gnu/installer/newt/partition.scm (run-fs-type-page): Add ‘xfs’ to the
    list box.
    * gnu/installer/parted.scm (user-fs-type-name, user-fs-type->mount-type)
    (partition-filesystem-user-type): Add ‘xfs’ mapping.
    (create-xfs-file-system): New procedure.
    (format-user-partitions): Use it.
    * gnu/installer.scm (set-installer-path): Add xfsprogs.
---
 gnu/installer.scm                |  1 +
 gnu/installer/newt/partition.scm |  2 +-
 gnu/installer/parted.scm         | 14 +++++++++++++-
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/gnu/installer.scm b/gnu/installer.scm
index d2be4b3..600fb76 100644
--- a/gnu/installer.scm
+++ b/gnu/installer.scm
@@ -330,6 +330,7 @@ selected keymap."
                        btrfs-progs
                        jfsutils ;jfs_mkfs
                        ntfs-3g ;mkfs.ntfs
+                       xfsprogs ;mkfs.xfs
                        kbd ;chvt
                        guix ;guix system init call
                        util-linux ;mkwap
diff --git a/gnu/installer/newt/partition.scm b/gnu/installer/newt/partition.scm
index fe30953..ea524eb 100644
--- a/gnu/installer/newt/partition.scm
+++ b/gnu/installer/newt/partition.scm
@@ -131,7 +131,7 @@ Be careful, all data on the disk will be lost.")
   (run-listbox-selection-page
    #:info-text (G_ "Please select the file-system type for this partition.")
    #:title (G_ "File-system type")
-   #:listbox-items '(ext4 btrfs fat16 fat32 jfs ntfs swap)
+   #:listbox-items '(ext4 btrfs fat16 fat32 jfs ntfs xfs swap)
    #:listbox-item->text user-fs-type-name
    #:sort-listbox-items? #f
    #:button-text (G_ "Exit")
diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm
index c000b1d..83a8836 100644
--- a/gnu/installer/parted.scm
+++ b/gnu/installer/parted.scm
@@ -231,6 +231,7 @@ inferior to MAX-SIZE, #f otherwise."
     ((fat32) "fat32")
     ((jfs)   "jfs")
     ((ntfs)  "ntfs")
+    ((xfs)   "xfs")
     ((swap)  "linux-swap")))
 
 (define (user-fs-type->mount-type fs-type)
@@ -241,7 +242,8 @@ inferior to MAX-SIZE, #f otherwise."
     ((fat16) "vfat")
     ((fat32) "vfat")
     ((jfs)   "jfs")
-    ((ntfs)  "ntfs")))
+    ((ntfs)  "ntfs")
+    ((xfs)   "xfs")))
 
 (define (partition-filesystem-user-type partition)
   "Return the filesystem type of PARTITION, to be stored in the FS-TYPE field
@@ -256,6 +258,7 @@ of <user-partition> record."
             ((string=? name "fat32") 'fat32)
             ((string=? name "jfs") 'jfs)
             ((string=? name "ntfs") 'ntfs)
+            ((string=? name "xfs") 'xfs)
             ((or (string=? name "swsusp")
                  (string=? name "linux-swap(v0)")
                  (string=? name "linux-swap(v1)"))
@@ -1125,6 +1128,11 @@ bit bucket."
   (with-null-output-ports
    (invoke "mkfs.ntfs" "-F" "-f" partition)))
 
+(define (create-xfs-file-system partition)
+  "Create an XFS file-system for PARTITION file-name."
+  (with-null-output-ports
+   (invoke "mkfs.xfs" "-f" partition)))
+
 (define (create-swap-partition partition)
   "Set up swap area on PARTITION file-name."
   (with-null-output-ports
@@ -1206,6 +1214,10 @@ NEED-FORMATING? field set to #t."
           (and need-formatting?
                (not (eq? type 'extended))
                (create-ntfs-file-system file-name)))
+         ((xfs)
+          (and need-formatting?
+               (not (eq? type 'extended))
+               (create-xfs-file-system file-name)))
          ((swap)
           (create-swap-partition file-name))
          (else



reply via email to

[Prev in Thread] Current Thread [Next in Thread]