diff --git a/Cargo.lock b/Cargo.lock index 3483625..7ef7da1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,15 +2,6 @@ # It is not intended for manual editing. version = 4 -[[package]] -name = "aho-corasick" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba" -dependencies = [ - "memchr", -] - [[package]] name = "allocator-api2" version = "0.2.21" @@ -249,12 +240,6 @@ dependencies = [ "hashbrown 0.17.1", ] -[[package]] -name = "memchr" -version = "2.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" - [[package]] name = "nix" version = "0.31.3" @@ -304,7 +289,7 @@ dependencies = [ "nix", "ratatui", "ratatui-textarea", - "regex", + "regex-lite", "termion", ] @@ -450,33 +435,10 @@ dependencies = [ ] [[package]] -name = "regex" -version = "1.13.1" +name = "regex-lite" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" +checksum = "cab834c73d247e67f4fae452806d17d3c7501756d98c8808d7c9c7aa7d18f973" [[package]] name = "rustversion" diff --git a/Cargo.toml b/Cargo.toml index fe29ed8..99217d9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ edition = "2024" nix = { version = "0.31", features = ["mount"] } ratatui = { version = "0.30", default-features = false, features = ["termion"] } ratatui-textarea = { version = "0.9", default-features = false, features = ["termion"] } -regex = "1" +regex-lite = "0.1" termion = "4" [profile.release] @@ -15,5 +15,5 @@ lto = true debug = false incremental = false codegen-units = 1 -opt-level = 2 +opt-level = "s" strip = true diff --git a/src/main.rs b/src/main.rs index 49706b8..bc6785b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -40,8 +40,10 @@ const BEE_CAT: &str = include_str!("bee_cat.txt"); //const ROOT_PARTLABEL: &str = "bee-root"; const ROOT_PARTLABEL: &str = "bee-root"; -const TMP_ROOT: &str = "/mnt/bee_root"; -const TMP_ROOT_SNAPS: &str = "/mnt/bee_root/bzz_snaps"; +const TMP_REAL_ROOT: &str = "/mnt/real-bee"; +const TMP_REAL_ROOT_SNAPS: &str = "/mnt/real-bee/bzz-snaps"; +const TMP_ROOT: &str = "/mnt/real-bee/bee-root"; +const TMP_ROOT_SNAPS: &str = "/mnt/real-bee/bee-root/bzz-snaps"; const SYS_INIT: &str = "/sbin/init"; // fn bee_root_is_present() -> bool { @@ -76,13 +78,13 @@ enum NyanitState { /// Mounting bee-root and chiking if there any snapshots fn mount_and_check_snaps(bee_root_dev: &str) -> Result { // mount bee-root - nyan_system::mount_bee_root(bee_root_dev, TMP_ROOT)?; + nyan_system::mount_bee_root(bee_root_dev, TMP_REAL_ROOT)?; // let root_list = nyan_system::list_dir(TMP_ROOT)?; // return Err(ExecCommandError::Other(root_list)); // list snaps if any - let mut snaps_list = nyan_system::list_bzzpss_snaps(TMP_ROOT_SNAPS)?; + let mut snaps_list = nyan_system::list_bzzpss_snaps(TMP_REAL_ROOT_SNAPS)?; // if any snaps detected whait for user to press F2 if snaps_list.len() > 0 { snaps_list.insert(0, TMP_ROOT.to_string()); diff --git a/src/nyan_system.rs b/src/nyan_system.rs index ad32ffb..500dc23 100644 --- a/src/nyan_system.rs +++ b/src/nyan_system.rs @@ -251,7 +251,7 @@ pub fn bzzpss_dev_encrypted(dev_name: &str) -> Result { //const TMP_ROOT: &str = "/mnt/bee-root"; pub fn list_bzzpss_snaps(snaps_dir: &str) -> Result, ExecCommandError> { - use regex::Regex; + use regex_lite::Regex; use std::path::Path; // root snapshoot in a form of bzz-yyyy-mm-ddTHH-MM-SS