-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
56 lines (46 loc) · 1.49 KB
/
Makefile
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
JOBS = 8
.PHONY: linux buildroot vm gdb-debug vm-debug clean
ifndef SERIAL_TTY
$(warning SERIAL_TTY is not set)
endif
linux:
cp config-kernel workflow/linux/.config
make -C workflow/linux -j$(JOBS)
release:
sh release.sh
buildroot:
cp config-buildroot workflow/buildroot/.config
make -C workflow/buildroot -j$(JOBS) CC=gcc
vm-tty:
qemu-system-x86_64 \
-kernel workflow/linux/arch/x86/boot/bzImage \
-boot c \
-m 512M \
-drive file=workflow/buildroot/output/images/rootfs.ext4,format=raw,index=0,media=disk \
-append "root=/dev/sda rw console=ttyS0,115200 acpi=noirq nokaslr noexec=off noexec32=off nosmep nosmap" \
-serial ${SERIAL_TTY} \
-no-reboot \
-display none \
-enable-kvm \
-virtfs local,path=$(shell pwd),mount_tag=host0,security_model=mapped,id=host0
gdb-debug:
gdb workflow/linux/vmlinux --command=gdb/gdbcmd
vm-debug:
qemu-system-x86_64 \
-kernel workflow/linux/arch/x86/boot/bzImage \
-boot c \
-m 2049M \
-drive file=workflow/buildroot/output/images/rootfs.ext4,format=raw,index=0,media=disk \
-append "root=/dev/sda rw console=ttyS0,115200 acpi=off nokaslr noexec=off noexec32=off nosmep nosmap" \
-serial stdio \
-display none \
-enable-kvm \
-virtfs local,path=$(shell pwd),mount_tag=host0,security_model=mapped,id=host0 \
-net nic,model=virtio \
-net user,hostfwd=tcp::10022-:22,hostfwd=tcp::23456-:23456 \
-s
# nokaslr -> disables address randomization CONFIG_RANDOMIZE_BASE
# noexec=off -> disables NX execute protection
clean:
make -C workflow/linux clean
make -C workflow/buildroot clean