-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
101 lines (86 loc) · 3.6 KB
/
Makefile
File metadata and controls
101 lines (86 loc) · 3.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
define EXTRA_ARG
-device virtio-net,netdev=net0 -netdev user,id=net0,net=192.168.1.0/24,hostfwd=tcp::8080-:80 \
-device virtio-net,netdev=net1 -netdev user,id=net1,net=100.0.0.0/24
endef
initramfs:
qemu-system-aarch64 -m 1024 -smp 2 -cpu cortex-a57 -M virt -nographic \
-kernel $(shell find openwrt-*-initramfs-kernel.bin) \
-drive if=none,file=$(shell find openwrt-*-squashfs-rootfs.img),id=hd0 \
-device virtio-blk-device,drive=hd0 \
$(EXTRA_ARG)
recovery:
qemu-system-aarch64 -m 1024 -smp 2 -cpu cortex-a57 -M virt -nographic \
-kernel $(shell find openwrt-*-initramfs-kernel.bin) \
$(EXTRA_ARG)
squashfs:
qemu-system-aarch64 -m 1024 -smp 2 -cpu cortex-a57 -M virt -nographic \
-kernel $(shell find openwrt-*-generic-kernel.bin) \
-append "root=fe00" \
-drive if=none,file=$(shell find openwrt-*-squashfs-rootfs.img),id=hd0 \
-device virtio-blk-device,drive=hd0 \
$(EXTRA_ARG)
ext4:
qemu-system-aarch64 -m 1024 -smp 2 -cpu cortex-a57 -M virt -nographic \
-kernel $(shell find openwrt-*-generic-kernel.bin) \
-append "root=fe00" \
-drive if=none,file=$(shell find openwrt-*-ext4-rootfs.img),id=hd0 \
-device virtio-blk-device,drive=hd0 \
$(EXTRA_ARG)
uboot:
qemu-system-aarch64 -m 1024 -smp 2 -cpu cortex-a57 -M virt -nographic \
-bios u-boot.bin \
-kernel $(shell find openwrt-*-generic-kernel.bin) \
-append "root=fe00" \
-drive if=none,file=$(shell find openwrt-*-squashfs-rootfs.img),id=hd0 \
-device virtio-blk-device,drive=hd0 \
$(EXTRA_ARG)
efi:
qemu-system-aarch64 -m 1024 -smp 2 -cpu cortex-a57 -M virt -nographic \
-drive if=pflash,format=raw,readonly=on,file=QEMU_EFI_64M.fd \
-drive if=pflash,format=raw,file=varstore.img \
-drive if=none,file=$(shell find openwrt-*-squashfs-combined-efi.img),id=hd0 \
-device virtio-blk-device,drive=hd0 \
$(EXTRA_ARG)
# press ESC or F2 to enter bios
edk2:
qemu-system-aarch64 -m 1024 -smp 2 -cpu cortex-a57 -M virt -nographic \
-drive if=pflash,format=raw,readonly=on,file=QEMU_EFI_64M.fd \
-drive if=pflash,format=raw,file=varstore.img \
-boot menu=on,splash-time=30000
uefi-shell:
qemu-system-aarch64 -m 1024 -smp 2 -cpu cortex-a57 -M virt -nographic \
-drive if=pflash,format=raw,readonly=on,file=QEMU_EFI_64M.fd \
-drive if=pflash,format=raw,file=varstore.img \
-drive file=fat:rw:edk2
uboot-env:
qemu-system-aarch64 -m 1024 -smp 2 -cpu cortex-a57 -M virt -nographic \
-bios u-boot.bin \
-device loader,file=u-boot/boot.scr,addr=0x40200000 \
-drive file=fat:rw:u-boot \
-drive if=none,file=$(shell find openwrt-*-squashfs-rootfs.img),id=hd0 \
-device virtio-blk-device,drive=hd0 \
$(EXTRA_ARG)
uboot-efi:
qemu-system-aarch64 -m 1024 -smp 2 -cpu cortex-a57 -M virt -nographic \
-bios u-boot.bin \
-drive if=none,file=$(shell find openwrt-*-squashfs-combined-efi.img),id=hd0 \
-device virtio-blk-device,drive=hd0 \
$(EXTRA_ARG)
tftp:
qemu-system-aarch64 -m 4096 -smp 2 -cpu cortex-a57 -M virt -nographic \
-bios u-boot.bin \
-device virtio-net,netdev=net0 -netdev user,id=net0,tftp=./,net=192.168.1.0/24,hostfwd=tcp::8080-:80 \
-device virtio-net,netdev=net1 -netdev user,id=net1,net=100.0.0.0/24
tftp-env:
qemu-system-aarch64 -m 4096 -smp 2 -cpu cortex-a57 -M virt -nographic \
-bios u-boot.bin \
-device loader,file=u-boot/boot.scr,addr=0x40200000 \
-drive file=fat:rw:u-boot \
-device virtio-net,netdev=net0 -netdev user,id=net0,tftp=./,net=192.168.1.0/24,hostfwd=tcp::8080-:80 \
-device virtio-net,netdev=net1 -netdev user,id=net1,net=100.0.0.0/24
parted-list:
parted $(ARGS) unit MiB print
boot.scr:
mkimage -A arm64 -O linux -T script -C none \
-d u-boot/boot.txt u-boot/boot.scr