diff --git a/80-rhel/config_files/aarch64/grub.conf b/80-rhel/config_files/aarch64/grub.conf deleted file mode 100644 index 49fa32b..0000000 --- a/80-rhel/config_files/aarch64/grub.conf +++ /dev/null @@ -1,13 +0,0 @@ -#debug --graphics -default=0 -splashimage=@SPLASHPATH@ -timeout 5 -hiddenmenu -title Install @PRODUCT@ @VERSION@ - findiso - kernel @KERNELPATH@ @ROOT@ quiet - initrd @INITRDPATH@ -title Test this media & install @PRODUCT@ @VERSION@ - findiso - kernel @KERNELPATH@ @ROOT@ rd.live.check quiet - initrd @INITRDPATH@ diff --git a/80-rhel/config_files/x86/grub.conf b/80-rhel/config_files/x86/grub.conf deleted file mode 100644 index 4cf8ced..0000000 --- a/80-rhel/config_files/x86/grub.conf +++ /dev/null @@ -1,13 +0,0 @@ -#debug --graphics -default=1 -splashimage=@SPLASHPATH@ -timeout 60 -hiddenmenu -title Install @PRODUCT@ @VERSION@ - findiso - kernel @KERNELPATH@ @ROOT@ quiet - initrd @INITRDPATH@ -title Test this media & install @PRODUCT@ @VERSION@ - findiso - kernel @KERNELPATH@ @ROOT@ rd.live.check quiet - initrd @INITRDPATH@ diff --git a/80-rhel/config_files/x86/grub2-bios.cfg b/80-rhel/config_files/x86/grub2-bios.cfg new file mode 100644 index 0000000..9c3e86a --- /dev/null +++ b/80-rhel/config_files/x86/grub2-bios.cfg @@ -0,0 +1,36 @@ +set default="1" + +function load_video { + insmod all_video +} + +load_video +set gfxpayload=keep +insmod gzio +insmod part_gpt +insmod ext2 + +set timeout=60 +### END /etc/grub.d/00_header ### + +search --no-floppy --set=root -l '@ISOLABEL@' + +### BEGIN /etc/grub.d/10_linux ### +menuentry 'Install @PRODUCT@ @VERSION@' --class fedora --class gnu-linux --class gnu --class os { + linux @KERNELPATH@ @ROOT@ quiet + initrd @INITRDPATH@ +} +menuentry 'Test this media & install @PRODUCT@ @VERSION@' --class fedora --class gnu-linux --class gnu --class os { + linux @KERNELPATH@ @ROOT@ rd.live.check quiet + initrd @INITRDPATH@ +} +submenu 'Troubleshooting -->' { + menuentry 'Install @PRODUCT@ @VERSION@ in basic graphics mode' --class fedora --class gnu-linux --class gnu --class os { + linux @KERNELPATH@ @ROOT@ nomodeset quiet + initrd @INITRDPATH@ + } + menuentry 'Rescue a @PRODUCT@ system' --class fedora --class gnu-linux --class gnu --class os { + linux @KERNELPATH@ @ROOT@ inst.rescue quiet + initrd @INITRDPATH@ + } +} diff --git a/80-rhel/live/config_files/x86/grub.conf b/80-rhel/live/config_files/x86/grub.conf deleted file mode 100644 index 6c4a51f..0000000 --- a/80-rhel/live/config_files/x86/grub.conf +++ /dev/null @@ -1,13 +0,0 @@ -#debug --graphics -default=1 -splashimage=@SPLASHPATH@ -timeout 60 -hiddenmenu -title Start @PRODUCT@ @VERSION@ - findiso - kernel @KERNELPATH@ @ROOT@ @EXTRA@ rd.live.image quiet - initrd @INITRDPATH@ -title Test this media & start @PRODUCT@ @VERSION@ - findiso - kernel @KERNELPATH@ @ROOT@ @EXTRA@ rd.live.image rd.live.check quiet - initrd @INITRDPATH@ diff --git a/80-rhel/live/live-install.tmpl b/80-rhel/live/live-install.tmpl index bfa1a1b..6d36bfd 100644 --- a/80-rhel/live/live-install.tmpl +++ b/80-rhel/live/live-install.tmpl @@ -19,6 +19,7 @@ %if basearch in ("i386", "x86_64"): installpkg biosdevname memtest86+ installpkg grub2-tools grub2-tools-minimal grub2-tools-extra + installpkg grub2-pc-modules %endif %if basearch in ("ppc64le"): installpkg powerpc-utils diff --git a/80-rhel/runtime-install.tmpl b/80-rhel/runtime-install.tmpl index c0c0662..bf29938 100644 --- a/80-rhel/runtime-install.tmpl +++ b/80-rhel/runtime-install.tmpl @@ -50,6 +50,7 @@ installpkg glibc-all-langpacks %if basearch in ("i386", "x86_64"): installpkg biosdevname memtest86+ installpkg grub2-tools grub2-tools-minimal grub2-tools-extra + installpkg grub2-pc-modules %endif %if basearch in ("ppc", "ppc64", "ppc64le"): installpkg powerpc-utils lsvpd ppc64-diag diff --git a/80-rhel/x86.tmpl b/80-rhel/x86.tmpl index a4e1a4c..7334788 100644 --- a/80-rhel/x86.tmpl +++ b/80-rhel/x86.tmpl @@ -4,6 +4,7 @@ configdir="tmp/config_files/x86" SYSLINUXDIR="usr/share/syslinux" PXEBOOTDIR="images/pxeboot" STAGE2IMG="images/install.img" +GRUB2DIR="boot/grub2" BOOTDIR="isolinux" KERNELDIR=PXEBOOTDIR LORAXDIR="usr/share/lorax/" @@ -25,10 +26,27 @@ else: isoargs = "" %> +## configure grub2 +mkdir ${GRUB2DIR} +install ${configdir}/grub2-bios.cfg ${GRUB2DIR}/grub.cfg +replace @VERSION@ ${product.version} ${GRUB2DIR}/grub.cfg +replace @PRODUCT@ '${product.name}' ${GRUB2DIR}/grub.cfg +replace @KERNELPATH@ /${KERNELDIR}/vmlinuz ${GRUB2DIR}/grub.cfg +replace @INITRDPATH@ /${KERNELDIR}/initrd.img ${GRUB2DIR}/grub.cfg +replace @ROOT@ 'inst.stage2=hd:LABEL=${isolabel|udev}' ${GRUB2DIR}/grub.cfg + mkdir images install ${runtime_img} ${STAGE2IMG} treeinfo stage2 mainimage images/${runtime_base} +## BIOS setup +<% + biosgraft = "boot=${outroot}/boot" + biosgraft += " ${GRUB2DIR}/i386-pc=${inroot}/usr/lib/grub/i386-pc" + biosgraft += " images/eltorito.img=${outroot}/images/eltorito.img" +%> +treeinfo images-${basearch} eltorito.img images/eltorito.img + ## install kernels mkdir ${KERNELDIR} %for kernel in kernels: @@ -48,6 +66,16 @@ mkdir ${KERNELDIR} treeinfo images-xen initrd ${KERNELDIR}/initrd.img %endif + +## BIOS setup +<% + biosgraft = "boot=${outroot}/boot" + biosgraft += " ${GRUB2DIR}/i386-pc=${inroot}/usr/lib/grub/i386-pc" + biosgraft += " images/eltorito.img=${outroot}/images/eltorito.img" +%> +treeinfo images-${basearch} eltorito.img images/eltorito.img + + ## WHeeeeeeee, EFI. <% efiargs=""; efigraft=""; efiarch32=None; efiarch64=None %> %if exists("boot/efi/EFI/*/gcdia32.efi"): @@ -100,12 +128,28 @@ mkdir ${KERNELDIR} <% filegraft += " {0}={1}/{0}".format(basename(f), outroot) %> %endfor ++## Make images/eltoritio.img +runcmd grub2-mkimage -O i386-pc-eltorito -d ${inroot}/usr/lib/grub/i386-pc \ + -o ${outroot}/images/eltorito.img \ + -p /${GRUB2DIR} \ + iso9660 biosdisk + ## make boot.iso runcmd xorrisofs ${isoargs} -o ${outroot}/images/boot.iso \ - ${efiargs} -R -J -V '${isolabel}' \ + -R -J -V '${isolabel}' \ + --grub2-mbr ${inroot}/usr/lib/grub/i386-pc/boot_hybrid.img \ + -partition_offset 16 \ + -appended_part_as_gpt \ + -append_partition 2 C12A7328-F81F-11D2-BA4B-00A0C93EC93B ${outroot}/images/efiboot.img \ + -iso_mbr_part_type EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 \ + -c boot.cat --boot-catalog-hide \ + -b images/eltorito.img \ + -no-emul-boot -boot-load-size 4 -boot-info-table --grub2-boot-info \ + -eltorito-alt-boot \ + -e '--interval:appended_partition_2:all::' -no-emul-boot \ -graft-points \ .discinfo=${outroot}/.discinfo \ ${STAGE2IMG}=${outroot}/${STAGE2IMG} \ ${KERNELDIR}=${outroot}/${KERNELDIR} \ - ${efigraft} ${filegraft} + ${biosgraft} ${efigraft} ${filegraft} treeinfo images-${basearch} boot.iso images/boot.iso