Skip to content

Commit

Permalink
Merge pull request #4060 from cgwalters/rhel8-dracut
Browse files Browse the repository at this point in the history
[rhel8] cliwrap: Also inject /dev/random into cliwrap'd dracut
  • Loading branch information
Luca Bruno committed Sep 28, 2022
2 parents 4e79097 + ade6df3 commit ac182cb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion rust/src/cliwrap/kernel_install.rs
Expand Up @@ -7,6 +7,7 @@ use camino::Utf8Path;
use cap_std::fs::FileType;
use cap_std::fs_utf8::Dir as Utf8Dir;
use cap_std_ext::cap_std;
use std::io::Write;
use std::process::Command;

/// Primary entrypoint to running our wrapped `kernel-install` handling.
Expand Down Expand Up @@ -65,14 +66,20 @@ fn run_dracut(kernel_dir: &str) -> Result<()> {
"ostree",
"-f",
])
.arg(tmp_initramfs_path)
.arg(&tmp_initramfs_path)
.status()?;
if !res.success() {
return Err(anyhow!(
"Failed to generate initramfs (via dracut) for for kernel: {kernel_dir}: {:?}",
res
));
}
let mut f = std::fs::OpenOptions::new()
.write(true)
.append(true)
.open(&tmp_initramfs_path)?;
f.write(crate::initramfs::get_dracut_random_cpio())?;
drop(f);
let utf8_tmp_dir_path = Utf8Path::from_path(tmp_dir.path().strip_prefix("/")?)
.context("Error turning Path to Utf8Path")?;
root_fs.rename(
Expand Down

0 comments on commit ac182cb

Please sign in to comment.