Skip to content

Commit 224cecf

Browse files
committed
fix: 更新 ostool 版本至 0.8.3,并在 UbootConfig 中添加 uboot_cmd 字段以支持自定义命令
1 parent 34f2db3 commit 224cecf

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ostool/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0"
77
name = "ostool"
88
readme = "../README.md"
99
repository = "https://github.com/ZR233/ostool"
10-
version = "0.8.2"
10+
version = "0.8.3"
1111

1212
[[bin]]
1313
name = "ostool"

ostool/src/run/uboot.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ pub struct UbootConfig {
4949
pub board_power_off_cmd: Option<String>,
5050
pub success_regex: Vec<String>,
5151
pub fail_regex: Vec<String>,
52+
pub uboot_cmd: Option<Vec<String>>,
5253
}
5354

5455
impl UbootConfig {
@@ -327,6 +328,13 @@ impl Runner {
327328
let mut uboot = handle.join().unwrap()?;
328329
uboot.set_env("autoload", "yes")?;
329330

331+
if let Some(ref cmds) = self.config.uboot_cmd {
332+
for cmd in cmds.iter() {
333+
info!("Running U-Boot command: {}", cmd);
334+
uboot.cmd(cmd)?;
335+
}
336+
}
337+
330338
if let Some(ref net) = self.config.net {
331339
if let Some(ref gatewayip) = net.gatewayip {
332340
uboot.set_env("gatewayip", gatewayip)?;

0 commit comments

Comments
 (0)