mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-25 05:48:07 -05:00
installer: Add MSDOS disk label support on UEFI systems.
Fixes: <https://issues.guix.gnu.org/47889>. * gnu/installer/parted.scm (esp-partition?): Remove the MSDOS check. (auto-partition!): On MSDOS disks, check if an ESP partition is present. If that's the case, do not remove it. Otherwise, if UEFI is supported, create one.
This commit is contained in:
parent
2b645e359e
commit
c254af8c73
1 changed files with 19 additions and 26 deletions
|
@ -70,6 +70,7 @@ (define-module (gnu installer parted)
|
||||||
small-freespace-partition?
|
small-freespace-partition?
|
||||||
esp-partition?
|
esp-partition?
|
||||||
boot-partition?
|
boot-partition?
|
||||||
|
efi-installation?
|
||||||
default-esp-mount-point
|
default-esp-mount-point
|
||||||
|
|
||||||
with-delay-device-in-use?
|
with-delay-device-in-use?
|
||||||
|
@ -193,12 +194,8 @@ (define (partition-user-type partition)
|
||||||
(define (esp-partition? partition)
|
(define (esp-partition? partition)
|
||||||
"Return #t if partition has the ESP flag, return #f otherwise."
|
"Return #t if partition has the ESP flag, return #f otherwise."
|
||||||
(let* ((disk (partition-disk partition))
|
(let* ((disk (partition-disk partition))
|
||||||
(disk-type (disk-disk-type disk))
|
(disk-type (disk-disk-type disk)))
|
||||||
(has-extended? (disk-type-check-feature
|
|
||||||
disk-type
|
|
||||||
DISK-TYPE-FEATURE-EXTENDED)))
|
|
||||||
(and (data-partition? partition)
|
(and (data-partition? partition)
|
||||||
(not has-extended?)
|
|
||||||
(partition-is-flag-available? partition PARTITION-FLAG-ESP)
|
(partition-is-flag-available? partition PARTITION-FLAG-ESP)
|
||||||
(partition-get-flag partition PARTITION-FLAG-ESP))))
|
(partition-get-flag partition PARTITION-FLAG-ESP))))
|
||||||
|
|
||||||
|
@ -918,30 +915,26 @@ (define* (auto-partition! disk
|
||||||
;; disk space. Otherwise, set the swap size to 5% of the disk space.
|
;; disk space. Otherwise, set the swap size to 5% of the disk space.
|
||||||
(swap-size (min default-swap-size five-percent-disk)))
|
(swap-size (min default-swap-size five-percent-disk)))
|
||||||
|
|
||||||
(if has-extended?
|
;; Remove everything but esp if it exists.
|
||||||
;; msdos - remove everything.
|
(for-each
|
||||||
(disk-remove-all-partitions disk)
|
(lambda (partition)
|
||||||
;; gpt - remove everything but esp if it exists.
|
(and (data-partition? partition)
|
||||||
(for-each
|
(disk-remove-partition* disk partition)))
|
||||||
(lambda (partition)
|
non-boot-partitions)
|
||||||
(and (data-partition? partition)
|
|
||||||
(disk-remove-partition* disk partition)))
|
|
||||||
non-boot-partitions))
|
|
||||||
|
|
||||||
(let* ((start-partition
|
(let* ((start-partition
|
||||||
(and (not has-extended?)
|
(if (efi-installation?)
|
||||||
(if (efi-installation?)
|
(and (not esp-partition)
|
||||||
(and (not esp-partition)
|
|
||||||
(user-partition
|
|
||||||
(fs-type 'fat32)
|
|
||||||
(esp? #t)
|
|
||||||
(size new-esp-size)
|
|
||||||
(mount-point (default-esp-mount-point))))
|
|
||||||
(user-partition
|
(user-partition
|
||||||
(fs-type 'ext4)
|
(fs-type 'fat32)
|
||||||
(bootable? #t)
|
(esp? #t)
|
||||||
(bios-grub? #t)
|
(size new-esp-size)
|
||||||
(size bios-grub-size)))))
|
(mount-point (default-esp-mount-point))))
|
||||||
|
(user-partition
|
||||||
|
(fs-type 'ext4)
|
||||||
|
(bootable? #t)
|
||||||
|
(bios-grub? #t)
|
||||||
|
(size bios-grub-size))))
|
||||||
(new-partitions
|
(new-partitions
|
||||||
(cond
|
(cond
|
||||||
((or (eq? scheme 'entire-root)
|
((or (eq? scheme 'entire-root)
|
||||||
|
|
Loading…
Reference in a new issue