finding grubenv
This commit is contained in:
parent
a605346c8a
commit
7e2b76e125
2 changed files with 20 additions and 1 deletions
7
Cargo.lock
generated
Normal file
7
Cargo.lock
generated
Normal file
|
@ -0,0 +1,7 @@
|
|||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "grub-reboot-rs"
|
||||
version = "0.1.0"
|
14
src/main.rs
14
src/main.rs
|
@ -1,3 +1,15 @@
|
|||
use std::{path::Path, process::exit};
|
||||
|
||||
const BOOT_PATH: &str = "/boot";
|
||||
|
||||
fn main() {
|
||||
println!("Hello, world!");
|
||||
let boot_folder = Path::new(BOOT_PATH);
|
||||
let grub_env = boot_folder.join("grub/grubenv");
|
||||
|
||||
if !grub_env.exists() {
|
||||
eprintln!("Unable to find grubenv");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
println!("{grub_env:?}");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue