Project

General

Profile

Feature #12635

Options to deploy Grub and PXELinux EFI loaders in TFTP root

Added by Lukas Zapletal almost 5 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Category:
Foreman modules
Target version:
Difficulty:
Triaged:
Bugzilla link:

Description

It looks like Grub2 is the best and most compatible way of PXE booting EFI hardware and it is available in most Linux distributions. It makes sense to provide support in our Puppet classes and installer to deploy these.

Puppet changes as follows:

if RHEL6 or Fedora 18 or older is found then
install grub package
create /var/lib/tftproot/grub/
copy /boot/efi/EFI/*/grub.efi to /var/lib/tftproot/grub/grubx64.efi
create a relative symlink shim.efi to /var/lib/tftproot/grub/grubx64.efi
ensure correct file permissions and SELinux context

if RHEL7 or Fedora 19 or newer is found then
install packages: grub2-efi grub2-efi-modules grub2-tools shim
create /var/lib/tftproot/grub2/
copy /boot/efi/EFI/*/shim.efi to /var/lib/tftproot/grub2/shim.efi
build grub2 with all modules with: grub2-mkimage -O x86_64-efi -d /usr/lib/grub/x86_64-efi -o /var/lib/tftproot/grub2/grubx64.efi -p "" `find /usr/lib/grub/x86_64-efi/*.mod -printf "%f " | sed -e 's/\.mod//g'` (X)
ensure correct file permissions and SELinux context

if Debian or Ubuntu is found then
install packages: grub-common grub-efi-amd64-bin
create /var/lib/tftproot/grub2/
build grub2 with all modules with: grub-mkimage -O x86_64-efi -d /usr/lib/grub/x86_64-efi -o /var/lib/tftproot/grub2/grubx64.efi -p "" `find /usr/lib/grub/x86_64-efi/*.mod -printf "%f " | sed -e 's/\.mod//g'` (X)
create a relative symlink shim.efi to /var/lib/tftproot/grub/grubx64.efi
ensure correct file permissions

I have only tested this with latest LTS Ubuntu and Debian Jessie (8)

(X) - this command could be extracted to a helper script


Related issues

Related to Foreman - Tracker #431: [TRACKER] UEFI PXE supportResolved

Related to Installer - Feature #14920: Change dhcpd.conf to support EFI loadersClosed2016-05-04
Related to Katello - Bug #16820: Upgrading Katello 3.1 to 3.2 Error with /usr/bin/grub2-mkimageDuplicate2016-10-06
Related to Installer - Bug #16705: grubx64.efi fails to boot with Secure BootClosed2016-09-27

Associated revisions

Revision 78e5b783 (diff)
Added by Lukas Zapletal about 4 years ago

Refs #12635 - added migration for new grub tftp dirs (#197)

History

#1 Updated by Lukas Zapletal almost 5 years ago

  • Tracker changed from Bug to Feature

#2 Updated by Lukas Zapletal almost 5 years ago

#3 Updated by Lukas Zapletal almost 5 years ago

Also we can prepare configuration for POWERPC nodes:

http://jk.ozlabs.org/blog/post/158/netbooting-petitboot/?cm_mc_uid=91489629740814486170120&cm_mc_sid_50200000=1448888937

The only issue is Grub2-ppc binary, that will never be available on x86 distros, we can leave a comment that this will only work if smart-proxy is running on POWER PC as well.

#4 Updated by Lukas Zapletal over 4 years ago

  • Subject changed from Dual PXELinux/Grub2 DHCP configuration with EFI firmware to Options to deploy Grub and PXELinux EFI loaders in TFTP root
  • Description updated (diff)

#5 Updated by Lukas Zapletal over 4 years ago

Expected file paths are defined in the table at http://projects.theforeman.org/projects/foreman/wiki/PXE_Booting_UEFI

#6 Updated by Lukas Zapletal over 4 years ago

  • Related to Feature #14920: Change dhcpd.conf to support EFI loaders added

#7 Updated by Lukas Zapletal over 4 years ago

UEFI shim shall be installed if possible.

#8 Updated by Lukas Zapletal over 4 years ago

Deleted (moved to description).

#10 Updated by Lukas Zapletal about 4 years ago

  • Description updated (diff)

Added missing shim package

#11 Updated by Lukas Zapletal about 4 years ago

  • Description updated (diff)

Removed grubx64s.efi copy, not really necessary.

#12 Updated by The Foreman Bot about 4 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Lukas Zapletal
  • Pull request https://github.com/theforeman/foreman-installer/pull/197 added

#13 Updated by Daniel Lobato Garcia about 4 years ago

  • Target version set to 1.6.2

#14 Updated by Dominic Cleal about 4 years ago

  • Status changed from Ready For Testing to Closed
  • Legacy Backlogs Release (now unused) set to 160
  • Pull request https://github.com/theforeman/puppet-foreman_proxy/pull/276 added

#15 Updated by Anonymous about 4 years ago

  • Related to Bug #16820: Upgrading Katello 3.1 to 3.2 Error with /usr/bin/grub2-mkimage added

#16 Updated by Lukas Zapletal about 4 years ago

  • Related to Bug #16705: grubx64.efi fails to boot with Secure Boot added

Also available in: Atom PDF