Skip to content

Commit

Permalink
Fixes #29952 - prevent when mac is present (theforeman#738)
Browse files Browse the repository at this point in the history
(cherry picked from commit 055f497)
  • Loading branch information
lzap committed Jun 5, 2020
1 parent 986c8bb commit 8162407
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
25 changes: 19 additions & 6 deletions provisioning_templates/PXEGrub2/kickstart_default_pxegrub2.erb
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
<%= 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)
-%>
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
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

0 comments on commit 8162407

Please sign in to comment.