diff --git a/.ci/boot-linux.sh b/.ci/boot-linux.sh index df619ad0..7ddb17b1 100755 --- a/.ci/boot-linux.sh +++ b/.ci/boot-linux.sh @@ -16,12 +16,37 @@ function ASSERT { cleanup +ENABLE_VBLK=1 +type dd >/dev/null 2>&1 || ENABLE_VBLK=0 +(type mkfs.ext4 >/dev/null 2>&1 || type $(brew --prefix e2fsprogs)/sbin/mkfs.ext4) >/dev/null 2>&1 || ENABLE_VBLK=0 +type 7z >/dev/null 2>&1 || ENABLE_VBLK=0 + TIMEOUT=50 OPTS=" -k build/linux-image/Image " OPTS+=" -i build/linux-image/rootfs.cpio " OPTS+=" -b build/minimal.dtb " +if [ "$ENABLE_VBLK" -eq "1" ]; then + dd if=/dev/zero of=build/disk.img bs=4M count=32 + mkfs.ext4 build/disk.img || $(brew --prefix e2fsprogs)/sbin/mkfs.ext4 build/disk.img + OPTS+=" -x vblk:build/disk.img " +else + printf "Virtio-blk Test...Passed\n" +fi RUN_LINUX="build/rv32emu ${OPTS}" +if [ "$ENABLE_VBLK" -eq "1" ]; then +ASSERT expect < mnt/emu.txt\n" } timeout { exit 3 } +expect "# " { send "sync\n" } timeout { exit 3 } +expect "# " { send "umount mnt\n" } timeout { exit 3 } +expect "# " { send "\x01"; send "x" } timeout { exit 3 } +DONE +else ASSERT expect <> $GITHUB_PATH wget https://apt.llvm.org/llvm.sh