Skip to content

Commit ddd0c85

Browse files
committed
fix: add sh -c "reboot -f" for systems like busybox
1 parent 24cf2c2 commit ddd0c85

4 files changed

Lines changed: 16 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3939

4040
### Fixed
4141
- Change ID option of `bootit alias add` to hexadecimal.
42+
43+
## [0.4.0] - 2026-02-09
44+
45+
### Fixed
46+
- Add fallback `sh -c "reboot -f"` for systems like busybox.

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.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description = "Lightweight Boot Selector"
44
repository = "https://github.com/mincomk/bootit"
55
authors = ["mincomk <mail@drchi.co.kr>"]
66
license = "MIT"
7-
version = "0.3.0"
7+
version = "0.4.0"
88
edition = "2024"
99

1010
[dependencies]

src/command/boot.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use miette::{IntoDiagnostic, miette};
2-
use std::path::PathBuf;
2+
use std::{path::PathBuf, process::Command};
33

44
use crate::{config, efi};
55

@@ -48,7 +48,14 @@ pub fn boot(config_path: PathBuf, target: String, no_reboot: bool) -> miette::Re
4848
}
4949

5050
if !no_reboot {
51-
system_shutdown::reboot().into_diagnostic()?;
51+
if let Err(_) = system_shutdown::reboot() {
52+
// failed to reboot. maybe try busybox
53+
54+
Command::new("/bin/sh")
55+
.args(&["-c", "reboot -f"])
56+
.status()
57+
.into_diagnostic()?;
58+
}
5259
}
5360

5461
Ok(())

0 commit comments

Comments
 (0)