Andrew Geissler | 0205e8d | 2016-08-10 07:46:19 -0500 | [diff] [blame^] | 1 | #!/bin/bash -xe |
| 2 | # |
| 3 | # Launch QEMU using the raw commands |
| 4 | # |
| 5 | # Parameters: |
| 6 | # parm1: <optional, QEMU architecture to use > |
| 7 | # default is ${QEMU_ARCH} - ppc64le-linux or x86_64-linux |
| 8 | # parm2: <optional, full path to base directory of qemu binary and images > |
| 9 | # default is ${HOME} |
| 10 | |
| 11 | set -uo pipefail |
| 12 | |
| 13 | QEMU_ARCH=${1:-$QEMU_ARCH} |
| 14 | echo "QEMU_ARCH = $QEMU_ARCH" |
| 15 | if [[ -z $QEMU_ARCH ]]; then |
| 16 | echo "Did not pass in required QEMU arch parameter" |
| 17 | exit -1 |
| 18 | fi |
| 19 | |
| 20 | BASE_DIR=${2:-$HOME} |
| 21 | echo "BASE_DIR = $BASE_DIR" |
| 22 | if [[ ! -d $BASE_DIR ]]; then |
| 23 | echo "No input directory and HOME not set!" |
| 24 | exit -1 |
| 25 | fi |
| 26 | |
| 27 | cd ${BASE_DIR} |
| 28 | |
| 29 | ./tmp/sysroots/${QEMU_ARCH}/usr/bin/qemu-system-arm \ |
| 30 | -nographic \ |
| 31 | -kernel ./tmp/deploy/images/qemuarm/zImage-qemuarm.bin \ |
| 32 | -machine versatilepb \ |
| 33 | -drive file=./tmp/deploy/images/qemuarm/obmc-phosphor-image-qemuarm.ext4,format=raw \ |
| 34 | -no-reboot \ |
| 35 | -show-cursor \ |
| 36 | -usb \ |
| 37 | -usbdevice wacom-tablet \ |
| 38 | -no-reboot -m 128 \ |
| 39 | -redir tcp:22::22 \ |
| 40 | -redir tcp:443::443 \ |
| 41 | --append \ |
| 42 | "root=/dev/sda rw console=ttyAMA0,115200 console=tty mem=128M highres=off \ |
| 43 | rootfstype=ext4 console=ttyS0" |