From c5b1377840c3397e73de0d9f29bce60f8a91c286 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Thu, 9 May 2019 19:45:37 +0200 Subject: installer: Create btrfs file system. Fixes . * gnu/installer/parted.scm (create-btrfs-file-system): New procedure. (format-user-partitions): Use it. --- gnu/installer/parted.scm | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'gnu/installer/parted.scm') diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm index 7cc2217cbe..fc8c9de6f1 100644 --- a/gnu/installer/parted.scm +++ b/gnu/installer/parted.scm @@ -1042,6 +1042,11 @@ bit bucket." (with-error-to-port (%make-void-port "w") (lambda () exp ...))))) +(define (create-btrfs-file-system partition) + "Create an btrfs file-system for PARTITION file-name." + (with-null-output-ports + (invoke "mkfs.btrfs" "-f" partition))) + (define (create-ext4-file-system partition) "Create an ext4 file-system for PARTITION file-name." (with-null-output-ports @@ -1106,6 +1111,10 @@ NEED-FORMATING? field set to #t." (luks-format-and-open user-partition)) (case fs-type + ((btrfs) + (and need-formatting? + (not (eq? type 'extended)) + (create-btrfs-file-system file-name))) ((ext4) (and need-formatting? (not (eq? type 'extended)) -- cgit v1.2.3 From 628d09ae53047ea666f4f84ae5e5be911647fe8c Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Tue, 14 May 2019 01:29:30 +0200 Subject: installer: Add fat16. * gnu/installer/parted.scm (user-fs-type-name): Add fat16. (user-fs-type->mount-type): Add fat16. (create-fat16-file-system): New procedure. (format-user-partitions): Use it. --- gnu/installer/parted.scm | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'gnu/installer/parted.scm') diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm index fc8c9de6f1..e5ffe353fe 100644 --- a/gnu/installer/parted.scm +++ b/gnu/installer/parted.scm @@ -259,6 +259,7 @@ inferior to MAX-SIZE, #f otherwise." (case fs-type ((ext4) "ext4") ((btrfs) "btrfs") + ((fat16) "fat16") ((fat32) "fat32") ((swap) "linux-swap"))) @@ -267,6 +268,7 @@ inferior to MAX-SIZE, #f otherwise." (case fs-type ((ext4) "ext4") ((btrfs) "btrfs") + ((fat16) "fat") ((fat32) "vfat"))) (define (partition-filesystem-user-type partition) @@ -278,6 +280,7 @@ of record." (cond ((string=? name "ext4") 'ext4) ((string=? name "btrfs") 'btrfs) + ((string=? name "fat16") 'fat16) ((string=? name "fat32") 'fat32) ((or (string=? name "swsusp") (string=? name "linux-swap(v0)") @@ -1052,6 +1055,11 @@ bit bucket." (with-null-output-ports (invoke "mkfs.ext4" "-F" partition))) +(define (create-fat16-file-system partition) + "Create a fat16 file-system for PARTITION file-name." + (with-null-output-ports + (invoke "mkfs.fat" "-F16" partition))) + (define (create-fat32-file-system partition) "Create an ext4 file-system for PARTITION file-name." (with-null-output-ports @@ -1119,6 +1127,10 @@ NEED-FORMATING? field set to #t." (and need-formatting? (not (eq? type 'extended)) (create-ext4-file-system file-name))) + ((fat16) + (and need-formatting? + (not (eq? type 'extended)) + (create-fat16-file-system file-name))) ((fat32) (and need-formatting? (not (eq? type 'extended)) -- cgit v1.2.3 From b7488b321d551277ea5a62c7dfa6d565e6986958 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Tue, 14 May 2019 17:11:23 +0200 Subject: installer: Fix docstring. * gnu/installer/parted.scm (create-fat32-file-system): Fix docstring. --- gnu/installer/parted.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnu/installer/parted.scm') diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm index e5ffe353fe..6975ecd519 100644 --- a/gnu/installer/parted.scm +++ b/gnu/installer/parted.scm @@ -1061,7 +1061,7 @@ bit bucket." (invoke "mkfs.fat" "-F16" partition))) (define (create-fat32-file-system partition) - "Create an ext4 file-system for PARTITION file-name." + "Create a fat32 file-system for PARTITION file-name." (with-null-output-ports (invoke "mkfs.fat" "-F32" partition))) -- cgit v1.2.3 From 15374648193f813d036f377bb1e944c9bafd4636 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 15 May 2019 14:33:23 +0200 Subject: installer: Rename 'auto-partition' to 'auto-partition!'. This is a followup to 7d567af46b4e10ffafb1d0f76b524f5781460598. * gnu/installer/parted.scm (create-adjacent-partitions): Rename to... (create-adjacent-partitions!): ... this. Make private. (auto-partition): Rename to... (auto-partition!): ... this. * gnu/installer/newt/partition.scm (run-partioning-page): Adjust accordingly. --- gnu/installer/newt/partition.scm | 2 +- gnu/installer/parted.scm | 21 ++++++++++----------- 2 files changed, 11 insertions(+), 12 deletions(-) (limited to 'gnu/installer/parted.scm') diff --git a/gnu/installer/newt/partition.scm b/gnu/installer/newt/partition.scm index 2960adcf06..abc8bdcc03 100644 --- a/gnu/installer/newt/partition.scm +++ b/gnu/installer/newt/partition.scm @@ -754,7 +754,7 @@ by pressing the Exit button.~%~%"))) (initial-partitions (disk-partitions disk)) (scheme (symbol-append method '- (run-scheme-page))) (user-partitions (append - (auto-partition disk #:scheme scheme) + (auto-partition! disk #:scheme scheme) (create-special-user-partitions initial-partitions)))) (run-disk-page (list disk) user-partitions diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm index 6975ecd519..4ccc0b1f51 100644 --- a/gnu/installer/parted.scm +++ b/gnu/installer/parted.scm @@ -105,8 +105,7 @@ mkpart rmpart - create-adjacent-partitions - auto-partition + auto-partition! &no-root-mount-point no-root-mount-point? @@ -821,8 +820,8 @@ cause them to cross." ;; Auto partitionning. ;; -(define* (create-adjacent-partitions disk partitions - #:key (last-partition-end 0)) +(define* (create-adjacent-partitions! disk partitions + #:key (last-partition-end 0)) "Create the given PARTITIONS on DISK. LAST-PARTITION-END is the sector from which we want to start creating partitions. The START and END of each created partition are computed from its SIZE value and the position of the last @@ -888,9 +887,9 @@ USER-PARTITIONS list and return the updated list." (need-formatting? #t))) user-partitions)) -(define* (auto-partition disk - #:key - (scheme 'entire-root)) +(define* (auto-partition! disk + #:key + (scheme 'entire-root)) "Automatically create partitions on DISK. All the previous partitions (except the ESP on a GPT disk, if present) are wiped. SCHEME is the desired partitioning scheme. It can be 'entire-root or @@ -1002,10 +1001,10 @@ swap partition, a root partition and a home partition." (mount-point "/home"))))))) (new-partitions* (force-user-partitions-formatting new-partitions))) - (create-adjacent-partitions disk - new-partitions* - #:last-partition-end - (or end-esp-partition 0))))) + (create-adjacent-partitions! disk + new-partitions* + #:last-partition-end + (or end-esp-partition 0))))) ;; -- cgit v1.2.3 From d68de958b60426798ed62797ff7c96c327a672ac Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 19 May 2019 11:58:36 +0200 Subject: installer: Fix Guile-Parted crash on i686. Fixes . This is a followup to 7d567af46b4e10ffafb1d0f76b524f5781460598. * gnu/installer/parted.scm (auto-partition!): Append ESP-PARTITION, when it is true, to the result of 'create-adjacent-partitions!'. * gnu/installer/newt/partition.scm (run-partioning-page): Remove 'initial-partitions' variable, and remove call to 'create-special-user-partitions'. Co-authored-by: Mathieu Othacehe --- gnu/installer/newt/partition.scm | 6 +----- gnu/installer/parted.scm | 16 +++++++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) (limited to 'gnu/installer/parted.scm') diff --git a/gnu/installer/newt/partition.scm b/gnu/installer/newt/partition.scm index abc8bdcc03..cd9d46316a 100644 --- a/gnu/installer/newt/partition.scm +++ b/gnu/installer/newt/partition.scm @@ -751,12 +751,8 @@ by pressing the Exit button.~%~%"))) (disk (mklabel device label))) (disk-commit disk) disk))) - (initial-partitions (disk-partitions disk)) (scheme (symbol-append method '- (run-scheme-page))) - (user-partitions (append - (auto-partition! disk #:scheme scheme) - (create-special-user-partitions - initial-partitions)))) + (user-partitions (auto-partition! disk #:scheme scheme))) (run-disk-page (list disk) user-partitions #:guided? #t))) ((eq? method 'manual) diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm index 4ccc0b1f51..bd2640d1ad 100644 --- a/gnu/installer/parted.scm +++ b/gnu/installer/parted.scm @@ -895,7 +895,10 @@ partitions (except the ESP on a GPT disk, if present) are wiped. SCHEME is the desired partitioning scheme. It can be 'entire-root or 'entire-root-home. 'entire-root will create a swap partition and a root partition occupying all the remaining space. 'entire-root-home will create a -swap partition, a root partition and a home partition." +swap partition, a root partition and a home partition. + +Return the complete list of partitions on DISK, including the ESP when it +exists." (let* ((device (disk-device disk)) (disk-type (disk-disk-type disk)) (has-extended? (disk-type-check-feature @@ -1001,10 +1004,13 @@ swap partition, a root partition and a home partition." (mount-point "/home"))))))) (new-partitions* (force-user-partitions-formatting new-partitions))) - (create-adjacent-partitions! disk - new-partitions* - #:last-partition-end - (or end-esp-partition 0))))) + (append (if esp-partition + (list (partition->user-partition esp-partition)) + '()) + (create-adjacent-partitions! disk + new-partitions* + #:last-partition-end + (or end-esp-partition 0)))))) ;; -- cgit v1.2.3