Skip to content

Commit 736fdc1

Browse files
committed
ci: download rootfs
1 parent 0d75094 commit 736fdc1

File tree

2 files changed

+29
-3
lines changed

2 files changed

+29
-3
lines changed

.github/workflows/qemu-aarch64.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@ args = [
66
"virt,virtualization=on,gic-version=3",
77
"-smp",
88
"4",
9+
"-device",
10+
"virtio-blk-device,drive=disk0",
11+
"-drive",
12+
"id=disk0,if=none,format=raw,file=${workspaceFolder}/tmp/rootfs.img",
913
"-append",
1014
"root=/dev/vda rw init=/init",
1115
"-m",
1216
"8g",
1317
]
1418
fail_regex = []
15-
success_regex = ["Hello, world!"]
19+
success_regex = []
1620
to_bin = true
1721
uefi = false

.github/workflows/test-qemu.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
vmconfigs: configs/vms/arceos-aarch64-qemu-smp1.toml
1313
vmconfigs_name: ArceOS
1414
vmimage_name: qemu_arceos_aarch64
15+
vmrootfs_name: qemu_arceos_aarch64
1516
# - arch: riscv64
1617
# vmconfigs: configs/vms/arceos-riscv64-qemu-smp1.toml
1718
# vmconfigs_name: ArceOS
@@ -33,9 +34,8 @@ jobs:
3334
- name: Install dependencies
3435
run: cargo +stable install -f --git https://github.com/ZR233/ostool ostool
3536

36-
- name: Download images and patch VM configs
37+
- name: Download images and patch vm configs
3738
run: |
38-
echo "Downloading guest images and patching VM config files..."
3939
IFS=',' read -ra CONFIGS <<< "${{ matrix.vmconfigs }}"
4040
IFS=',' read -ra IMAGES <<< "${{ matrix.vmimage_name }}"
4141
for i in "${!CONFIGS[@]}"; do
@@ -49,6 +49,28 @@ jobs:
4949
echo "Updated kernel_path in $config"
5050
done
5151
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+
5274
- name: Run tests
5375
run: |
5476
export RUST_LOG=debug

0 commit comments

Comments
 (0)