installer: Add NTFS support.

This adds support for creating and editing NTFS partitions. It is however not
possible yet to create root NTFS partitions, as overlaying on top of a fuse
partition does not seem supported.

* gnu/installer.scm (installer-program): Add "ntfs-3g" to the inputs.
* gnu/installer/parted.scm (user-fs-type-name, user-fs-type->mount-type,
partition-filesystem-user-type, create-ntfs-file-system,
format-user-partitions): Add NTFS support.
* gnu/installer/newt/partition.scm (run-fs-type-page): Add NTFS support.
This commit is contained in:
Mathieu Othacehe 2020-07-26 10:30:57 +02:00
parent 675e56221e
commit 218a67dfab
No known key found for this signature in database
GPG Key ID: 8354763531769CA6
3 changed files with 16 additions and 3 deletions

View File

@ -320,6 +320,7 @@ selected keymap."
e2fsprogs ;mkfs.ext4
btrfs-progs
jfsutils ;jfs_mkfs
ntfs-3g ;mkfs.ntfs
kbd ;chvt
guix ;guix system init call
util-linux ;mkwap

View File

@ -121,7 +121,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 swap)
#:listbox-items '(ext4 btrfs fat16 fat32 jfs ntfs swap)
#:listbox-item->text user-fs-type-name
#:sort-listbox-items? #f
#:button-text (G_ "Exit")

View File

@ -222,7 +222,8 @@ inferior to MAX-SIZE, #f otherwise."
((btrfs) "btrfs")
((fat16) "fat16")
((fat32) "fat32")
((jfs) "jfs")
((jfs) "jfs")
((ntfs) "ntfs")
((swap) "linux-swap")))
(define (user-fs-type->mount-type fs-type)
@ -232,7 +233,8 @@ inferior to MAX-SIZE, #f otherwise."
((btrfs) "btrfs")
((fat16) "fat")
((fat32) "vfat")
((jfs) "jfs")))
((jfs) "jfs")
((ntfs) "ntfs")))
(define (partition-filesystem-user-type partition)
"Return the filesystem type of PARTITION, to be stored in the FS-TYPE field
@ -246,6 +248,7 @@ of <user-partition> record."
((string=? name "fat16") 'fat16)
((string=? name "fat32") 'fat32)
((string=? name "jfs") 'jfs)
((string=? name "ntfs") 'ntfs)
((or (string=? name "swsusp")
(string=? name "linux-swap(v0)")
(string=? name "linux-swap(v1)"))
@ -1040,6 +1043,11 @@ bit bucket."
(with-null-output-ports
(invoke "jfs_mkfs" "-f" partition)))
(define (create-ntfs-file-system partition)
"Create a JFS file-system for PARTITION file-name."
(with-null-output-ports
(invoke "mkfs.ntfs" "-F" "-f" partition)))
(define (create-swap-partition partition)
"Set up swap area on PARTITION file-name."
(with-null-output-ports
@ -1117,6 +1125,10 @@ NEED-FORMATING? field set to #t."
(and need-formatting?
(not (eq? type 'extended))
(create-jfs-file-system file-name)))
((ntfs)
(and need-formatting?
(not (eq? type 'extended))
(create-ntfs-file-system file-name)))
((swap)
(create-swap-partition file-name))
(else