Skip to content

Commit

Permalink
grub config autogen may not actually work, going back to post-scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
korewaChino committed Oct 10, 2024
1 parent c546f63 commit 694e342
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,12 +373,13 @@ impl RootBuilder for DnfRootBuilder {
}

if manifest.bootloader == Bootloader::GrubBios || manifest.bootloader == Bootloader::Grub {
info!("Generating GRUB configuration");
crate::chroot_run_cmd!(&chroot,
echo "GRUB_DISABLE_OS_PROBER=true" > /etc/default/grub;
)?;
info!("Attempting to run grub2-mkconfig");
// crate::chroot_run_cmd!(&chroot,
// echo "GRUB_DISABLE_OS_PROBER=true" > /etc/default/grub;
// )?;

// While grub2-mkconfig may not return 0 it should still work
// todo: figure out why it still wouldn't write the file to /boot/grub2/grub.cfg
let res = crate::chroot_run_cmd!(&chroot,
grub2-mkconfig -o /boot/grub2/grub.cfg;
);
Expand All @@ -387,9 +388,9 @@ impl RootBuilder for DnfRootBuilder {
warn!(?e, "grub2-mkconfig not returning 0, continuing anyway");
}

crate::chroot_run_cmd!(&chroot,
rm -f /etc/default/grub;
)?;
// crate::chroot_run_cmd!(&chroot,
// rm -f /etc/default/grub;
// )?;
}

// now, let's run some funny post-install scripts
Expand Down
5 changes: 5 additions & 0 deletions tests/ng/katsu-bios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ scripts:
name: Relabel SELinux for new filesystem
file: modules/scripts/selinux.sh

- id: grub-install
name: Install GRUB
file: modules/scripts/grub-confgen.sh



disk:
size: 8GiB
Expand Down

0 comments on commit 694e342

Please sign in to comment.