Skip to content

Commit

Permalink
maybe this will work
Browse files Browse the repository at this point in the history
  • Loading branch information
madonuko committed Oct 11, 2023
1 parent 223dc0f commit 140a68b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ nix = { version = "0.27", features = ["mount", "hostname", "dir"] }
uuid = "1.4.1"
loopdev = { git = "https://github.com/mdaffin/loopdev.git", version = "0.5.0" }
bytesize = { version = "1.3.0", features = ["serde"] }
lazy_static = "1.4.0"
16 changes: 11 additions & 5 deletions src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@ impl Bootloader {
}
pub fn get_bins(&self) -> (&'static str, &'static str) {
match *self {
Self::Grub => (
"boot/efi/EFI/*/shim${efiarch64|lower}.efi",
"boot/efi/EFI/*/mm${efiarch64|lower}.efi",
),
Self::Grub => ("boot/efi/EFI/fedora/shim.efi", "boot/eltorito.img"),
Self::Limine => ("boot/limine-uefi-cd.bin", "boot/limine-bios-cd.bin"),
Self::SystemdBoot => todo!(),
}
Expand Down Expand Up @@ -209,9 +206,18 @@ menuentry '{distro_name}' --class ultramarine --class gnu-linux --class gnu --cl

f.flush()?;


// crate::chroot_run_cmd!(chroot, grub2-mkconfig -o /boot/grub2/grub.cfg 2>&1)?;
cmd_lib::run_cmd!(cp -r $chroot/boot $imgd/)?; // too lazy to cp one by one

// and then we need to generate eltorito.img
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" => "aa64-pc",
_ => unimplemented!(),
};
cmd_lib::run_cmd!(grub2-mkimage -O $arch-eltorito -d $chroot/usr/lib/grub/$arch -o $imgd/boot/eltorito.img -p boot/grub2 iso9660 biosdisk)?;
Ok(())
}

Expand Down

0 comments on commit 140a68b

Please sign in to comment.