MCPcopy Create free account
hub / github.com/bootc-dev/bootc / remove_immutability

Function remove_immutability

crates/lib/src/utils.rs:100–112  ·  view source on GitHub ↗
(root: &Dir, target: &Utf8Path)

Source from the content-addressed store, hash-verified

98/// Given a target path, remove its immutability if present
99#[context("Removing immutable flag from {target}")]
100pub(crate) fn remove_immutability(root: &Dir, target: &Utf8Path) -> Result<()> {
101 use anyhow::ensure;
102
103 tracing::debug!("Target {target} is a mountpoint, remounting rw");
104 let st = Command::new("chattr")
105 .args(["-i", target.as_str()])
106 .cwd_dir(root.try_clone()?)
107 .status()?;
108
109 ensure!(st.success(), "Failed to remove immutability: {st:?}");
110
111 Ok(())
112}
113
114pub(crate) fn spawn_editor(tmpf: &tempfile::NamedTempFile) -> Result<()> {
115 let editor_variables = ["EDITOR"];

Callers 1

initialize_ostree_rootFunction · 0.85

Calls 1

argsMethod · 0.80

Tested by

no test coverage detected