Merge pull request #39 from ClusterLabs/install-target-uefi

* Got UEFI booting working up to the grub menu, though files formerly…
main
digimer-bot 4 years ago committed by GitHub
commit af389a114c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      Anvil/Tools.pm
  2. 39
      html/skins/alteeve/pxe.txt
  3. 3
      share/words.xml
  4. 49
      tools/striker-manage-install-target

@ -1032,6 +1032,7 @@ sub _set_paths
'postgresql.conf' => "/var/lib/pgsql/data/postgresql.conf",
pxe_default => "/var/lib/tftpboot/pxelinux.cfg/default",
pxe_uefi => "/var/lib/tftpboot/pxelinux.cfg/uefi",
pxe_grub => "/var/lib/tftpboot/grub.cfg",
postfix_main => "/etc/postfix/main.cf",
postfix_relay_password => "/etc/postfix/relay_password",
ssh_config => "/etc/ssh/ssh_config",

@ -5,6 +5,13 @@ option domain-name-servers #!variable!dns!#;
authoritative;
ddns-update-style none;
option space pxelinux;
option pxelinux.magic code 208 = string;
option pxelinux.configfile code 209 = text;
option pxelinux.pathprefix code 210 = text;
option pxelinux.reboottime code 211 = unsigned integer 32;
option architecture-type code 93 = unsigned integer 16;
# refer to RFC4758 for possible arch option values
option arch code 93 = unsigned integer 16;
@ -18,7 +25,7 @@ subnet #!variable!network!# netmask 255.255.0.0 {
match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
next-server #!variable!router!#;
if option arch = 00:07 {
filename "BOOTX64.efi";
filename "BOOTX64.efi";
} else {
filename "pxelinux.0";
}
@ -859,6 +866,36 @@ localboot 0xffff
<!-- end tftp_bios -->
<!-- start tftp_grub -->
set default="1"
function load_video {
insmod efi_gop
insmod efi_uga
insmod video_bochs
insmod video_cirrus
insmod all_video
}
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2
set timeout=60
### END /etc/grub.d/00_header ###
search --no-floppy --set=root -l 'RHEL-8-3-0-BaseOS-x86_64'
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Install #!variable!say_os!# 8' --class fedora --class gnu-linux --class gnu --class os {
linuxefi /images/#!data!host_os::os_type!#/vmlinuz ip=dhcp inst.repo=#!variable!base_url!#/os/
initrdefi /images/#!data!host_os::os_type!#/initrd.img
}
<!-- end tftp_grub -->
<!-- start tftp_uefi -->
function load_video {
insmod efi_gop

@ -21,6 +21,9 @@ Author: Madison Kelly <mkelly@alteeve.ca>
<key name="brand_0007">Node</key>
<key name="brand_0008">DR Host</key>
<key name="brand_0009">Unknown Type</key>
<key name="brand_0010">Red Hat Enterprise Linux</key>
<key name="brand_0011">CentOS Linux</key>
<key name="brand_0012">CentOS Stream Linux</key>
<!-- Emails messages -->
<key name="email_0001">[ #!string!brand_0004!# ] - Critical level alert from #!variable!host_name!#</key>

@ -572,44 +572,59 @@ sub setup_boot_environment
update_progress($anvil, 100, "error_0043,!!file!".$anvil->data->{path}{configs}{pxe_default}."!!");
$anvil->nice_exit({exit_code => 3});
}
elsif ($dhcpd_conf_success eq "1")
elsif ($bios_default_success eq "1")
{
# Updated
print $anvil->Words->string({key => "message_0097", variables => { file => $anvil->data->{path}{configs}{pxe_default} }})."\n";
}
elsif ($dhcpd_conf_success eq "2")
elsif ($bios_default_success eq "2")
{
# Update not needed.
print $anvil->Words->string({key => "message_0096", variables => { file => $anvil->data->{path}{configs}{pxe_default} }})."\n";
}
### PXE UEFI 'uefi' file.
my $uefi_default_body = $anvil->Template->get({file => "pxe.txt", show_name => 0, name => "tftp_uefi", variables => { base_url => $base_url }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { uefi_default_body => $uefi_default_body }});
### PXE UEFI 'grub.cfg' file.
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { "host_os::os_type" => $anvil->data->{host_os}{os_type} }});
my $say_os = "#!string!brand_0010!#";
if ($anvil->data->{host_os}{os_type} eq "centos8")
{
$say_os = "#!string!brand_0011!#";
}
elsif ($anvil->data->{host_os}{os_type} eq "centos-stream8")
{
$say_os = "#!string!brand_0012!#";
}
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { say_os => $say_os }});
my $uefi_grub_body = $anvil->Template->get({file => "pxe.txt", show_name => 0, name => "tftp_grub", variables => {
base_url => $base_url,
say_os => $say_os,
}});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { uefi_grub_body => $uefi_grub_body }});
# Return code if '1' means the file was changed, '2' indicates it didn't change. '0' means something
# went wrong.
my $uefi_default_success = $anvil->Storage->update_file({
body => $uefi_default_body,
file => $anvil->data->{path}{configs}{pxe_uefi},
my $uefi_grub_success = $anvil->Storage->update_file({
body => $uefi_grub_body,
file => $anvil->data->{path}{configs}{pxe_grub},
});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { uefi_default_success => $uefi_default_success }});
if (not $uefi_default_success)
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { uefi_grub_success => $uefi_grub_success }});
if (not $uefi_grub_success)
{
# Failed.
print $anvil->Words->string({key => "error_0043", variables => { file => $anvil->data->{path}{configs}{pxe_uefi} }})."\n";
update_progress($anvil, 100, "error_0043,!!file!".$anvil->data->{path}{configs}{pxe_uefi}."!!");
print $anvil->Words->string({key => "error_0043", variables => { file => $anvil->data->{path}{configs}{pxe_grub} }})."\n";
update_progress($anvil, 100, "error_0043,!!file!".$anvil->data->{path}{configs}{pxe_grub}."!!");
$anvil->nice_exit({exit_code => 3});
}
elsif ($dhcpd_conf_success eq "1")
elsif ($uefi_grub_success eq "1")
{
# Updated
print $anvil->Words->string({key => "message_0097", variables => { file => $anvil->data->{path}{configs}{pxe_uefi} }})."\n";
print $anvil->Words->string({key => "message_0097", variables => { file => $anvil->data->{path}{configs}{pxe_grub} }})."\n";
}
elsif ($dhcpd_conf_success eq "2")
elsif ($uefi_grub_success eq "2")
{
# Update not needed.
print $anvil->Words->string({key => "message_0096", variables => { file => $anvil->data->{path}{configs}{pxe_uefi} }})."\n";
print $anvil->Words->string({key => "message_0096", variables => { file => $anvil->data->{path}{configs}{pxe_grub} }})."\n";
}
### TODO: Add repos for all known strikers
@ -1615,6 +1630,7 @@ sub load_packages
"e2fsprogs-libs.x86_64",
"e2fsprogs.x86_64",
"edk2-ovmf.noarch",
"efi-filesystem.noarch",
"efi-srpm-macros.noarch",
"elfutils.x86_64",
"elfutils-default-yama-scope.noarch",
@ -1756,6 +1772,7 @@ sub load_packages
"grilo.x86_64",
"groff-base.x86_64",
"grub2-common.noarch",
"grub2-efi-x64.x86_64",
"grub2-pc-modules.noarch",
"grub2-pc.x86_64",
"grub2-tools-extra.x86_64",

Loading…
Cancel
Save