|
12 | 12 | vmconfigs: configs/vms/arceos-aarch64-qemu-smp1.toml |
13 | 13 | vmconfigs_name: ArceOS |
14 | 14 | vmimage_name: qemu_arceos_aarch64 |
| 15 | + vmrootfs_name: qemu_arceos_aarch64 |
15 | 16 | # - arch: riscv64 |
16 | 17 | # vmconfigs: configs/vms/arceos-riscv64-qemu-smp1.toml |
17 | 18 | # vmconfigs_name: ArceOS |
|
33 | 34 | - name: Install dependencies |
34 | 35 | run: cargo +stable install -f --git https://github.com/ZR233/ostool ostool |
35 | 36 |
|
36 | | - - name: Download images and patch VM configs |
| 37 | + - name: Download images and patch vm configs |
37 | 38 | run: | |
38 | | - echo "Downloading guest images and patching VM config files..." |
39 | 39 | IFS=',' read -ra CONFIGS <<< "${{ matrix.vmconfigs }}" |
40 | 40 | IFS=',' read -ra IMAGES <<< "${{ matrix.vmimage_name }}" |
41 | 41 | for i in "${!CONFIGS[@]}"; do |
|
49 | 49 | echo "Updated kernel_path in $config" |
50 | 50 | done |
51 | 51 |
|
| 52 | + - name: Download rootfs |
| 53 | + run: | |
| 54 | + if [ -n "${{ matrix.vmrootfs_name }}" ]; then |
| 55 | + ROOTFS_URL="https://github.com/arceos-hypervisor/axvisor-guest/releases/download/v0.0.19/${{ matrix.vmrootfs_name }}.tar.gz" |
| 56 | + ROOTFS_DIR="/tmp/axvisor/rootfs/${{ matrix.vmrootfs_name }}" |
| 57 | + ROOTFS_IMG_PATH="${ROOTFS_DIR}/rootfs.img" |
| 58 | + mkdir -p "${ROOTFS_DIR}" |
| 59 | + |
| 60 | + echo "Downloading rootfs from ${ROOTFS_URL}" |
| 61 | + curl -L "${ROOTFS_URL}" -o "${ROOTFS_DIR}/${{ matrix.vmrootfs_name }}.tar.gz" |
| 62 | + |
| 63 | + echo "Extracting rootfs to ${ROOTFS_DIR}" |
| 64 | + tar -xzf "${ROOTFS_DIR}/${{ matrix.vmrootfs_name }}.tar.gz" -C "${ROOTFS_DIR}" |
| 65 | + |
| 66 | + echo "Patching qemu-aarch64.toml file..." |
| 67 | + sed -i 's|file=${workspaceFolder}/tmp/rootfs.img|file='"${ROOTFS_IMG_PATH}"'|' ".github/workflows/qemu-${{ matrix.arch }}.toml" |
| 68 | + |
| 69 | + echo "Rootfs setup completed" |
| 70 | + else |
| 71 | + echo "No vmrootfs_name specified, skipping rootfs download" |
| 72 | + fi |
| 73 | +
|
52 | 74 | - name: Run tests |
53 | 75 | run: | |
54 | 76 | export RUST_LOG=debug |
|
0 commit comments