1 kver = 3.19.0-0.rc4.57.sa2.aarch64
3 kernel = /boot/vmlinuz-$(kver)
4 moddir = /lib/modules/$(kver)
5 qemu = /usr/libexec/qemu-kvm
6 modules = virtio.ko virtio_ring.ko virtio_mmio.ko virtio_scsi.ko
7 disks = sda.img sdb.img sdc.img sdd.img sde.img sdf.img
9 all: initrd $(disks) AAVMF_VARS.fd
12 AAVMF_VARS.fd: /usr/share/AAVMF/AAVMF_VARS.fd
15 -drive if=pflash,format=raw,file=/usr/share/AAVMF/AAVMF_CODE.fd,readonly \
16 -drive if=pflash,format=raw,file=AAVMF_VARS.fd
22 initrd: dev init $(modules)
23 ls -1d $^ | cpio -o -H newc | gzip -9 > $@
30 find $(moddir) -name $@ -exec cp {} . \;
33 gcc -Wall -Werror -static $< -o $@
37 truncate -s $$(( RANDOM % 3 + 1 ))G $@
38 echo '2048,,L' | sfdisk --force $@
41 rm -f *~ $(disks) $(modules) init initrd AAVMF_VARS.fd
43 run: initrd $(disks) AAVMF_VARS.fd
45 -nodefconfig -nodefaults -display none \
46 -machine virt,accel=kvm \
51 -kernel $(kernel) -initrd initrd \
52 -append 'panic=1 earlyprintk=pl011,0x9000000 ignore_loglevel console=ttyAMA0 no_timer_check printk.time=1' \
54 -device virtio-scsi-device,id=scsi \
55 -drive file=sda.img,cache=writeback,format=raw,if=none,id=sda \
56 -device scsi-hd,drive=sda \
57 -drive file=sdb.img,cache=writeback,format=raw,if=none,id=sdb \
58 -device scsi-hd,drive=sdb \
59 -drive file=sdc.img,cache=writeback,format=raw,if=none,id=sdc \
60 -device scsi-hd,drive=sdc \
61 -drive file=sdd.img,cache=writeback,format=raw,if=none,id=sdd \
62 -device scsi-hd,drive=sdd \
63 -drive file=sde.img,cache=writeback,format=raw,if=none,id=sde \
64 -device scsi-hd,drive=sde \
65 -drive file=sdf.img,cache=writeback,format=raw,if=none,id=sdf \
66 -device scsi-hd,drive=sdf