reinstall grub for bios systems

This commit is contained in:
Neil Hanlon 2022-11-23 20:10:18 -05:00
parent 2ce5a69275
commit 8151980b4a
Signed by: neil
GPG Key ID: 705BC21EC3C70F34
3 changed files with 30 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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