Skip to content

Commit

Permalink
Set the efi boot order after installing RHCOS in UPI/UEFI/PXE scenarios
Browse files Browse the repository at this point in the history
Some servers' firmware push any new detected boot options to the tail of the boot order.
When other boot options are present and bootable, such a server will boot from them instead of the new one.
As a (temporary?) workaround, we manually add the boot option.
NOTE: it's assumed that old OSes boot options are removed from the boot options list during the wipe operations.
 xrefs: https://bugzilla.redhat.com/show_bug.cgi?id=1997805
        coreos/fedora-coreos-tracker#946
        coreos/fedora-coreos-tracker#947
  • Loading branch information
aleskandro committed Feb 23, 2023
1 parent 886b29e commit d0a1b97
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,17 @@ systemd:
--delete-karg console=ttyS0,115200n8 $(join_by_semicolon "${console_kargs}" "--append-karg console=" "") \
--ignition-url ${base_url%%*(/)}/${role}.ign \
--insecure-ignition --copy-network
# Some servers' firmware push any new detected boot options to the tail of the boot order.
# When other boot options are present and bootable, such a server will boot from them instead of the new one.
# As a (temporary?) workaround, we manually add the boot option.
# NOTE: it's assumed that old OSes boot options are removed from the boot options list during the wipe operations.
# xrefs: https://bugzilla.redhat.com/show_bug.cgi?id=1997805
# https://github.com/coreos/fedora-coreos-tracker/issues/946
# https://github.com/coreos/fedora-coreos-tracker/issues/947
ExecStart=/usr/bin/bash -c ' \
ARCH=\$(uname -m | sed "s/x86_64/x64/;s/aarch64/aa64/"); \
/usr/sbin/efibootmgr -c -d "$root_device" -p 2 -c -L "Red Hat CoreOS" -l "\\\\EFI\\\\redhat\\\\shim\$ARCH.efi" \
'
ExecStart=/usr/bin/systemctl --no-block reboot
StandardOutput=kmsg+console
StandardError=kmsg+console
Expand Down

0 comments on commit d0a1b97

Please sign in to comment.