From 218a67dfabcdf592325a8f8c49b86478f69ff589 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Sun, 26 Jul 2020 10:30:57 +0200 Subject: 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. --- gnu/installer/newt/partition.scm | 2 +- gnu/installer/parted.scm | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'gnu/installer') diff --git a/gnu/installer/newt/partition.scm b/gnu/installer/newt/partition.scm index c925e410a9..54d595f54e 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.") (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") diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm index 6c805cc053..47e0a9e78d 100644 --- a/gnu/installer/parted.scm +++ b/gnu/installer/parted.scm @@ -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 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 -- cgit 1.4.1 From 5697a524a75efae6144fcfaad730115910a34171 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Thu, 6 Aug 2020 11:24:58 +0200 Subject: installer: Remove logical devices. If a device contains an active logical volume, BLKRRPART will report that the device is busy. This will cause this device to be filtered by "non-install-devices" procedure, which is not desired. Make sure to deactivate all logical volumes before device probing. Fixes . * gnu/installer.scm (installer-program): Add lvm2-static to the inputs. * gnu/installer/parted.scm (remove-logical-devices): New procedure, (init-parted): call it. --- gnu/installer.scm | 1 + gnu/installer/parted.scm | 8 ++++++++ 2 files changed, 9 insertions(+) (limited to 'gnu/installer') diff --git a/gnu/installer.scm b/gnu/installer.scm index cb2f5ad2ca..5c3192d7a6 100644 --- a/gnu/installer.scm +++ b/gnu/installer.scm @@ -318,6 +318,7 @@ selected keymap." cryptsetup dosfstools ;mkfs.fat e2fsprogs ;mkfs.ext4 + lvm2-static ;dmsetup btrfs-progs jfsutils ;jfs_mkfs ntfs-3g ;mkfs.ntfs diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm index 47e0a9e78d..ff5f6afd19 100644 --- a/gnu/installer/parted.scm +++ b/gnu/installer/parted.scm @@ -330,6 +330,11 @@ fail. See rereadpt function in wipefs.c of util-linux for an explanation." (device-sync device) (device-close device)) +(define (remove-logical-devices) + "Remove all active logical devices." + (with-null-output-ports + (invoke "dmsetup" "remove_all"))) + (define (non-install-devices) "Return all the available devices, except the busy one, allegedly the install device. DEVICE-IS-BUSY? is a parted call, checking if the device is @@ -1340,6 +1345,9 @@ USER-PARTITIONS, or return nothing." (define (init-parted) "Initialize libparted support." (probe-all-devices!) + ;; Remove all logical devices, otherwise "device-is-busy?" will report true + ;; on all devices containaing active logical volumes. + (remove-logical-devices) (exception-set-handler (lambda (exception) EXCEPTION-OPTION-UNHANDLED))) -- cgit 1.4.1