diff --git a/diskimage_builder/elements/bootloader/finalise.d/50-bootloader b/diskimage_builder/elements/bootloader/finalise.d/50-bootloader index 26b861b8..88de8d89 100755 --- a/diskimage_builder/elements/bootloader/finalise.d/50-bootloader +++ b/diskimage_builder/elements/bootloader/finalise.d/50-bootloader @@ -150,6 +150,9 @@ function install_grub2 { case $ARCH in "x86_64"|"amd64") GRUB_OPTS="--target=x86_64-efi" + # This call installs grub for BIOS compatability + # which makes portable EFI/BIOS images. + $GRUBNAME --modules="$modules" --target=i386-pc $BOOT_DEV ;; # At this point, we don't need to override the target # for any other architectures. diff --git a/diskimage_builder/elements/bootloader/pkg-map b/diskimage_builder/elements/bootloader/pkg-map index 5b34f155..e2e933d8 100644 --- a/diskimage_builder/elements/bootloader/pkg-map +++ b/diskimage_builder/elements/bootloader/pkg-map @@ -4,7 +4,7 @@ "8": { "extlinux": "syslinux-extlinux", "grub-pc": "grub2-tools grub2", - "grub-efi-amd64": "grub2-tools grub2-efi-x64 grub2-efi-x64-modules", + "grub-efi-amd64": "grub2-tools grub2-pc grub2-efi-x64 grub2-efi-x64-modules", "grub-efi-arm64": "grub2-tools grub2-efi-aa64 grub2-efi-aa64-modules", "grub-efi-aarch64": "grub2-tools grub2-efi-aa64 grub2-efi-aa64-modules", "grub-efi": "grub2-tools grub2-efi", @@ -29,7 +29,7 @@ "redhat": { "extlinux": "syslinux-extlinux", "grub-pc": "grub2-tools grub2", - "grub-efi-amd64": "grub2-tools grub2-efi-x64 grub2-efi-x64-modules", + "grub-efi-amd64": "grub2-tools grub2-pc grub2-efi-x64 grub2-efi-x64-modules", "grub-efi-arm64": "grub2-tools grub2-efi-aa64 grub2-efi-aa64-modules", "grub-efi-aarch64": "grub2-tools grub2-efi-aa64 grub2-efi-aa64-modules", "grub-efi": "grub2-tools grub2-efi", @@ -40,7 +40,7 @@ "dkms_package": "dkms", "extlinux": "extlinux", "grub-pc": "grub-pc", - "grub-efi-amd64": "grub-efi", + "grub-efi-amd64": "grub-efi grub-pc-bin", "grub-efi-arm64": "grub-efi-arm64", "grub-ppc64": "grub-ieee1275" } diff --git a/releasenotes/notes/efi-bios-images-052283eabba98b90.yaml b/releasenotes/notes/efi-bios-images-052283eabba98b90.yaml new file mode 100644 index 00000000..c1ac11bc --- /dev/null +++ b/releasenotes/notes/efi-bios-images-052283eabba98b90.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + The ``bootloader`` element now co-installs a BIOS bootloader for + x86-64 when ``DIB_BLOCK_DEVICE=efi`` is set. This makes images + that are EFI and BIOS cross-compatiable.