Skip to content

Commit

Permalink
wip: revive repart_cfg from the dead
Browse files Browse the repository at this point in the history
  • Loading branch information
korewaChino committed Sep 24, 2024
1 parent 57e3401 commit 99e5005
Show file tree
Hide file tree
Showing 6 changed files with 202 additions and 117 deletions.
24 changes: 24 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ toml = "0.8.19"
serde_valid = { version = "0.24.0", features = ["toml"] }
os_pipe = "1.2.1"
tee_readwrite = "0.2.0"
serde_ini = "0.2.0"

[dependencies.os-detect]
git = "https://github.com/FyraLabs/distinst"
Expand Down
2 changes: 1 addition & 1 deletion src/backend/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pub mod l10n;
// pub mod repartcfg;
pub mod repartcfg;
pub mod repart_output;
21 changes: 21 additions & 0 deletions src/backend/repart_output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ pub struct RepartOutput {
pub partitions: Vec<RepartPartition>,
}


impl RepartOutput {
/// Generate a `BTreeMap` of mountpoint -> node name for generating /etc/fstab
/// from DDI partition types
Expand Down Expand Up @@ -131,6 +132,26 @@ impl RepartPartition {
_ => None,
}
}

/// Generate an FS Table entry for the partition,
/// Returns a line for /etc/fstab
pub fn fstab_entry(&self) -> String {
// Damn, this is kinda painful to write...

const FALLBACK_FS: &str = "auto";
const FALLBACK_OPTS: &str = "defaults";
const FALLBACK_DUMP: i32 = 0;
const FALLBACK_PASS: i32 = 2;


// Now, let's read the config file this thing is generated from...




todo!()
}

}

#[cfg(test)]
Expand Down
Loading

0 comments on commit 99e5005

Please sign in to comment.