diff options
author | Marius Bakke <mbakke@fastmail.com> | 2017-05-07 15:31:30 +0200 |
---|---|---|
committer | Marius Bakke <mbakke@fastmail.com> | 2017-05-19 12:59:25 +0200 |
commit | ecf5d5376979fadd971559367bf553df89fcc62b (patch) | |
tree | 285839edfdcb70e005c98aeecb93837a09d943df /gnu/system | |
parent | 4d415f0c3c0cf4acbc1297ccf2b27121846a4289 (diff) | |
download | patches-ecf5d5376979fadd971559367bf553df89fcc62b.tar patches-ecf5d5376979fadd971559367bf553df89fcc62b.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.
Diffstat (limited to 'gnu/system')
-rw-r--r-- | gnu/system/vm.scm | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index 64770baf1c..d282ba557a 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. ;;; @@ -228,13 +229,26 @@ the image." #:system-directory #$os-drv)) (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-efi #$grub-efi #:bootloader-package #$(bootloader-package bootloader) #:bootcfg #$bootcfg-drv |