Skip to content

Commit

Permalink
[WIP] initoverlayfs: Add initial initoverlayfs support
Browse files Browse the repository at this point in the history
This patch adds the option to use initoverlayfs project with
Signed-off-by: Douglas Schilling Landgraf <[email protected]>

foo
  • Loading branch information
dougsland committed Feb 14, 2024
1 parent fc39c53 commit ac4b1fb
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions rust/src/cliwrap/kernel_install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,20 @@ fn redo_systemctl_wrap() -> Result<()> {
Ok(())
}

#[context("Running initoverlayfs")]
fn run_initoverlayfs() -> Result<()> {
const INITOVERLAY_INSTALL_CMD: &str = "initoverlayfs-install";

if let Err(err) = cliutil::exec_real_binary(INITOVERLAY_INSTALL_CMD, &empty_argv) {
return Err(anyhow!(
"Error: Command '{}' failed with: {}",
INITOVERLAY_INSTALL_CMD,
err
));
}
Ok(())
}

#[context("Running dracut")]
fn run_dracut(kernel_dir: &str) -> Result<()> {
let root_fs = Utf8Dir::open_ambient_dir("/", cap_std::ambient_authority())?;
Expand Down Expand Up @@ -108,5 +122,10 @@ fn run_dracut(kernel_dir: &str) -> Result<()> {
&root_fs,
(Utf8Path::new("lib/modules").join(kernel_dir)).join("initramfs.img"),
)?;

if let Err(error) = run_initoverlayfs() {
return Err(anyhow!("Failed to execute initoverlayfs: {}", error));
}

Ok(())
}

0 comments on commit ac4b1fb

Please sign in to comment.