From 8151980b4ad0136c4ea10e78a9ac77622f67a40c Mon Sep 17 00:00:00 2001 From: Neil Hanlon Date: Wed, 23 Nov 2022 20:10:18 -0500 Subject: [PATCH] reinstall grub for bios systems --- Rocky-9-Vagrant-Libvirt.ks | 10 ++++++++++ Rocky-9-Vagrant-VMware.ks | 10 ++++++++++ Rocky-9-Vagrant-Vbox.ks | 10 ++++++++++ 3 files changed, 30 insertions(+) diff --git a/Rocky-9-Vagrant-Libvirt.ks b/Rocky-9-Vagrant-Libvirt.ks index 6f82c9f..4ca9dee 100644 --- a/Rocky-9-Vagrant-Libvirt.ks +++ b/Rocky-9-Vagrant-Libvirt.ks @@ -39,6 +39,16 @@ part /boot --size=1000 --fstype=xfs --asprimary --label=boot part / --size=8000 --fstype="xfs" --mkfsoptions "-m bigtime=0,inobtcount=0" %post + +# Attempting to force legacy BIOS boot if we boot from UEFI +if [ "$(arch)" = "x86_64" ]; then + dnf install grub2-pc-modules grub2-pc -y + grub2-install --target=i386-pc /dev/vda +fi + +# Ensure that the pmbr_boot flag is off +parted /dev/vda disk_set pmbr_boot off + # configure swap to a file fallocate -l 2G /swapfile chmod 600 /swapfile diff --git a/Rocky-9-Vagrant-VMware.ks b/Rocky-9-Vagrant-VMware.ks index c433d01..be56467 100644 --- a/Rocky-9-Vagrant-VMware.ks +++ b/Rocky-9-Vagrant-VMware.ks @@ -39,6 +39,16 @@ part /boot --size=1000 --fstype=xfs --asprimary --label=boot part / --size=8000 --fstype="xfs" --mkfsoptions "-m bigtime=0,inobtcount=0" %post + +# Attempting to force legacy BIOS boot if we boot from UEFI +if [ "$(arch)" = "x86_64" ]; then + dnf install grub2-pc-modules grub2-pc -y + grub2-install --target=i386-pc /dev/vda +fi + +# Ensure that the pmbr_boot flag is off +parted /dev/vda disk_set pmbr_boot off + # configure swap to a file fallocate -l 2G /swapfile chmod 600 /swapfile diff --git a/Rocky-9-Vagrant-Vbox.ks b/Rocky-9-Vagrant-Vbox.ks index 06eb946..bb2259f 100644 --- a/Rocky-9-Vagrant-Vbox.ks +++ b/Rocky-9-Vagrant-Vbox.ks @@ -39,6 +39,16 @@ part /boot --size=1000 --fstype=xfs --asprimary --label=boot part / --size=8000 --fstype="xfs" --mkfsoptions "-m bigtime=0,inobtcount=0" %post + +# Attempting to force legacy BIOS boot if we boot from UEFI +if [ "$(arch)" = "x86_64" ]; then + dnf install grub2-pc-modules grub2-pc -y + grub2-install --target=i386-pc /dev/vda +fi + +# Ensure that the pmbr_boot flag is off +parted /dev/vda disk_set pmbr_boot off + # configure swap to a file fallocate -l 2G /swapfile chmod 600 /swapfile