diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index 06a363a..516c4ba 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -46,3 +46,23 @@ jobs: USERNAME: ubuntu PASS: password ARCH: arm64 + + ubuntu-latest-arm64: + name: ubuntu-latest-arm64 + runs-on: ubuntu-latest + steps: + - name: Check out code using action/checkout + uses: actions/checkout@v4.1.1 + - name: Install a couple of packages via the apt package manager + run: sudo apt update && sudo apt install -y qemu-system-misc u-boot-qemu cloud-image-utils + - name: Generate an ssh key-pair for this test + run: ssh-keygen -t rsa -q -f "$HOME/.ssh/id_rsa" -N "" + - name: Run a riscv64 qemu-based ./gen-vm smoke-test + run: ./gen-vm + working-directory: qemu + env: + VM_NAME: qemu-minimal-smoke-test-arm64 + KVM: none + USERNAME: ubuntu + PASS: password + ARCH: riscv64 diff --git a/qemu/gen-vm b/qemu/gen-vm index 006257e..6ae430a 100755 --- a/qemu/gen-vm +++ b/qemu/gen-vm @@ -135,6 +135,9 @@ if [ ${ARCH} == "amd64" ]; then elif [ ${ARCH} == "arm64" ]; then QARCH="aarch64" QARCH_ARGS="-machine virt,gic-version=max${KVM} -cpu max -bios /usr/share/qemu-efi-aarch64/QEMU_EFI.fd" +elif [ ${ARCH} == "riscv64" ]; then + QARCH="riscv64" + QARCH_ARGS="-machine virt,${KVM} -kernel /usr/lib/u-boot/qemu-riscv64_smode/uboot.elf" else echo "Error: No ARCH mapping exists for ${ARCH}! Exiting."; exit -1 fi @@ -146,7 +149,8 @@ qemu-system-${QARCH} \ -nographic \ -drive if=virtio,format=qcow2,file=${IMAGES}/${VM_NAME}-backing.qcow2 \ -drive if=virtio,format=qcow2,file=${IMAGES}/${VM_NAME}-seed.qcow2 \ - -nic user,id=user0,model=virtio-net-pci + -netdev user,id=net0 \ + -device virtio-net-pci,netdev=net0 qemu-img create -F qcow2 -b ${IMAGES}/${VM_NAME}-backing.qcow2 -f qcow2 \ ${IMAGES}/${VM_NAME}.qcow2 diff --git a/qemu/run-vm b/qemu/run-vm index 7634fde..fb55afa 100755 --- a/qemu/run-vm +++ b/qemu/run-vm @@ -40,6 +40,9 @@ if [ ${ARCH} == "amd64" ]; then elif [ ${ARCH} == "arm64" ]; then QARCH="aarch64" QARCH_ARGS="-machine virt,gic-version=max${KVM} -cpu max -bios /usr/share/qemu-efi-aarch64/QEMU_EFI.fd" +elif [ ${ARCH} == "riscv64" ]; then + QARCH="riscv64" + QARCH_ARGS="-machine virt,${KVM} -kernel /usr/lib/u-boot/qemu-riscv64_smode/uboot.elf" else echo "Error: No ARCH mapping exists for ${ARCH}! Exiting."; exit -1 fi @@ -51,4 +54,5 @@ qemu-system-${QARCH} \ ${FILESYSTEM_ARGS} \ -nographic \ -drive if=virtio,format=qcow2,file=${IMAGES}/${VM_NAME}.qcow2 \ - -nic user,id=user0,model=virtio-net-pci,hostfwd=tcp::${SSH_PORT}-:22 + -netdev user,id=net0,hostfwd=tcp::${SSH_PORT}-:22 \ + -device virtio-net-pci,netdev=net0