Skip to content

Commit

Permalink
Merge pull request #561 from cgwalters/handle-no-grub2
Browse files Browse the repository at this point in the history
grubconfigs: Ensure grub2 dir exists
  • Loading branch information
cgwalters authored Nov 10, 2023
2 parents 03e73b9 + ece9120 commit 9d5d9d5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/grubconfigs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ pub(crate) fn install(target_root: &openat::Dir, efi: bool) -> Result<()> {
config.push_str(post.as_str());
}

if !bootdir.exists(GRUB2DIR)? {
bootdir.create_dir(GRUB2DIR, 0o700)?;
}

bootdir
.write_file_contents(format!("{GRUB2DIR}/grub.cfg"), 0o644, config.as_bytes())
.context("Copying grub-static.cfg")?;
Expand Down

0 comments on commit 9d5d9d5

Please sign in to comment.