forked from drepper/min-initrd
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
executable file
·82 lines (61 loc) · 2.77 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
PACKAGES = bash coreutils iputils net-tools strace util-linux iproute pciutils ethtool kmod strace perf python vim
SMD = supermin.d
SMP = 2
TS = 8-9
QUEUES = 4
VECTORS = 10
QEMU = taskset -c $(TS) qemu-system-x86_64 -cpu host
options = -enable-kvm -smp cpus=$(SMP) -m 12G -s
DEBUG = -S
KERNELU = -kernel ../linux/arch/x86/boot/bzImage
SMOptions = -initrd min-initrd.d/initrd -hda min-initrd.d/root
DISPLAY = -nodefaults -nographic -serial stdio
MONITOR = -nodefaults -nographic -serial mon:stdio
COMMANDLINE = -append "console=ttyS0 root=/dev/sda net.ifnames=0 biosdevname=0 nowatchdog nosmap mds=off ip=192.168.19.136:::255.255.255.0::eth0:none -- -g 20 -n 5 "
NETWORK = -netdev tap,id=vlan1,ifname=tap0,script=no,downscript=no,vhost=on,queues=$(QUEUES) -device virtio-net-pci,mq=on,vectors=$(VECTORS),netdev=vlan1,mac=02:00:00:04:00:29
#-----------------------------------------------
SMP2 = 4
TS2 = 12-15
QUEUES2 = 4
VECTORS2 = 10
QEMU2 = taskset -c $(TS2) qemu-system-x86_64 -cpu host
options2 = -enable-kvm -smp cpus=$(SMP2) -m 30G
DEBUG2 = -S -s
KERNELU2 = -kernel ../linux/arch/x86/boot/bzImage
SMOptions2 = -initrd min-initrd.d/initrd -hda min-initrd.d/root2
DISPLAY2 = -nodefaults -nographic -serial stdio
MONITOR2 = -nodefaults -nographic -serial mon:stdio
COMMANDLINE2 = -append "console=ttyS0 root=/dev/sda net.ifnames=0 biosdevname=0 nosmap mds=off ip=192.168.19.137:::255.255.255.0::eth0:none -- -m /workloads/iperf.xml -a"
NETWORK2 = -netdev tap,id=vlan1,ifname=tap2,script=no,downscript=no,vhost=on,queues=$(QUEUES2) -device virtio-net-pci,mq=on,vectors=$(VECTORS2),netdev=vlan1,mac=02:00:00:04:00:30
#-----------------------------------------------
TARGET = min-initrd.d
.PHONY: all supermin build-package clean
all: clean $(TARGET)/root
clean:
clear
supermin:
@if [ ! -a $(SMD)/packages -o '$(PACKAGES) ' != "$$(tr '\n' ' ' < $(SMD)/packages)" ]; then \
$(MAKE) --no-print-directory build-package; \
else \
touch $(SMD)/packages; \
fi
build-package:
supermin --prepare $(PACKAGES) -o $(SMD)
supermin.d/packages: supermin
supermin.d/init.tar.gz: init
tar zcf $@ $^
$(TARGET)/root: supermin.d/packages supermin.d/init.tar.gz
supermin --build -v -v -v --size 8G --if-newer --format ext2 supermin.d -o ${@D}
- rm -rf $(TARGET)/root2
cp $(TARGET)/root $(TARGET)/root2
exportmods:
export SUPERMIN_KERNEL=/mnt/normal/linux/arch/x86/boot/bzImage
export SUPERMIN_MODULES=/mnt/normal/min-initrd/kmods/lib/modules/5.7.0+/
runU:
$(QEMU) $(options) $(KERNELU) $(SMOptions) $(DISPLAY) $(COMMANDLINE) $(NETWORK)
debugU:
$(QEMU) $(options) $(DEBUG) $(KERNELU) $(SMOptions) $(DISPLAY) $(COMMANDLINE) $(NETWORK)
monU:
$(QEMU) $(options) $(KERNELU) $(SMOptions) $(MONITOR) $(COMMANDLINE) $(NETWORK)
runU2:
$(QEMU2) $(options2) $(KERNELU2) $(SMOptions2) $(DISPLAY2) $(COMMANDLINE2) $(NETWORK2)