Skip to content

Instantly share code, notes, and snippets.

@sameo
Last active October 23, 2018 18:10
Show Gist options
  • Save sameo/f9409091fc09c76858d20e0168dbc6f7 to your computer and use it in GitHub Desktop.
Save sameo/f9409091fc09c76858d20e0168dbc6f7 to your computer and use it in GitHub Desktop.
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
OPTS=`getopt -o b:e:f:i:k:m: --long binary:,exit:,firmware:,iterations:,kernel:,machine: -n 'parse-options' -- "$@"`
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi
eval set -- "$OPTS"
MACHINE="virt"
while true; do
case "$1" in
-b | --binary ) BINARY="$2"; shift 2;;
-e | --exit ) EXIT="$2"; shift 2;;
-f | --firmware ) FIRMWARE="$2"; shift 2;;
-i | --iterations ) ITERATIONS="$2"; shift 2;;
-k | --kernel ) KERNEL="$2"; shift 2;;
-m | --machine ) MACHINE="$2"; shift 2;;
-- ) shift; break ;;
* ) break ;;
esac
done
for i in `seq 1 $ITERATIONS`;
do
sudo $BINARY \
-bios $FIRMWARE \
-nographic \
-nodefaults \
-L . \
-net none \
-machine $MACHINE,accel=kvm,kernel_irqchip \
-smp sockets=1,cpus=4,cores=2,maxcpus=8 -cpu host \
-m 1G,slots=3,maxmem=4G \
-device sysbus-debugexit,iobase=$EXIT \
-kernel $KERNEL -append 'console=hvc0 iommu=false root=/dev/vda3 rw rootfstype=ext4 data=ordered rcupdate.rcu_expedited=1 tsc=reliable no_timer_check reboot=t noapictimer'
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment