libc-rs/ci/test-runner-linux
Sébastien Santoro 97a81d7920 Use more convenient and UNIX-agnostic shebang
Pure sh scripts should use /bin/sh as it's available on every platform.

When using bash-specific features, use env to find it, as bash can
be installed in different places according the OS.
2017-11-13 13:42:00 +00:00

24 lines
373 B
Bash
Executable File

#!/bin/sh
set -e
arch=$1
prog=$2
cd /qemu/init
cp -f $2 prog
find . | cpio --create --format='newc' --quiet | gzip > ../initrd.gz
cd ..
timeout 30s qemu-system-$arch \
-m 1024 \
-nographic \
-kernel kernel \
-initrd initrd.gz \
-append init=/prog > output || true
# remove kernel messages
tr -d '\r' < output | egrep -v '^\['
grep PASSED output > /dev/null