Skip to content

Commit

Permalink
Fix Grub image generation for different
Browse files Browse the repository at this point in the history
architectures
  • Loading branch information
korewaChino committed Nov 22, 2023
1 parent be49cdf commit 2044f72
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,15 +226,23 @@ impl Bootloader {
let host_arch = cmd_lib::run_fun!(uname -m;)?;

let arch = match &**manifest.dnf.arch.as_ref().unwrap_or(&host_arch) {
"x86_64" => "i386-pc",
"aarch64" => "arm64-efi",
_ => unimplemented!(),
};

let arch_out = match &**manifest.dnf.arch.as_ref().unwrap_or(&host_arch) {
"x86_64" => "i386-pc-eltorito",
"aarch64" => "arm64-efi",
_ => unimplemented!(),
};



debug!("Generating Grub images");
cmd_lib::run_cmd!(
// todo: uefi support
grub2-mkimage -O $arch -d $chroot/usr/lib/grub/$arch -o $imgd/boot/eltorito.img -p /boot/grub iso9660 biosdisk 2>&1;
grub2-mkimage -O $arch_out -d $chroot/usr/lib/grub/$arch -o $imgd/boot/eltorito.img -p /boot/grub iso9660 biosdisk 2>&1;
// make it 2.88 MB
// fallocate -l 1228800 $imgd/boot/eltorito.img;
// ^ Commented out because it just wiped the entire file - @korewaChino
Expand Down

0 comments on commit 2044f72

Please sign in to comment.