Skip to content

Commit 6f8a2ea

Browse files
authored
Merge pull request #311 from arceos-hypervisor/next2
refactor: replace arceos make with xtask, add gui configuration
2 parents 7134beb + ef9b629 commit 6f8a2ea

File tree

127 files changed

+8563
-7562
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+8563
-7562
lines changed

.cargo/config.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# [patch."https://github.com/arceos-hypervisor/axvm.git".axvm]
2+
# path = "crates/axvm"
3+
4+
[target.aarch64-unknown-none-softfloat]
5+
rustflags = [
6+
"-Clink-args=-no-pie",
7+
"-Clink-args=-znostart-stop-gc",
8+
"-Clink-args=-Tlink.x",
9+
]
10+
11+
[target.'cfg(target_os = "none")']
12+
runner = "cargo osrun"
13+
14+
[target.x86_64-unknown-none]
15+
rustflags = [
16+
"-Clink-args=-no-pie",
17+
"-Clink-args=-znostart-stop-gc",
18+
"-Clink-args=-Tlink.x",
19+
]
20+
21+
[alias]
22+
xtask = "run --package xtask --"

.github/workflows/REMOTE-CI.md

Lines changed: 0 additions & 49 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 0 additions & 69 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
args = [
2+
"-nographic",
3+
"-cpu",
4+
"cortex-a72",
5+
"-machine",
6+
"virt,virtualization=on,gic-version=3",
7+
"-smp",
8+
"4",
9+
"-device",
10+
"virtio-blk-device,drive=disk0",
11+
"-drive",
12+
"id=disk0,if=none,format=raw,file=${workspaceFolder}/tmp/rootfs.img",
13+
"-append",
14+
"root=/dev/vda rw init=/init",
15+
"-m",
16+
"8g",
17+
]
18+
fail_regex = []
19+
success_regex = ["Hello, world!"]
20+
to_bin = true
21+
uefi = false

.github/workflows/qemu-x86_64.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
args = [
2+
"-m",
3+
"128M",
4+
"-smp",
5+
"1",
6+
"-machine",
7+
"q35",
8+
"-device",
9+
"virtio-blk-pci,drive=disk0",
10+
"-drive",
11+
"id=disk0,if=none,format=raw,file=${workspaceFolder}/tmp/rootfs.img",
12+
"-nographic",
13+
"-accel",
14+
"kvm",
15+
"-cpu",
16+
"host",
17+
]
18+
fail_regex = ["System will reboot, press any key to continue ..."]
19+
success_regex = ["usertests passed!"]
20+
to_bin = false
21+
uefi = false

