From 12086c3a52c38b5cd9cbd48422ac04b35314ec6c Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 30 Jan 2015 13:23:12 +0000 Subject: [PATCH] Allow EFI to be selected for the guest. --- .gitignore | 1 + Makefile | 21 +++++++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 4348522..e5b651c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ *~ *.ko +/AAVMF_VARS.fd /dev /init /initrd diff --git a/Makefile b/Makefile index 483ffd3..81ab185 100644 --- 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 \ -- 1.8.3.1