From 1561c8311438c0d068ed763e0295600ae0c8a5bd Mon Sep 17 00:00:00 2001 From: Douglas Schilling Landgraf Date: Sat, 9 Dec 2023 09:25:42 -0500 Subject: [PATCH] initoverlayfs: Add initial initoverlayfs support Run initoverlayfs in case the binary exists. Signed-off-by: Douglas Schilling Landgraf --- rust/src/cliwrap/kernel_install.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/rust/src/cliwrap/kernel_install.rs b/rust/src/cliwrap/kernel_install.rs index cc2a0077b0..ce4182a82e 100644 --- a/rust/src/cliwrap/kernel_install.rs +++ b/rust/src/cliwrap/kernel_install.rs @@ -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())?; @@ -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(()) }