Skip to content

Commit

Permalink
mount: Be compatible with older util-linux
Browse files Browse the repository at this point in the history
This is the same as
coreos/bootupd@1457c20
and makes things work on c9s.

Signed-off-by: Colin Walters <walters@verbum.org>
  • Loading branch information
cgwalters committed Dec 13, 2023
1 parent 8bf5de7 commit 0bfc29e
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 0bfc29e

Please sign in to comment.