@@ -174,8 +174,14 @@ impl Bootloader {
174
174
175
175
fn cp_grub ( & self , manifest : & Manifest , chroot : & Path ) -> Result < ( ) > {
176
176
let imgd = chroot. parent ( ) . unwrap ( ) . join ( ISO_TREE ) ;
177
+ let assets = chroot. parent ( ) . unwrap ( ) . join ( "assets" ) ;
178
+ std:: fs:: create_dir_all ( & assets) ?;
177
179
let cmd = & manifest. kernel_cmdline . as_ref ( ) . map_or ( "" , |s| s) ;
178
180
let volid = manifest. get_volid ( ) ;
181
+ if manifest. dnf . arch . as_deref ( ) . unwrap_or ( std:: env:: consts:: ARCH ) == "x86_64" {
182
+ let hybrid_img = chroot. join ( "usr/lib/grub/i386-pc/boot_hybrid.img" ) ;
183
+ std:: fs:: copy ( & hybrid_img, assets. join ( "boot_hybrid.img" ) ) ?;
184
+ } ;
179
185
180
186
let ( vmlinuz, initramfs) = self . cp_vmlinuz_initramfs ( chroot, & imgd) ?;
181
187
@@ -742,9 +748,10 @@ impl IsoBuilder {
742
748
let volid = manifest. get_volid ( ) ;
743
749
let ( uefi_bin, bios_bin) = self . bootloader . get_bins ( ) ;
744
750
let tree = chroot. parent ( ) . unwrap ( ) . join ( ISO_TREE ) ;
751
+ let assets = chroot. parent ( ) . unwrap ( ) . join ( "assets" ) ;
745
752
746
753
// TODO: refactor to new fn in Bootloader
747
- let grub2_mbr_hybrid = chroot . join ( "usr/lib/grub/i386-pc/ boot_hybrid.img" ) ;
754
+ let grub2_mbr_hybrid = assets . join ( "boot_hybrid.img" ) ;
748
755
let efiboot = tree. join ( "boot/efiboot.img" ) ;
749
756
750
757
match self . bootloader {
@@ -880,7 +887,6 @@ impl ImageBuilder for IsoBuilder {
880
887
881
888
info ! ( "Build process completed successfully for image: {:?}" , image) ;
882
889
883
-
884
890
Ok ( ( ) )
885
891
}
886
892
}
0 commit comments