-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstartvm
More file actions
executable file
·53 lines (47 loc) · 1.11 KB
/
startvm
File metadata and controls
executable file
·53 lines (47 loc) · 1.11 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
#!/bin/bash
# init ssh port
if [ -z $1 ];
then
SSH_PORT=10068
else
SSH_PORT=$1
fi
# init core number
if [ -z $2 ];
then
CORE_NUM=2
else
CORE_NUM=$2
fi
# init memory size
if [ -z $3 ];
then
MEM_SIZE=1G
else
MEM_SIZE=$3
fi
# resolve image path
list=($(pwd)/img/*.img)
IMAGE=${list[0]}
KERNEL=$(pwd)/kernel/arch/x86/boot/bzImage
#-enable-kvm \
#-cpu host,-smap,-smep \
#-append "console=ttyS0 root=/dev/sda debug earlyprintk=serial nokaslr smap smep selinux=0 pti" \
# -append "console=ttyS0 root=/dev/sda debug earlyprintk=serial oops=panic panic_on_warn=1 nokaslr nosmap nosmep selinux=0 nopti" \
#-gdb tcp::12345 \
#-enable-kvm \
#-cpu host,+smap,+smep \
qemu-system-x86_64 \
-snapshot \
-kernel $KERNEL \
-hda $IMAGE \
-smp cores=2,threads=2 \
-append "console=ttyS0 root=/dev/sda debug earlyprintk=serial oops=panic kaslr smap smep selinux=0 pti tsc=unstable net.ifnames=0 panic=1000 cgroup_disable=memory" \
-net nic -net user,hostfwd=tcp::${SSH_PORT}-:22 \
-nographic \
-m $MEM_SIZE \
-monitor none,server,nowait,nodelay,reconnect=-1 \
-enable-kvm \
-cpu host,+smap,+smep \
-s \
2>&1