1 # NB! Always use 'make clean' after changing these.
2 kver = 3.19.0-0.rc4.57.sa2.aarch64
4 kernel = /boot/vmlinuz-$(kver)
5 moddir = /lib/modules/$(kver)
6 qemu = /usr/libexec/qemu-kvm
7 modules = virtio.ko virtio_ring.ko virtio_mmio.ko virtio_scsi.ko
8 disks = sda.img sdb.img sdc.img sdd.img sde.img sdf.img
10 all: initrd $(disks) AAVMF_VARS.fd
13 AAVMF_VARS.fd: /usr/share/AAVMF/AAVMF_VARS.fd
16 -drive if=pflash,format=raw,file=/usr/share/AAVMF/AAVMF_CODE.fd,readonly \
17 -drive if=pflash,format=raw,file=AAVMF_VARS.fd
25 initrd: dev init $(modules)
26 ls -1d $^ | cpio -o -H newc | gzip -9 > $@
33 find $(moddir) -name $@ -exec cp {} . \;
36 gcc -Wall -Werror -static $< -o $@
40 truncate -s $$(( RANDOM % 3 + 1 ))G $@
41 echo '2048,,L' | sfdisk --force $@
44 rm -f *~ $(disks) $(modules) init initrd AAVMF_VARS.fd
46 # Run qemu -kernel -initrd.
48 run: initrd $(disks) AAVMF_VARS.fd
50 -nodefconfig -nodefaults -display none \
51 -machine virt,accel=kvm \
56 -kernel $(kernel) -initrd initrd \
57 -append 'panic=1 earlyprintk=pl011,0x9000000 ignore_loglevel console=ttyAMA0 no_timer_check printk.time=1' \
59 -device virtio-scsi-device,id=scsi \
60 -drive file=sda.img,cache=writeback,format=raw,if=none,id=sda \
61 -device scsi-hd,drive=sda \
62 -drive file=sdb.img,cache=writeback,format=raw,if=none,id=sdb \
63 -device scsi-hd,drive=sdb \
64 -drive file=sdc.img,cache=writeback,format=raw,if=none,id=sdc \
65 -device scsi-hd,drive=sdc \
66 -drive file=sdd.img,cache=writeback,format=raw,if=none,id=sdd \
67 -device scsi-hd,drive=sdd \
68 -drive file=sde.img,cache=writeback,format=raw,if=none,id=sde \
69 -device scsi-hd,drive=sde \
70 -drive file=sdf.img,cache=writeback,format=raw,if=none,id=sdf \
71 -device scsi-hd,drive=sdf