Skip to content
This repository has been archived by the owner on Jul 9, 2020. It is now read-only.

Fixes #29952 - make Grub2 template bootdisk-efi compatible #738

Merged
merged 1 commit into from
Jun 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 19 additions & 6 deletions provisioning_templates/PXEGrub2/kickstart_default_pxegrub2.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,31 @@ oses:
end
-%>

set default=0
set default=<%= host_param('default_grub_install_entry') || 0 %>
set timeout=<%= host_param('loader_timeout') || 10 %>

menuentry '<%= template_name %>' {
<%= linuxcmd %> <%= @kernel %> ks=<%= foreman_url('provision') %> <%= pxe_kernel_options %> <%= snippet("kickstart_kernel_options").strip %> BOOTIF=01-$net_default_mac
adamruzicka marked this conversation as resolved.
Show resolved Hide resolved
<%= linuxcmd %> <%= @kernel %> ks=<%= foreman_url('provision') %> <%= pxe_kernel_options %> <%= snippet("kickstart_kernel_options").strip %>
<%= initrdcmd %> <%= @initrd %>
}

# Workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1811561
menuentry '<%= template_name %> HTTP Boot' {
<%= linuxcmd %> /httpboot/<%= @kernel %> ks=<%= foreman_url('provision') %> <%= pxe_kernel_options %> <%= snippet("kickstart_kernel_options").strip %> BOOTIF=01-$net_default_mac
<%= initrdcmd %> /httpboot/<%= @initrd %>
<%
# Workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1811561 and https://bugzilla.redhat.com/show_bug.cgi?id=1842893
if @host.provision_interface.subnet.httpboot
proxy_http_port = @host.provision_interface.subnet.httpboot.httpboot_http_port
proxy_https_port = @host.provision_interface.subnet.httpboot.httpboot_https_port
# Workaround for "no DNS server configured" https://bugzilla.redhat.com/show_bug.cgi?id=1842509
proxy_host = dns_lookup(@host.provision_interface.subnet.httpboot.hostname)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like grub is not able to initialize DNS or parsing of hostname with port (satellite:8000) does not resolve correctly. This hack does allow the workflow, without it it would not be possible. I suggest to go with this and we can remove it later once the BZ is fixed. https://bugzilla.redhat.com/show_bug.cgi?id=1842509

-%>
menuentry '<%= template_name %> EFI HTTP' --id efi_http {
<%= linuxcmd %> (http,<%= proxy_host %>:<%= proxy_http_port %>)/httpboot/<%= @kernel %> ks=<%= foreman_url('provision') %> <%= pxe_kernel_options %> <%= snippet("kickstart_kernel_options").strip %>
<%= initrdcmd %> (http,<%= proxy_host %>:<%= proxy_http_port %>)/httpboot/<%= @initrd %>
}

menuentry '<%= template_name %> EFI HTTPS' --id efi_https {
<%= linuxcmd %> (https,<%= proxy_host %>:<%= proxy_https_port %>)/httpboot/<%= @kernel %> ks=<%= foreman_url('provision') %> <%= pxe_kernel_options %> <%= snippet("kickstart_kernel_options").strip %>
<%= initrdcmd %> (https,<%= proxy_host %>:<%= proxy_https_port %>)/httpboot/<%= @initrd %>
}
<% end %>

<%= snippet_if_exists(template_name + " custom menu") %>
10 changes: 0 additions & 10 deletions provisioning_templates/snippet/pxegrub2_discovery.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,9 @@ if [ ${grub_platform} == "pc" ]; then
linux boot/fdi-image/vmlinuz0 ${common}
initrd boot/fdi-image/initrd0.img
}
# HTTP Boot workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1811561
menuentry 'Foreman Discovery Image HTTP' --id discovery_http {
linux /EFI/BOOT/boot/fdi-image/vmlinuz0 ${common}
initrd /EFI/BOOT/boot/fdi-image/initrd0.img
}
else
menuentry 'Foreman Discovery Image EFI' --id discovery {
linuxefi boot/fdi-image/vmlinuz0 ${common}
initrdefi boot/fdi-image/initrd0.img
}
# HTTP Boot workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1811561
menuentry 'Foreman Discovery Image EFI HTTP' --id discovery_http {
linuxefi /EFI/BOOT/boot/fdi-image/vmlinuz0 ${common}
initrdefi /EFI/BOOT/boot/fdi-image/initrd0.img
}
fi