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]>
  • Loading branch information
dougsland committed Feb 14, 2024
1 parent fc39c53 commit 80c923b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 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,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 80c923b

Please sign in to comment.