* Fixed a bug where anvil-manage-install-target was always refreshing the local RPM repository instead on doing so only once per day.

* Finished getting proper storage management and software RAID support added to plan_partition.

Signed-off-by: Digimer <digimer@alteeve.ca>
main
Digimer 6 years ago
parent 9cf70f847c
commit 67e8f26bdb
  1. 39
      html/skins/alteeve/pxe.txt
  2. 14
      notes
  3. 24
      scripts/plan_partitions
  4. 2
      share/words.xml
  5. 8
      tools/anvil-manage-install-target

@ -44,7 +44,7 @@ eula --agreed
firstboot --disable firstboot --disable
# Reboot when the install is done. # Reboot when the install is done.
#reboot reboot
# Install from the source Striker # Install from the source Striker
url --url=#!variable!url!# url --url=#!variable!url!#
@ -117,6 +117,8 @@ rsync -av /var/log /mnt/sysimage/root/install_logs/var/
### NOTE: This must be copied from 'scripts/plan_partitions', don't edit directly *EXCEPT* to set the '$type' ### NOTE: This must be copied from 'scripts/plan_partitions', don't edit directly *EXCEPT* to set the '$type'
### just below, which *MUST* be set, or the script will fail. ### just below, which *MUST* be set, or the script will fail.
# - #!variable!debug!#
# - #!variable!type!#
%pre --interpreter /bin/perl %pre --interpreter /bin/perl
#!/bin/perl #!/bin/perl
# #
@ -448,7 +450,7 @@ print __LINE__."; Assigning: [".hr_size($swap_size * (2**20))." (".$swap_size."
# Build the partition file. # Build the partition file.
my $partition_file = "/tmp/plan_partitions.out"; my $partition_file = "/tmp/plan_partitions.out";
my $partition_body = " my $partition_body = "zerombr
clearpart --all --drives=".$say_use_drive." clearpart --all --drives=".$say_use_drive."
ignoredisk --only-use=".$say_use_drive." ignoredisk --only-use=".$say_use_drive."
bootloader --location=mbr --driveorder=".$say_use_drive." --boot-drive=".$use_drive; bootloader --location=mbr --driveorder=".$say_use_drive." --boot-drive=".$use_drive;
@ -466,11 +468,20 @@ volgroup ".$vg_name." --pesize=4096 pv.01
# LVM logical volumes # LVM logical volumes
logvol swap --fstype=swap --size=".$swap_size." --name=lv_swap --vgname=".$vg_name." logvol swap --fstype=swap --size=".$swap_size." --name=lv_swap --vgname=".$vg_name."
logvol / --fstype=xfs --size=".$root_size." --name=lv_root --vgname=".$vg_name." logvol / --fstype=xfs --size=100 --grow --maxsize=".$root_size." --name=lv_root --vgname=".$vg_name."
"; ";
} }
else else
{ {
$partition_body .= "
# biosboot
";
for (my $i = 0; $i < $count; $i++)
{
$partition_body .= "part biosboot --fstype=biosboot --size=2 --ondisk=".$drives->{by_hr_size}{$hr_size}->[$i]."\n";
}
$partition_body .= " $partition_body .= "
# LVM PV # LVM PV
"; ";
@ -488,13 +499,13 @@ volgroup ".$vg_name." pv.01
# LVM logical volumes # LVM logical volumes
logvol swap --fstype=swap --size=".$swap_size." --name=lv_swap --vgname=".$vg_name." logvol swap --fstype=swap --size=".$swap_size." --name=lv_swap --vgname=".$vg_name."
logvol / --fstype=xfs --size=".$root_size." --name=lv_root --vgname=".$vg_name." logvol / --fstype=xfs --size=100 --grow --maxsize=".$root_size." --name=lv_root --vgname=".$vg_name."
"; ";
} }
=cut
# Wipe out the start of each disk and make it a GPT labelled disk. # Wipe out the start of each disk so that the install doesn't puke if it sees, for example, an mdadm
# See: https://access.redhat.com/solutions/55652 # signature on the sole disk being used as an install target.
foreach my $path (split/,/, $say_use_drive) foreach my $path (split/,/, $say_use_drive)
{ {
print "[ NOTE ] - Wiping the boot sector of: [".$path."] and configuring it for a GPT label.\n"; print "[ NOTE ] - Wiping the boot sector of: [".$path."] and configuring it for a GPT label.\n";
@ -502,16 +513,6 @@ foreach my $path (split/,/, $say_use_drive)
print __LINE__."; [ Debug ] - dd output: print __LINE__."; [ Debug ] - dd output:
================================================================================ ================================================================================
".$dd_out." ".$dd_out."
================================================================================\n" if $debug;
my $parted_out1 = system_call("/sbin/parted --script ".$path." mklabel gpt");
print __LINE__."; [ Debug ] - parted mklabel output
================================================================================
".$parted_out1."
================================================================================\n" if $debug;
my $parted_out2 = system_call("/sbin/parted --script ".$path." print free");
print __LINE__."; [ Debug ] - parted print output showing new layout.
================================================================================
".$parted_out2."
================================================================================\n" if $debug; ================================================================================\n" if $debug;
my $partprobe_out = system_call("/sbin/partprobe --summary ".$path); my $partprobe_out = system_call("/sbin/partprobe --summary ".$path);
print __LINE__."; [ Debug ] - partprobe summary. print __LINE__."; [ Debug ] - partprobe summary.
@ -526,9 +527,9 @@ foreach my $path (split/,/, $say_use_drive)
} }
# Flush things out. The article says to blindly sleep 30, but it says to do so to make sure udev, partx and # Flush things out. The article says to blindly sleep 30, but it says to do so to make sure udev, partx and
# others have updated. We're forcing the issue, which should be faster and safer. # others have updated. We're forcing the issue, which should be faster and safer.
system_call("/sbin/udevadm settle");
system_call("/bin/sync"); system_call("/bin/sync");
=cut system_call("/sbin/udevadm settle");
# Write out the file. # Write out the file.
print __LINE__."; [ Debug ] - partition_body: print __LINE__."; [ Debug ] - partition_body:

