Skip to content

Commit 913754c

Browse files
author
szy
committed
Merge remote-tracking branch 'upstream/next2' into next2
2 parents 6f9c08a + 7c95187 commit 913754c

File tree

10 files changed

+111
-87
lines changed

10 files changed

+111
-87
lines changed

.github/workflows/qemu-aarch64.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ args = [
55
"-machine",
66
"virt,virtualization=on,gic-version=3",
77
"-smp",
8-
"1",
8+
"4",
99
"-append",
1010
"root=/dev/vda rw init=/init",
1111
"-m",
1212
"8g",
1313
]
1414
fail_regex = []
15-
success_regex = []
15+
success_regex = ["Hello, world!"]
1616
to_bin = true
1717
uefi = false

.github/workflows/test-board.yml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@ jobs:
1414
- board: phytiumpi
1515
vmconfigs: configs/vms/arceos-aarch64-e2000-smp1.toml
1616
vmconfigs_name: ArceOS
17-
vmimage_name: phytiumpi_arceos.tar.gz
17+
vmimage_name: phytiumpi_arceos
1818
- board: phytiumpi
1919
vmconfigs: configs/vms/linux-aarch64-e2000-smp1.toml
2020
vmconfigs_name: Linux
21-
vmimage_name: phytiumpi_linux.tar.gz
21+
vmimage_name: phytiumpi_linux
2222
# - board: roc-rk3568-pc
2323
# vmconfigs: configs/vms/arceos-aarch64-rk3568-smp1.toml
2424
# vmconfigs_name: ArceOS
25-
# # Multiple image archive names separated by commas, for example, roc-rk3568-pc_arceos.tar.gz,roc-rk3568-pc_linux.tar.gz[,...]
26-
# vmimage_name: roc-rk3568-pc_arceos.tar.gz
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
2727
# - board: roc-rk3568-pc
2828
# vmconfigs: configs/vms/linux-aarch64-rk3568-smp1.toml
2929
# vmconfigs_name: Linux
30-
# # Multiple image archive names separated by commas, for example, roc-rk3568-pc_arceos.tar.gz,roc-rk3568-pc_linux.tar.gz[,...]
31-
# vmimage_name: roc-rk3568-pc_linux.tar.gz
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
3232
fail-fast: false
3333
runs-on:
3434
- self-hosted
@@ -45,20 +45,16 @@ jobs:
4545
- name: Download images and patch VM configs
4646
run: |
4747
echo "Downloading guest images and patching VM config files..."
48-
mkdir -p /tmp/images
4948
IFS=',' read -ra CONFIGS <<< "${{ matrix.vmconfigs }}"
5049
IFS=',' read -ra IMAGES <<< "${{ matrix.vmimage_name }}"
5150
for i in "${!CONFIGS[@]}"; do
5251
img="${IMAGES[$i]}"
5352
img=$(echo "$img" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
5453
config="${CONFIGS[$i]}"
5554
config=$(echo "$config" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
56-
img_name="${img%.tar.gz}"
57-
58-
echo "Downloading $img and patching $config..."
59-
wget -P /tmp/images https://github.com/arceos-hypervisor/axvisor-guest/releases/latest/download/$img
60-
tar -xzf /tmp/images/$img -C /tmp/images
61-
sed -i 's|^kernel_path[[:space:]]*=.*|kernel_path = "/tmp/images/'"$img_name"'"|' "$config"
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"
6258
echo "Updated kernel_path in $config"
6359
done
6460

.github/workflows/test-qemu.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ jobs:
4444
config="${CONFIGS[$i]}"
4545
config=$(echo "$config" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
4646
cargo xtask image download $img
47-
sed -i 's|^kernel_path[[:space:]]*=.*|kernel_path = "/tmp/axvisor/'"$img"'/'"$img"'"|' "$config"
47+
img_name="qemu-${{ matrix.arch }}"
48+
sed -i 's|^kernel_path[[:space:]]*=.*|kernel_path = "/tmp/axvisor/'"$img"'/'"$img_name"'"|' "$config"
4849
echo "Updated kernel_path in $config"
4950
done
5051

.github/workflows/uboot.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ fail_regex = [
77
]
88
serial = "${env:BOARD_COMM_UART_DEV}"
99
success_regex = [
10-
"Welcome to AxVisor Shell!",
11-
"All tests passed!",
10+
"Welcome to AxVisor Shell!",
11+
"All tests passed!",
1212
"Hello World!",
1313
"root@firefly:~#",
1414
"root@phytium-Ubuntu:~#",

scripts/ostool/qemu-aarch64.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ args = [
55
"-machine",
66
"virt,virtualization=on,gic-version=3",
77
"-smp",
8-
"1",
8+
"4",
99
"-device",
1010
"virtio-blk-device,drive=disk0",
1111
"-drive",

xtask/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ clap = { version = "4.4", features = ["derive"] }
1111
colored = "3"
1212
ostool = "0.8"
1313
jkconfig = "0.1"
14-
reqwest = "0.11"
14+
reqwest = "0.12"
1515
schemars = { version = "1", features = ["derive"] }
1616
serde = { version = "1.0", features = ["derive"] }
1717
serde_json = "1"

xtask/src/cargo.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ use ostool::run::cargo::CargoRunnerKind;
55
use crate::ctx::Context;
66

77
impl Context {
8-
pub async fn run_qemu(&mut self) -> anyhow::Result<()> {
8+
pub async fn run_qemu(&mut self, config_path: Option<PathBuf>) -> anyhow::Result<()> {
99
let build_config = self.load_config()?;
10+
1011
let arch = if build_config.target.contains("aarch64") {
1112
Arch::Aarch64
1213
} else if build_config.target.contains("x86_64") {
@@ -17,9 +18,14 @@ impl Context {
1718
build_config.target
1819
));
1920
};
21+
22+
let config_path = if let Some(path) = config_path {
23+
path
24+
} else {
25+
PathBuf::from(format!(".qemu-{arch:?}.toml").to_lowercase())
26+
};
2027

21-
let config_path = PathBuf::from(format!(".qemu-{arch:?}.toml").to_lowercase());
22-
28+
// 如果配置文件不存在,从默认位置复制
2329
if !config_path.exists() {
2430
fs::copy(
2531
PathBuf::from("scripts")

0 commit comments

Comments
 (0)