From 70c7b7c79920dd6500ba5e4e88fe147cc44923d8 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Tue, 24 Sep 2019 11:56:46 +0200 Subject: installer: Update to Guile-Parted 0.0.2 release. * gnu/installer/parted.scm (data-partition?, metadata-partition?, freespace-partition?, normal-partition?, extended-partition?, logical-partition?): Remove, as now provided by Guile-Parted. * gnu/installer/newt/partition.scm (run-disk-page): Remove disk-destroy calls, replace disk-delete-all by disk-remove-all-partitions and disk-delete-partition by disk-remove-partition*. --- gnu/installer/parted.scm | 48 ++++-------------------------------------------- 1 file changed, 4 insertions(+), 44 deletions(-) (limited to 'gnu/installer/parted.scm') diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm index 682e233d9f..3439f211e2 100644 --- a/gnu/installer/parted.scm +++ b/gnu/installer/parted.scm @@ -64,13 +64,7 @@ (define-module (gnu installer parted) user-partition-parted-object find-esp-partition - data-partition? - metadata-partition? - freespace-partition? small-freespace-partition? - normal-partition? - extended-partition? - logical-partition? esp-partition? boot-partition? default-esp-mount-point @@ -172,24 +166,6 @@ (define (find-esp-partition partitions) "Find and return the ESP partition among PARTITIONS." (find esp-partition? partitions)) -(define (data-partition? partition) - "Return #t if PARTITION is a partition dedicated to data (by opposition to -freespace, metadata and protected partition types), return #f otherwise." - (let ((type (partition-type partition))) - (not (any (lambda (flag) - (member flag type)) - '(free-space metadata protected))))) - -(define (metadata-partition? partition) - "Return #t if PARTITION is a metadata partition, #f otherwise." - (let ((type (partition-type partition))) - (member 'metadata type))) - -(define (freespace-partition? partition) - "Return #t if PARTITION is a free-space partition, #f otherwise." - (let ((type (partition-type partition))) - (member 'free-space type))) - (define* (small-freespace-partition? device partition #:key (max-size MEBIBYTE-SIZE)) @@ -200,21 +176,6 @@ (define* (small-freespace-partition? device (device-sector-size device)))) (< size max-sector-size))) -(define (normal-partition? partition) - "return #t if partition is a normal partition, #f otherwise." - (let ((type (partition-type partition))) - (member 'normal type))) - -(define (extended-partition? partition) - "return #t if partition is an extended partition, #f otherwise." - (let ((type (partition-type partition))) - (member 'extended type))) - -(define (logical-partition? partition) - "Return #t if PARTITION is a logical partition, #f otherwise." - (let ((type (partition-type partition))) - (member 'logical type))) - (define (partition-user-type partition) "Return the type of PARTITION, to be stored in the TYPE field of record. It can be 'normal, 'extended or 'logical." @@ -813,7 +774,7 @@ (define* (extend-ranges! start-range end-range (define (rmpart disk number) "Remove the partition with the given NUMBER on DISK." (let ((partition (disk-get-partition disk number))) - (disk-remove-partition disk partition))) + (disk-remove-partition* disk partition))) ;; @@ -928,12 +889,12 @@ (define* (auto-partition! disk (if has-extended? ;; msdos - remove everything. - (disk-delete-all disk) + (disk-remove-all-partitions disk) ;; gpt - remove everything but esp if it exists. (for-each (lambda (partition) (and (data-partition? partition) - (disk-remove-partition disk partition))) + (disk-remove-partition* disk partition))) non-boot-partitions)) (let* ((start-partition @@ -1348,7 +1309,7 @@ (define (user-partitions->configuration user-partitions) (define (init-parted) "Initialize libparted support." - (probe-all-devices) + (probe-all-devices!) (exception-set-handler (lambda (exception) EXCEPTION-OPTION-UNHANDLED))) @@ -1364,7 +1325,6 @@ (define (free-parted devices) ;; https://mail.gnome.org/archives/commits-list/2013-March/msg18423.html. (let ((device-file-names (map device-path devices))) (for-each force-device-sync devices) - (free-all-devices) (for-each (lambda (file-name) (let ((in-use? (with-delay-device-in-use? file-name))) (and in-use? -- cgit v1.2.3