14
notes

@ -1,5 +1,19 @@
NEXT; - NEXT; -
==] UEFI Setup [======================================================================
ignoredisk --only-use=vdb,vda
clearpart --none --initlabel
part raid.312 --fstype="mdmember" --ondisk=vda --size=19966
part raid.293 --fstype="mdmember" --ondisk=vdb --size=512
part raid.319 --fstype="mdmember" --ondisk=vdb --size=19966
part raid.286 --fstype="mdmember" --ondisk=vda --size=512
raid pv.326 --device=pv1 --fstype="lvmpv" --level=RAID1 raid.312 raid.319
raid /boot/efi --device=efi --fstype="efi" --level=RAID1 --fsoptions="umask=0077,shortname=winnt" --label=efi raid.286 raid.293
volgroup striker_vg0 --pesize=4096 pv.326
logvol swap --fstype="swap" --size=4096 --name=lv_swap --vgname=striker_vg0
logvol / --fstype="xfs" --size=15852 --label="lv_root" --name=lv_root --vgname=striker_vg0
======================================================================================
DOCS; - DOCS; -
- Explanation of 'comps.xml' (package grouping) - https://pagure.io/fedora-comps - Explanation of 'comps.xml' (package grouping) - https://pagure.io/fedora-comps

@ -346,7 +346,7 @@ volgroup ".$vg_name." --pesize=4096 pv.01
# LVM logical volumes # LVM logical volumes
logvol swap --fstype=swap --size=".$swap_size." --name=lv_swap --vgname=".$vg_name." logvol swap --fstype=swap --size=".$swap_size." --name=lv_swap --vgname=".$vg_name."
logvol / --fstype=xfs --size=".$root_size." --name=lv_root --vgname=".$vg_name." logvol / --fstype=xfs --size=100 --grow --maxsize=".$root_size." --name=lv_root --vgname=".$vg_name."
"; ";
} }
else else
@ -377,13 +377,13 @@ volgroup ".$vg_name." pv.01
# LVM logical volumes # LVM logical volumes
logvol swap --fstype=swap --size=".$swap_size." --name=lv_swap --vgname=".$vg_name." logvol swap --fstype=swap --size=".$swap_size." --name=lv_swap --vgname=".$vg_name."
logvol / --fstype=xfs --size=".$root_size." --name=lv_root --vgname=".$vg_name." logvol / --fstype=xfs --size=100 --grow --maxsize=".$root_size." --name=lv_root --vgname=".$vg_name."
"; ";
} }
=cut ### NOTE: This shouldn't be needed... See: https://bugzilla.redhat.com/show_bug.cgi?id=1654902
# Wipe out the start of each disk and make it a GPT labelled disk. # Wipe out the start of each disk so that the install doesn't puke if it sees, for example, an mdadm
# See: https://access.redhat.com/solutions/55652 # signature on the sole disk being used as an install target.
foreach my $path (split/,/, $say_use_drive) foreach my $path (split/,/, $say_use_drive)
{ {
print "[ NOTE ] - Wiping the boot sector of: [".$path."] and configuring it for a GPT label.\n"; print "[ NOTE ] - Wiping the boot sector of: [".$path."] and configuring it for a GPT label.\n";
@ -391,16 +391,6 @@ foreach my $path (split/,/, $say_use_drive)
print __LINE__."; [ Debug ] - dd output: print __LINE__."; [ Debug ] - dd output:
================================================================================ ================================================================================
".$dd_out." ".$dd_out."
================================================================================\n" if $debug;
my $parted_out1 = system_call("/sbin/parted --script ".$path." mklabel gpt");
print __LINE__."; [ Debug ] - parted mklabel output
================================================================================
".$parted_out1."
================================================================================\n" if $debug;
my $parted_out2 = system_call("/sbin/parted --script ".$path." print free");
print __LINE__."; [ Debug ] - parted print output showing new layout.
================================================================================
".$parted_out2."
================================================================================\n" if $debug; ================================================================================\n" if $debug;
my $partprobe_out = system_call("/sbin/partprobe --summary ".$path); my $partprobe_out = system_call("/sbin/partprobe --summary ".$path);
print __LINE__."; [ Debug ] - partprobe summary. print __LINE__."; [ Debug ] - partprobe summary.
@ -415,9 +405,9 @@ foreach my $path (split/,/, $say_use_drive)
} }
# Flush things out. The article says to blindly sleep 30, but it says to do so to make sure udev, partx and # Flush things out. The article says to blindly sleep 30, but it says to do so to make sure udev, partx and
# others have updated. We're forcing the issue, which should be faster and safer. # others have updated. We're forcing the issue, which should be faster and safer.
system_call("/sbin/udevadm settle");
system_call("/bin/sync"); system_call("/bin/sync");
=cut system_call("/sbin/udevadm settle");
# Write out the file. # Write out the file.
print __LINE__."; [ Debug ] - partition_body: print __LINE__."; [ Debug ] - partition_body:

@ -500,7 +500,7 @@ The body of the file: [#!variable!file!#] does not match the new body. The file
<key name="log_0232">The file: [#!variable!file!#] will now be updated.</key> <key name="log_0232">The file: [#!variable!file!#] will now be updated.</key>
<key name="log_0233">There was a problem updating file: [#!variable!file!#], expected the write to return '0' but got: [#!variable!return!#]. Please check the logs for details.</key> <key name="log_0233">There was a problem updating file: [#!variable!file!#], expected the write to return '0' but got: [#!variable!return!#]. Please check the logs for details.</key>
<key name="log_0234">Failed to backup the file: [#!variable!source!#] to: [#!variable!destination!#]. Details may be found in the logs above.</key> <key name="log_0234">Failed to backup the file: [#!variable!source!#] to: [#!variable!destination!#]. Details may be found in the logs above.</key>
<key name="log_0235">Not updating the local repository on this run. Use '#!variable!program!# --refresh' to force a refresh of the local repository.</key> <key name="log_0235">#!free!#</key>
<key name="log_0236">Skipping the RPM repository refresh. The next scheduled refresh will be done in: [#!variable!next_refresh!#] second(s). Use '#!variable!program!# --refresh' to force an immediate refresh.</key> <key name="log_0236">Skipping the RPM repository refresh. The next scheduled refresh will be done in: [#!variable!next_refresh!#] second(s). Use '#!variable!program!# --refresh' to force an immediate refresh.</key>
<!-- Test words. Do NOT change unless you update 't/Words.t' or tests will needlessly fail. --> <!-- Test words. Do NOT change unless you update 't/Words.t' or tests will needlessly fail. -->

@ -174,6 +174,7 @@ if ($anvil->data->{switches}{enable})
} }
# We're done # We're done
print $anvil->Words->string({key => "message_0025"})."\n";
$anvil->nice_exit({exit_code => 0}); $anvil->nice_exit({exit_code => 0});
@ -268,7 +269,7 @@ sub check_refresh
's2:next_scan' => $next_scan, 's2:next_scan' => $next_scan,
's3:difference' => $difference, 's3:difference' => $difference,
}}); }});
if ((not $variable_uuid) or ($unixtime =~ /^\d+/) or ($difference < 0)) if ((not $variable_uuid) or ($unixtime !~ /^\d+/) or ($difference < 0))
{ {
$anvil->data->{switches}{refresh} = 1; $anvil->data->{switches}{refresh} = 1;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { "switches::refresh" => $anvil->data->{switches}{refresh} }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { "switches::refresh" => $anvil->data->{switches}{refresh} }});
@ -277,7 +278,9 @@ sub check_refresh
elsif ($difference > 0) elsif ($difference > 0)
{ {
# Log when the next scan will happen # Log when the next scan will happen
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, key => "log_0236", variables => { next_refresh => $anvil->Convert->add_commas({number => $difference}) }}); my $variables = { next_refresh => $anvil->Convert->add_commas({number => $difference}) };
print $anvil->Words->string({key => "log_0236", variables => $variables})."\n";
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, key => "log_0236", variables => $variables});
} }
# If the refresh fails, we'll update the last unixtime to be 24 hours from now, so that we can try # If the refresh fails, we'll update the last unixtime to be 24 hours from now, so that we can try
@ -746,7 +749,6 @@ sub update_install_source
check_refresh($anvil); check_refresh($anvil);
if (not $anvil->data->{switches}{refresh}) if (not $anvil->data->{switches}{refresh})
{ {
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, secure => 0, key => "log_0235", variables => { program => $THIS_FILE }});
return(0); return(0);
} }

Loading…
Cancel
Save