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 85624b5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions rust/src/cliwrap/kernel_install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,15 @@ fn redo_systemctl_wrap() -> Result<()> {
Ok(())
}

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

let empty_argv: Vec<&str> = Vec::new();
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 +117,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 85624b5

Please sign in to comment.