diff options
| author | Mathieu Othacehe <othacehe@gnu.org> | 2020-07-26 10:30:57 +0200 |
|---|---|---|
| committer | Mathieu Othacehe <othacehe@gnu.org> | 2020-07-26 18:35:10 +0200 |
| commit | 218a67dfabcdf592325a8f8c49b86478f69ff589 (patch) | |
| tree | 3434eb6ae6ab76bfb7f91920f3c0cd35689c0419 | |
| parent | 675e56221e3dfc58cac94bf30835f16a9c41d530 (diff) | |
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.
| -rw-r--r-- | gnu/installer.scm | 1 | ||||
| -rw-r--r-- | gnu/installer/newt/partition.scm | 2 | ||||
| -rw-r--r-- | gnu/installer/parted.scm | 16 |
3 files changed, 16 insertions, 3 deletions
diff --git a/gnu/installer.scm b/gnu/installer.scm index 2c7315bde03..cb2f5ad2cac 100644 --- a/gnu/installer.scm +++ b/gnu/installer.scm | |||
| @@ -320,6 +320,7 @@ selected keymap." | |||
| 320 | e2fsprogs ;mkfs.ext4 | 320 | e2fsprogs ;mkfs.ext4 |
| 321 | btrfs-progs | 321 | btrfs-progs |
| 322 | jfsutils ;jfs_mkfs | 322 | jfsutils ;jfs_mkfs |
| 323 | ntfs-3g ;mkfs.ntfs | ||
| 323 | kbd ;chvt | 324 | kbd ;chvt |
| 324 | guix ;guix system init call | 325 | guix ;guix system init call |
| 325 | util-linux ;mkwap | 326 | util-linux ;mkwap |
diff --git a/gnu/installer/newt/partition.scm b/gnu/installer/newt/partition.scm index c925e410a92..54d595f54ef 100644 --- a/gnu/installer/newt/partition.scm +++ b/gnu/installer/newt/partition.scm | |||
| @@ -121,7 +121,7 @@ Be careful, all data on the disk will be lost.") | |||
| 121 | (run-listbox-selection-page | 121 | (run-listbox-selection-page |
| 122 | #:info-text (G_ "Please select the file-system type for this partition.") | 122 | #:info-text (G_ "Please select the file-system type for this partition.") |
| 123 | #:title (G_ "File-system type") | 123 | #:title (G_ "File-system type") |
| 124 | #:listbox-items '(ext4 btrfs fat16 fat32 jfs swap) | 124 | #:listbox-items '(ext4 btrfs fat16 fat32 jfs ntfs swap) |
| 125 | #:listbox-item->text user-fs-type-name | 125 | #:listbox-item->text user-fs-type-name |
| 126 | #:sort-listbox-items? #f | 126 | #:sort-listbox-items? #f |
| 127 | #:button-text (G_ "Exit") | 127 | #:button-text (G_ "Exit") |
diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm index 6c805cc0537..47e0a9e78d2 100644 --- a/gnu/installer/parted.scm +++ b/gnu/installer/parted.scm | |||
| @@ -222,7 +222,8 @@ inferior to MAX-SIZE, #f otherwise." | |||
| 222 | ((btrfs) "btrfs") | 222 | ((btrfs) "btrfs") |
| 223 | ((fat16) "fat16") | 223 | ((fat16) "fat16") |
| 224 | ((fat32) "fat32") | 224 | ((fat32) "fat32") |
| 225 | ((jfs) "jfs") | 225 | ((jfs) "jfs") |
| 226 | ((ntfs) "ntfs") | ||
| 226 | ((swap) "linux-swap"))) | 227 | ((swap) "linux-swap"))) |
| 227 | 228 | ||
| 228 | (define (user-fs-type->mount-type fs-type) | 229 | (define (user-fs-type->mount-type fs-type) |
| @@ -232,7 +233,8 @@ inferior to MAX-SIZE, #f otherwise." | |||
| 232 | ((btrfs) "btrfs") | 233 | ((btrfs) "btrfs") |
| 233 | ((fat16) "fat") | 234 | ((fat16) "fat") |
| 234 | ((fat32) "vfat") | 235 | ((fat32) "vfat") |
| 235 | ((jfs) "jfs"))) | 236 | ((jfs) "jfs") |
| 237 | ((ntfs) "ntfs"))) | ||
| 236 | 238 | ||
| 237 | (define (partition-filesystem-user-type partition) | 239 | (define (partition-filesystem-user-type partition) |
| 238 | "Return the filesystem type of PARTITION, to be stored in the FS-TYPE field | 240 | "Return the filesystem type of PARTITION, to be stored in the FS-TYPE field |
| @@ -246,6 +248,7 @@ of <user-partition> record." | |||
| 246 | ((string=? name "fat16") 'fat16) | 248 | ((string=? name "fat16") 'fat16) |
| 247 | ((string=? name "fat32") 'fat32) | 249 | ((string=? name "fat32") 'fat32) |
| 248 | ((string=? name "jfs") 'jfs) | 250 | ((string=? name "jfs") 'jfs) |
| 251 | ((string=? name "ntfs") 'ntfs) | ||
| 249 | ((or (string=? name "swsusp") | 252 | ((or (string=? name "swsusp") |
| 250 | (string=? name "linux-swap(v0)") | 253 | (string=? name "linux-swap(v0)") |
| 251 | (string=? name "linux-swap(v1)")) | 254 | (string=? name "linux-swap(v1)")) |
| @@ -1040,6 +1043,11 @@ bit bucket." | |||
| 1040 | (with-null-output-ports | 1043 | (with-null-output-ports |
| 1041 | (invoke "jfs_mkfs" "-f" partition))) | 1044 | (invoke "jfs_mkfs" "-f" partition))) |
| 1042 | 1045 | ||
| 1046 | (define (create-ntfs-file-system partition) | ||
| 1047 | "Create a JFS file-system for PARTITION file-name." | ||
| 1048 | (with-null-output-ports | ||
| 1049 | (invoke "mkfs.ntfs" "-F" "-f" partition))) | ||
| 1050 | |||
| 1043 | (define (create-swap-partition partition) | 1051 | (define (create-swap-partition partition) |
| 1044 | "Set up swap area on PARTITION file-name." | 1052 | "Set up swap area on PARTITION file-name." |
| 1045 | (with-null-output-ports | 1053 | (with-null-output-ports |
| @@ -1117,6 +1125,10 @@ NEED-FORMATING? field set to #t." | |||
| 1117 | (and need-formatting? | 1125 | (and need-formatting? |
| 1118 | (not (eq? type 'extended)) | 1126 | (not (eq? type 'extended)) |
| 1119 | (create-jfs-file-system file-name))) | 1127 | (create-jfs-file-system file-name))) |
| 1128 | ((ntfs) | ||
| 1129 | (and need-formatting? | ||
| 1130 | (not (eq? type 'extended)) | ||
| 1131 | (create-ntfs-file-system file-name))) | ||
| 1120 | ((swap) | 1132 | ((swap) |
| 1121 | (create-swap-partition file-name)) | 1133 | (create-swap-partition file-name)) |
| 1122 | (else | 1134 | (else |
