mirror of
https://git.proxmox.com/git/rustc
synced 2025-08-24 12:51:31 +00:00
25 lines
454 B
Bash
Executable File
25 lines
454 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 '^\['
|
|
|
|
# if the output contains a failure, return error
|
|
! grep FAILED output > /dev/null
|