me
/
guix
Archived
1
0
Fork 0

image: Prefer gpt partition table for efi images

* gnu/system/image.scm (efi-disk-image): Use gpt partition-table-type.
(efi32-disk-image): Use gpt partition-table-type.
(qcow2-image-type): Use mbr partition-table-type explicitly.
* gnu/tests/image.scm: Assert partition table type of efi-disk-image.

Signed-off-by: Josselin Poiret <dev@jpoiret.xyz>
Sergey Trofimov 2023-03-22 13:53:28 +01:00 committed by Josselin Poiret
parent 4722496292
commit 209204e23b
No known key found for this signature in database
GPG Key ID: 505E40B916171A8A
2 changed files with 21 additions and 5 deletions

View File

@ -148,11 +148,13 @@ parent image record."
(define efi-disk-image (define efi-disk-image
(image-without-os (image-without-os
(format 'disk-image) (format 'disk-image)
(partition-table-type 'gpt)
(partitions (list esp-partition root-partition)))) (partitions (list esp-partition root-partition))))
(define efi32-disk-image (define efi32-disk-image
(image-without-os (image-without-os
(format 'disk-image) (format 'disk-image)
(partition-table-type 'gpt)
(partitions (list esp32-partition root-partition)))) (partitions (list esp32-partition root-partition))))
(define iso9660-image (define iso9660-image
@ -215,6 +217,7 @@ set to the given OS."
(constructor (cut image-with-os (constructor (cut image-with-os
(image (image
(inherit efi-disk-image) (inherit efi-disk-image)
(partition-table-type 'mbr)
(name 'image.qcow2) (name 'image.qcow2)
(format 'compressed-qcow2)) (format 'compressed-qcow2))
<>)))) <>))))

View File

@ -20,7 +20,7 @@
#:use-module (gnu) #:use-module (gnu)
#:use-module (gnu image) #:use-module (gnu image)
#:use-module (gnu tests) #:use-module (gnu tests)
#:autoload (gnu system image) (system-image root-offset) #:autoload (gnu system image) (system-image root-offset image-with-os efi-disk-image)
#:use-module (gnu system uuid) #:use-module (gnu system uuid)
#:use-module (gnu system vm) #:use-module (gnu system vm)
#:use-module (gnu packages guile) #:use-module (gnu packages guile)
@ -153,6 +153,10 @@
(flags '(boot)) (flags '(boot))
(initializer dummy-initializer)))))) (initializer dummy-initializer))))))
;; A efi disk image with default partitions
(define i6
(image-with-os efi-disk-image %simple-efi-os))
(define (run-images-test) (define (run-images-test)
(define test (define test
(with-imported-modules '((srfi srfi-64) (with-imported-modules '((srfi srfi-64)
@ -259,6 +263,15 @@
(filter data-partition? (filter data-partition?
(disk-partitions (disk-new d5-device))))) (disk-partitions (disk-new d5-device)))))
;; Image i6.
(define i6-image
#$(system-image i6))
(define d6-device
(get-device i6-image))
(test-equal "gpt"
(disk-type-name (disk-probe d6-device)))
(test-end))))) (test-end)))))
(gexp->derivation "images-test" test)) (gexp->derivation "images-test" test))