]>
Commit | Line | Data |
---|---|---|
970d3b09 JB |
1 | #!/bin/bash |
2 | ||
3 | cd "$(dirname $0)" | |
4 | ||
5 | if [ -z "$TESTDIR" ] ; then | |
6 | TESTDIR=$(pwd)/../ | |
7 | fi | |
8 | ||
9 | LOGS=/tmp/hwsim-test-logs/ | |
10 | ||
11 | # increase the memory size if you want to run with valgrind, 512 MB works | |
12 | MEMORY=128 | |
13 | ||
14 | # Some ubuntu systems (notably 12.04) have issues with this - since the guest | |
15 | # mounts as read-only it should be safe to not specify ,readonly. Override in | |
16 | # vm-config if needed (see below) | |
17 | ROTAG=,readonly | |
18 | ||
19 | # set this to ttyS0 to see kvm messages (if something doesn't work) | |
20 | KVMOUT=ttyS1 | |
21 | ||
22 | # you can set EPATH if you need anything extra in $PATH inside the VM | |
23 | #EPATH=/some/dir | |
24 | ||
25 | test -f vm-config && . vm-config | |
26 | ||
27 | if [ -z "$KERNELDIR" ] ; then | |
28 | echo "You need to set a KERNELDIR (in the environment or vm-config)" | |
29 | exit 2 | |
30 | fi | |
31 | KERNEL=$KERNELDIR/arch/x86_64/boot/bzImage | |
32 | ||
33 | ||
34 | CMD=$TESTDIR/vm/inside.sh | |
35 | LOGDIR=$LOGS/$(date +%s) | |
36 | mkdir -p $LOGDIR | |
37 | ||
38 | exec kvm \ | |
39 | -kernel $KERNEL -smp 4 \ | |
40 | -s -m $MEMORY -nographic \ | |
41 | -fsdev local,security_model=none,id=fsdev-root,path=/$ROTAG \ | |
42 | -device virtio-9p-pci,id=fs-root,fsdev=fsdev-root,mount_tag=/dev/root \ | |
43 | -fsdev local,security_model=none,id=fsdev-logs,path="$LOGDIR",writeout=immediate \ | |
44 | -device virtio-9p-pci,id=fs-logs,fsdev=fsdev-logs,mount_tag=logshare \ | |
45 | -monitor null -serial stdio -serial file:$LOGDIR/console \ | |
46 | -append "mac80211_hwsim.radios=5 init=$CMD testdir=$TESTDIR console=$KVMOUT root=/dev/root rootflags=trans=virtio,version=9p2000.u ro rootfstype=9p EPATH=$EPATH ARGS=$*" |