#!/usr/bin/env bash

set -e

echo "quit" | socat stdio stdio

echo "Trying to run versatilePB board"

qemu-system-arm -M versatilepb -m 128M -nographic -kernel bare.bin \
    -monitor unix:vm.sock,server,nowait -serial file:output.txt &

sleep 2

# Send quit to the monitor application
echo "quit" | socat stdio UNIX-CONNECT:vm.sock

