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

Install target uefi
main
digimer-bot 4 years ago committed by GitHub
commit 604bbc636e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      Anvil/Tools/Get.pm
  2. 2
      Anvil/Tools/Striker.pm
  3. 1
      anvil.spec.in
  4. 10
      html/skins/alteeve/pxe.txt
  5. 2
      share/words.xml
  6. 110
      tools/striker-manage-install-target

@ -1827,7 +1827,12 @@ sub os_type
$os_type = "rhel".$1;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { os_type => $os_type }});
}
elsif ($release =~ /CentOS .*? (\d+)\.?/)
elsif ($release =~ /CentOS Stream .*? (\d+)/)
{
$os_type = "centos-stream".$1;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { os_type => $os_type }});
}
elsif ($release =~ /CentOS .*? (\d+)\./)
{
# CentOS, with the major version number appended
$os_type = "centos".$1;

@ -544,7 +544,7 @@ sub get_local_repo
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { base_url => $base_url }});
### NOTE: The 'module_hotfixes=1' is needed until we can figure out how to add libssh2 to
### 'modules.yaml' (from anvil-striker-extra, in turn from the RHEL 8.x repodata). See:
### 'modules.yaml' (from the RHEL 8.x repodata). See:
### - https://docs.fedoraproject.org/en-US/modularity/making-modules/defining-modules/
### - https://docs.fedoraproject.org/en-US/modularity/hosting-modules/
# Create the local repo file body

@ -116,7 +116,6 @@ Common base libraries required for the Anvil! system.
%package striker
Summary: Alteeve's Anvil! Striker dashboard package
Requires: anvil-core == %{version}-%{release}
Requires: anvil-striker-extra
Requires: bpg-dejavu-sans-fonts
Requires: createrepo
Requires: dejavu-fonts-common

@ -13,13 +13,17 @@ subnet #!variable!network!# netmask 255.255.0.0 {
max-lease-time 1200;
range #!variable!range!#;
option routers #!variable!router!#;
next-server #!variable!router!#;
if option arch = 00:07 {
filename "uefi/shim.efi";
class "pxeclients" {
match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
next-server 192.168.0.1;
if option pxe-system-type = 00:07 {
filename "BOOTX64.efi";
} else {
filename "pxelinux.0";
}
next-server #!variable!router!#;
}
}
<!-- end dhcpd_conf -->

