diff options
author | Marius Bakke <mbakke@fastmail.com> | 2017-05-07 15:31:30 +0200 |
---|---|---|
committer | Marius Bakke <mbakke@fastmail.com> | 2017-05-20 10:57:00 +0200 |
commit | 6520904b3e79a5f59bd681931d0ae72783e43eee (patch) | |
tree | 22f17e1865e8be55853da17a7ce3a5aa15809e1b /gnu/system | |
parent | 03119da21172c0c969b23596bec72b8383f7584e (diff) | |
download | guix-6520904b3e79a5f59bd681931d0ae72783e43eee.tar guix-6520904b3e79a5f59bd681931d0ae72783e43eee.tar.gz |
vm: Add UEFI loader to disk images.
* gnu/build/vm.scm (install-efi): New procedure.
(initialize-hard-disk): Generate EFI blob when ESP is present.
* gnu/system/vm.scm (qemu-image): Append 40MiB EFI System Partition.
(cherry picked from commit ecf5d5376979fadd971559367bf553df89fcc62b)
Diffstat (limited to 'gnu/system')
-rw-r--r-- | gnu/system/vm.scm | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index 2110ce68bb..c40bb4c436 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org> ;;; Copyright © 2016 Leo Famulari <leo@famulari.name> ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com> +;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -226,14 +227,27 @@ the image." #:system-directory #$os-derivation)) (partitions (list (partition (size #$(- disk-image-size - (* 10 (expt 2 20)))) + (* 50 (expt 2 20)))) (label #$file-system-label) (file-system #$file-system-type) (flags '(boot)) - (initializer initialize))))) + (initializer initialize)) + ;; Append a small EFI System Partition for + ;; use with UEFI bootloaders. + (partition + ;; The standalone grub image is about 10MiB, but + ;; leave some room for custom or multiple images. + (size (* 40 (expt 2 20))) + (label "GNU-ESP") ;cosmetic only + ;; Use "vfat" here since this property is used + ;; when mounting. The actual FAT-ness is based + ;; on filesystem size (16 in this case). + (file-system "vfat") + (flags '(esp)))))) (initialize-hard-disk "/dev/vda" #:partitions partitions - #:grub.cfg #$grub-configuration) + #:grub.cfg #$grub-configuration + #:grub-efi #$grub-efi) (reboot))))) #:system system #:make-disk-image? #t |