.github/workflows/test-board.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Test for BOARD
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
jobs:
6+
test-board:
7+
name: "Test board: ${{ matrix.board }} - ${{ matrix.vmconfigs_name }}"
8+
strategy:
9+
matrix:
10+
include:
11+
# - board: phytiumpi
12+
# vmconfigs: .github/workflows/vmconfigs/linux.toml,.github/workflows/vmconfigs/arceos.toml
13+
# vmconfigs_name: Linux + ArceOS
14+
- board: phytiumpi
15+
vmconfigs: configs/vms/arceos-aarch64-e2000-smp1.toml
16+
vmconfigs_name: ArceOS
17+
vmimage_name: phytiumpi_arceos
18+
- board: phytiumpi
19+
vmconfigs: configs/vms/linux-aarch64-e2000-smp1.toml
20+
vmconfigs_name: Linux
21+
vmimage_name: phytiumpi_linux
22+
- board: roc-rk3568-pc
23+
vmconfigs: configs/vms/arceos-aarch64-rk3568-smp1.toml
24+
vmconfigs_name: ArceOS
25+
# Multiple image archive names separated by commas, for example, roc-rk3568-pc_arceos,roc-rk3568-pc_linux[,...]
26+
vmimage_name: roc-rk3568-pc_arceos
27+
- board: roc-rk3568-pc
28+
vmconfigs: configs/vms/linux-aarch64-rk3568-smp1.toml
29+
vmconfigs_name: Linux
30+
# Multiple image archive names separated by commas, for example, roc-rk3568-pc_arceos,roc-rk3568-pc_linux[,...]
31+
vmimage_name: roc-rk3568-pc_linux
32+
fail-fast: false
33+
runs-on:
34+
- self-hosted
35+
- linux
36+
- ${{ matrix.board }}
37+
38+
steps:
39+
- name: Checkout
40+
uses: actions/checkout@v4
41+
42+
- name: Install dependencies
43+
run: cargo +stable install -f --git https://github.com/ZR233/ostool ostool
44+
45+
- name: Download images and patch VM configs
46+
run: |
47+
echo "Downloading guest images and patching VM config files..."
48+
IFS=',' read -ra CONFIGS <<< "${{ matrix.vmconfigs }}"
49+
IFS=',' read -ra IMAGES <<< "${{ matrix.vmimage_name }}"
50+
for i in "${!CONFIGS[@]}"; do
51+
img="${IMAGES[$i]}"
52+
img=$(echo "$img" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
53+
config="${CONFIGS[$i]}"
54+
config=$(echo "$config" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
55+
cargo xtask image download $img
56+
img_name="${{ matrix.board }}"
57+
sed -i 's|^kernel_path[[:space:]]*=.*|kernel_path = "/tmp/axvisor/'"$img"'/'"$img_name"'"|' "$config"
58+
echo "Updated kernel_path in $config"
59+
done
60+
61+
- name: Run tests
62+
run: |
63+
echo $BOARD_POWER_RESET
64+
export RUST_LOG=debug
65+
cargo xtask uboot \
66+
--build-config configs/board/${{ matrix.board }}.toml \
67+
--uboot-config .github/workflows/uboot.toml \
68+
--vmconfigs ${{ matrix.vmconfigs }}
69+
# cargo xtask uboot \
70+
# --build-config configs/board/${{ matrix.board }}.toml \
71+
# --uboot-config .github/workflows/uboot.toml

.github/workflows/test-qemu.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Test for QEMU
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
jobs:
6+
test-qemu:
7+
name: "Test qemu: ${{ matrix.arch }} - ${{ matrix.vmconfigs_name }}"
8+
strategy:
9+
matrix:
10+
include:
11+
- arch: aarch64
12+
vmconfigs: configs/vms/arceos-aarch64-qemu-smp1.toml
13+
vmconfigs_name: ArceOS
14+
vmimage_name: qemu_aarch64_arceos
15+
# - arch: riscv64
16+
# vmconfigs: configs/vms/arceos-riscv64-qemu-smp1.toml
17+
# vmconfigs_name: ArceOS
18+
# vmimage_name: qemu_arceos_riscv64
19+
- arch: x86_64
20+
vmconfigs: configs/vms/nimbos-x86_64-qemu-smp1.toml
21+
vmconfigs_name: NimbOS
22+
vmimage_name: qemu_x86_64_nimbos
23+
fail-fast: false
24+
runs-on:
25+
- self-hosted
26+
- linux
27+
- intel
28+
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v4
32+
33+
- name: Install dependencies
34+
run: cargo +stable install -f --git https://github.com/ZR233/ostool ostool
35+
36+
- name: Download images and patch vm configs
37+
run: |
38+
IFS=',' read -ra CONFIGS <<< "${{ matrix.vmconfigs }}"
39+
IFS=',' read -ra IMAGES <<< "${{ matrix.vmimage_name }}"
40+
for i in "${!CONFIGS[@]}"; do
41+
img="${IMAGES[$i]}"
42+
img=$(echo "$img" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
43+
config="${CONFIGS[$i]}"
44+
config=$(echo "$config" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
45+
cargo xtask image download $img
46+
img_name="qemu-${{ matrix.arch }}"
47+
image_location=$(sed -n 's/^image_location[[:space:]]*=[[:space:]]*"\([^"]*\)".*/\1/p' "$config")
48+
49+
case "$image_location" in
50+
"fs")
51+
echo "Filesystem storage mode - no config update needed"
52+
;;
53+
"memory")
54+
sed -i 's|^kernel_path[[:space:]]*=.*|kernel_path = "/tmp/axvisor/'"$img"'/'"$img_name"'"|' "$config"
55+
echo "Memory storage mode - updating kernel_path"
56+
;;
57+
*)
58+
echo "Unknown image_location: $image_location"
59+
exit 1
60+
;;
61+
esac
62+
63+
ROOTFS_IMG_PATH="/tmp/axvisor/$img/rootfs.img"
64+
65+
# Check if rootfs.img exists after extraction
66+
if [ -f "${ROOTFS_IMG_PATH}" ]; then
67+
echo "Found rootfs.img, patching qemu-aarch64.toml file..."
68+
sed -i 's|file=${workspaceFolder}/tmp/rootfs.img|file='"${ROOTFS_IMG_PATH}"'|' ".github/workflows/qemu-${{ matrix.arch }}.toml"
69+
echo "Rootfs setup completed"
70+
else
71+
echo "No rootfs.img found, removing rootfs device configuration from qemu-${{ matrix.arch }}.toml..."
72+
sed -i '/-device/,/virtio-blk-device,drive=disk0/d' ".github/workflows/qemu-${{ matrix.arch }}.toml"
73+
sed -i '/-drive/,/id=disk0,if=none,format=raw,file=${workspaceFolder}\/tmp\/rootfs.img/d' ".github/workflows/qemu-${{ matrix.arch }}.toml"
74+
sed -i 's/root=\/dev\/vda rw //' ".github/workflows/qemu-${{ matrix.arch }}.toml"
75+
echo "Rootfs device configuration removed"
76+
fi
77+
done
78+
79+
- name: Run tests
80+
run: |
81+
export RUST_LOG=debug
82+
cargo xtask qemu \
83+
--build-config configs/board/qemu-${{ matrix.arch }}.toml \
84+
--qemu-config .github/workflows/qemu-${{ matrix.arch }}.toml \
85+
--vmconfigs ${{ matrix.vmconfigs }}

0 commit comments

Comments
 (0)