@ -1545,7 +1545,7 @@ NOTE: Please be patient!
<key name="message_0116">#!string!brand_0002!# Node</key>
<key name="message_0117">Disaster Recovery (DR) Host</key>
<key name="message_0118">Regenerating the source repository metadata.</key>
<key name="message_0119">[ Error ] - The comps.xml file: [#!variable!comps_xml!#] was not found. This provides package group information required for Install Target guests. Is the 'anvil-striker-extra' package installed?</key>
<key name="message_0119">[ Error ] - The comps.xml file: [#!variable!comps_xml!#] was not found. This provides package group information required for Install Target guests.</key>
<key name="message_0120">
About to try to download aproximately: [#!variable!packages!#] packages needed to:
- [#!variable!directory!#].

@ -19,7 +19,7 @@
# 3 = Failed to write or update a configuration file.
# 4 = Not a striker dashboard (or isn't yet).
# 5 = Not running as the 'root' user.
# 6 = The 'comps,xml' file provided by anvil-striker-extra was not found.
# 6 = The 'comps,xml' file was not found.
# 7 = A package failed to download to our repo
# 8 = No database connection available.
# 9 = The system isn't configured yet.
@ -275,6 +275,10 @@ sub load_os_info
{
$anvil->data->{host_os}{os_name} = "RHEL ".$anvil->data->{host_os}{version};
}
elsif ($os_type =~ /^centos-stream/)
{
$anvil->data->{host_os}{os_name} = "CentOS Stream ".$anvil->data->{host_os}{version};
}
elsif ($os_type =~ /^centos/)
{
$anvil->data->{host_os}{os_name} = "CentOS ".$anvil->data->{host_os}{version};
@ -446,11 +450,6 @@ sub setup_boot_environment
{
my ($anvil) = @_;
### TODO: We don't yet support UEFI, though we will need to soon. Note that the 'shim.efi' and
### 'grubx64.efi' files should be added to 'anvil-striker-extras'. We'll also need to create
### '/var/lib/tftpboot/pxelinux/uefi' as well.
### We;re going to need the '.treeinfo' as well in anvil-striker-extra
### - https://docs.fedoraproject.org/en-US/fedora/f28/install-guide/advanced/Network_based_Installations/
# Get my BCN IP and active OS.
$anvil->Network->get_ips();
my $bcn_interface = "";
@ -1061,7 +1060,7 @@ sub update_install_source
}
$packages =~ s/ $//;
$shell_call .= " ".$packages."; 2>&1 ".$anvil->data->{path}{exe}{'echo'}." return_code:\$?";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { shell_call => $shell_call }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { shell_call => $shell_call }});
# Now call the command in the background, then we'll track the output.
my $stdout_file = "/tmp/".$THIS_FILE."_update_install_source.stdout";
@ -1070,7 +1069,7 @@ sub update_install_source
unlink $stdout_file;
}
my ($handle, undef) = $anvil->System->call({
debug => 2,
debug => 3,
shell_call => $shell_call,
background => 1,
stdout_file => $stdout_file,
@ -1476,7 +1475,6 @@ sub load_packages
"anvil-core.noarch",
"anvil-dr.noarch",
"anvil-node.noarch",
"anvil-striker-extra.noarch",
"anvil-striker.noarch",
"apr-util-bdb.x86_64",
"apr-util-openssl.x86_64",
@ -1539,7 +1537,6 @@ sub load_packages
"clutter-gtk.x86_64",
"clutter.x86_64",
"cockpit-bridge.x86_64",
"cockpit-dashboard.noarch",
"cockpit-machines.noarch",
"cockpit-packagekit.noarch",
"cockpit-system.noarch",
@ -2725,14 +2722,28 @@ sub load_packages
my ($os_type, $os_arch) = $anvil->Get->os_type();
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
os_type => $os_type,
os_arch => $os_arch,
}});
if ($os_type eq "rhel8")
{
push @{$anvil->data->{packages}{c}}, "cockpit-dashboard.noarch";
push @{$anvil->data->{packages}{r}}, "redhat-backgrounds.noarch";
push @{$anvil->data->{packages}{r}}, "redhat-indexhtml.noarch";
push @{$anvil->data->{packages}{r}}, "redhat-logos-httpd.noarch";
push @{$anvil->data->{packages}{r}}, "redhat-logos.x86_64";
push @{$anvil->data->{packages}{r}}, "redhat-release.x86_64";
}
elsif ($os_type eq "centos-stream8")
{
push @{$anvil->data->{packages}{c}}, "centos-backgrounds.noarch";
push @{$anvil->data->{packages}{c}}, "centos-gpg-keys.noarch";
push @{$anvil->data->{packages}{c}}, "centos-indexhtml.noarch";
push @{$anvil->data->{packages}{c}}, "centos-logos-httpd.noarch";
push @{$anvil->data->{packages}{c}}, "centos-logos.x86_64";
push @{$anvil->data->{packages}{c}}, "centos-stream-release.noarch";
}
elsif ($os_type eq "centos8")
{
push @{$anvil->data->{packages}{c}}, "centos-backgrounds.noarch";
@ -2741,38 +2752,89 @@ sub load_packages
push @{$anvil->data->{packages}{c}}, "centos-logos-httpd.noarch";
push @{$anvil->data->{packages}{c}}, "centos-logos.x86_64";
push @{$anvil->data->{packages}{c}}, "centos-linux-release.noarch";
push @{$anvil->data->{packages}{c}}, "cockpit-dashboard.noarch";
}
# While we're here, we will need to rename /var/www/html/rhel8 to /var/www/html/rhel8, as
# 'centos8' and '/var/lib/tftpboot/rhel8' as 'centos8', as is used by anvil-striker-extra.
foreach my $directory ("html", "tftpboot")
# Now see if the base OS has changed and, if so, rename directories
my $rhel8_test_source = $anvil->data->{path}{directories}{html}."/rhel8";
my $centos8_test_source = $anvil->data->{path}{directories}{html}."/centos8";
my $centos_stream8_test_source = $anvil->data->{path}{directories}{html}."/centos-stream8";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
rhel8_test_source => $rhel8_test_source,
centos8_test_source => $centos8_test_source,
centos_stream8_test_source => $centos_stream8_test_source,
}});
my $source = "";
my $target = "";
if ((-e $rhel8_test_source) && ($os_type ne "rhel8"))
{
my $source = $anvil->data->{path}{directories}{$directory}."/rhel8";
my $target = $anvil->data->{path}{directories}{$directory}."/centos8";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => {
directory => $directory,
# This isn't RHEL 8, we need to rename the directories
$source = "rhel8";
$target = $os_type;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
source => $source,
target => $target,
}});
}
elsif ((-e $centos8_test_source) && ($os_type ne "centos8"))
{
# This isn't CentOS 8, we need to rename the directories
$source = "centos8";
$target = $os_type;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
source => $source,
target => $target,
}});
}
elsif ((-e $centos_stream8_test_source) && ($os_type ne "centos-stream8"))
{
# This isn't CentOS Stream 8, rename the directories
$source = "centos-stream8";
$target = $os_type;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
source => $source,
target => $target,
}});
}
# If 'source' is set, we need to rename.
if ($source)
{
# While we're here, we will need to rename /var/www/html/rhel8 to /var/www/html/centos8, as
# 'centos8' and '/var/lib/tftpboot/rhel8' as 'centos8'.
foreach my $directory ("html", "tftpboot")
{
my $source_directory = $anvil->data->{path}{directories}{$directory}."/".$source;
my $target_directory = $anvil->data->{path}{directories}{$directory}."/".$target;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
source_directory => $source_directory,
target_directory => $target_directory,
}});
if ((-e $anvil->data->{path}{directories}{$directory}."/rhel8") && (not -e $anvil->data->{path}{directories}{$directory}."/centos8"))
# We check to see if the target directory already exists. If it does, the user may be
# supporting multiple distros and we don't want to clobber that
if ((-e $source_directory) && (not -e $target_directory))
{
my $shell_call = $anvil->data->{path}{exe}{mv}." ".$source." ".$target;
my $shell_call = $anvil->data->{path}{exe}{mv}." ".$source_directory." ".$target_directory;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { shell_call => $shell_call }});
my ($handle, $return_code) = $anvil->System->call({debug => 2, shell_call => $shell_call});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { handle => $handle, return_code => $return_code }});
if (-e $anvil->data->{path}{directories}{$directory}."/centos8")
if (-e $target_directory)
{
# Success!
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, secure => 0, key => "log_0475", variables => {
source => $source,
target => $target,
source => $source_directory,
target => $target_directory,
}});
}
else
{
# Failed :(
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 0, key => "error_0116", variables => {
source => $source,
target => $target,
source => $source_directory,
target => $target_directory,
}});
$anvil->nice_exit({exit_code => 12});
}

Loading…
Cancel
Save