Skip to content

Commit

Permalink
initoverlayfs: Add initial initoverlayfs support
Browse files Browse the repository at this point in the history
Run initoverlayfs in case the binary exists.

Signed-off-by: Douglas Schilling Landgraf <[email protected]>
  • Loading branch information
dougsland committed Feb 14, 2024
1 parent fc39c53 commit 1561c83
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions rust/src/cliwrap/kernel_install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ fn redo_systemctl_wrap() -> Result<()> {
Ok(())
}

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

let _ = cliutil::exec_real_binary(INITOVERLAY_INSTALL_CMD, &empty_argv);
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 +116,8 @@ fn run_dracut(kernel_dir: &str) -> Result<()> {
&root_fs,
(Utf8Path::new("lib/modules").join(kernel_dir)).join("initramfs.img"),
)?;

run_initoverlayfs()?;

Ok(())
}

0 comments on commit 1561c83

Please sign in to comment.