system: vm: Do not add EFI partition on ARM system.

* gnu/system/vm.scm (qemu-img): Do not add EFI partition if we are targetting
  ARM.

UEFI support on u-boot is still experimental, so do not add EFI partition on
ARM for now.
This commit is contained in:
Mathieu Othacehe 2017-11-29 15:12:01 +01:00
parent e45b573c2d
commit 00e39b2ea4
No known key found for this signature in database
GPG Key ID: 8354763531769CA6
1 changed files with 30 additions and 20 deletions

View File

@ -29,6 +29,7 @@
#:use-module (guix monads) #:use-module (guix monads)
#:use-module (guix records) #:use-module (guix records)
#:use-module (guix modules) #:use-module (guix modules)
#:use-module (guix utils)
#:use-module ((gnu build vm) #:use-module ((gnu build vm)
#:select (qemu-command)) #:select (qemu-command))
@ -312,17 +313,26 @@ the image."
graphs))) graphs)))
(- disk-image-size (- disk-image-size
(* 50 (expt 2 20))))) (* 50 (expt 2 20)))))
(partitions (list (partition (partitions
(append
(list (partition
(size root-size) (size root-size)
(label #$file-system-label) (label #$file-system-label)
(uuid #$(and=> file-system-uuid (uuid #$(and=> file-system-uuid
uuid-bytevector)) uuid-bytevector))
(file-system #$file-system-type) (file-system #$file-system-type)
(flags '(boot)) (flags '(boot))
(initializer initialize)) (initializer initialize)))
;; Append a small EFI System Partition for ;; Append a small EFI System Partition for use with UEFI
;; use with UEFI bootloaders. ;; bootloaders if we are not targetting ARM because UEFI
(partition ;; support in U-Boot is experimental.
;;
;; FIXME: target-arm32? may be not operate on the right
;; system/target values. Rewrite using let-system when
;; available.
(if #$(target-arm32?)
'()
(list (partition
;; The standalone grub image is about 10MiB, but ;; The standalone grub image is about 10MiB, but
;; leave some room for custom or multiple images. ;; leave some room for custom or multiple images.
(size (* 40 (expt 2 20))) (size (* 40 (expt 2 20)))
@ -331,7 +341,7 @@ the image."
;; when mounting. The actual FAT-ness is based ;; when mounting. The actual FAT-ness is based
;; on filesystem size (16 in this case). ;; on filesystem size (16 in this case).
(file-system "vfat") (file-system "vfat")
(flags '(esp)))))) (flags '(esp))))))))
(initialize-hard-disk "/dev/vda" (initialize-hard-disk "/dev/vda"
#:partitions partitions #:partitions partitions
#:grub-efi #$grub-efi #:grub-efi #$grub-efi