Allow EFI to be selected for the guest.
authorRichard W.M. Jones <rjones@redhat.com>
Fri, 30 Jan 2015 13:23:12 +0000 (13:23 +0000)
committerRichard W.M. Jones <rjones@redhat.com>
Fri, 30 Jan 2015 13:23:12 +0000 (13:23 +0000)
.gitignore
Makefile

index 4348522..e5b651c 100644 (file)
@@ -1,6 +1,7 @@
 *~
 *.ko
 
+/AAVMF_VARS.fd
 /dev
 /init
 /initrd
index 483ffd3..81ab185 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,20 @@
-kver    = 3.19.0-0.rc5.git2.1.fc22.aarch64
+kver    = 3.19.0-0.rc4.57.sa2.aarch64
+use_efi = 1
 modules = virtio.ko virtio_ring.ko virtio_mmio.ko virtio_scsi.ko
 disks   = sda.img sdb.img sdc.img sdd.img sde.img sdf.img
 
-all:   initrd $(disks)
+all:   initrd $(disks) AAVMF_VARS.fd
+
+ifeq ($(use_efi),1)
+AAVMF_VARS.fd: /usr/share/AAVMF/AAVMF_VARS.fd
+       cp $< $@
+efi_params = \
+       -drive if=pflash,format=raw,file=/usr/share/AAVMF/AAVMF_CODE.fd,readonly \
+       -drive if=pflash,format=raw,file=AAVMF_VARS.fd
+else
+AAVMF_VARS.fd:
+       touch $@
+endif
 
 initrd:        dev init $(modules)
        ls -1d $^ | cpio -o -H newc | gzip -9 > $@
@@ -23,18 +35,19 @@ init:       init.c
        echo '2048,,L' | sfdisk --force $@
 
 clean:
-       rm -f $(disks) $(modules) init initrd
+       rm -f $(disks) $(modules) init initrd AAVMF_VARS.fd
 
 kernel  = /boot/vmlinuz-$(kver)
 qemu    = qemu-system-aarch64
 
-run:   initrd $(disks)
+run:   initrd $(disks) AAVMF_VARS.fd
        $(qemu) \
          -nodefconfig -nodefaults -display none \
          -machine virt,accel=kvm \
          -no-reboot \
          -cpu host \
          -m 1024 \
+         $(efi_params) \
          -kernel $(kernel) -initrd initrd \
          -append 'panic=1 earlyprintk=pl011,0x9000000 ignore_loglevel console=ttyAMA0 no_timer_check printk.time=1' \
          -serial stdio \