Skip to content

Commit

Permalink
Merge pull request #222 from cgwalters/findmnt-c9s
Browse files Browse the repository at this point in the history
mount: Be compatible with older util-linux
  • Loading branch information
jmarrero committed Dec 13, 2023
2 parents 8bf5de7 + 0bfc29e commit abe9633
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/src/mount.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use crate::task::Task;
#[derive(Deserialize, Debug)]
#[serde(rename_all = "kebab-case")]
pub(crate) struct Filesystem {
// Note if you add an entry to this list, you need to change the --output invocation below too
pub(crate) source: String,
pub(crate) fstype: String,
pub(crate) options: String,
Expand All @@ -25,7 +26,13 @@ pub(crate) struct Findmnt {
pub(crate) fn inspect_filesystem(path: &Utf8Path) -> Result<Filesystem> {
let desc = format!("Inspecting {path}");
let o = Task::new(&desc, "findmnt")
.args(["-J", "-v", "--output-all", path.as_str()])
.args([
"-J",
"-v",
// If you change this you probably also want to change the Filesystem struct above
"--output=SOURCE,FSTYPE,OPTIONS,UUID",
path.as_str(),
])
.quiet()
.read()?;
let o: Findmnt = serde_json::from_str(&o).context("Parsing findmnt output")?;
Expand Down

0 comments on commit abe9633

Please sign in to comment.