* Made good progress on the PXE server envrionment PoC (reflected in notes, and the various script and pxe files).

* Finished (for now) scripts/plan_partitions and 'default' BIOS-based PXE menu.
* Striker kickstart script is close to done, save for a permission issue running the %pre script still being debugged.

Signed-off-by: Digimer <digimer@alteeve.ca>
main
Digimer 6 years ago
parent e4f9e5ae09
commit d9a305d81e
  1. 16
      notes
  2. 68
      pxe/tftpboot/pxelinux.cfg/default
  3. BIN
      pxe/tftpboot/splash.jpg
  4. 41
      scripts/plan_partitions

16
notes

@ -99,6 +99,22 @@ subnet 10.1.0.0 netmask 255.255.0.0 {
# NOTE: We DON'T enable DHCP. We'll turn it on as needed. # NOTE: We DON'T enable DHCP. We'll turn it on as needed.
# NOTE: Apache needs to show dot-files! (anaconda looks for .treeinfo)
====
[root@f28-striker01 conf.d]# pwd
/etc/httpd/conf.d
[root@f28-striker01 conf.d]# diff -u autoindex.conf.original autoindex.conf
--- autoindex.conf.original 2018-10-13 03:37:00.084687783 -0400
+++ autoindex.conf 2018-10-13 03:37:41.479635314 -0400
@@ -89,5 +89,6 @@
# IndexIgnore is a set of filenames which directory indexing should ignore
# and not include in the listing. Shell-style wildcarding is permitted.
#
-IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
+#IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
+IndexIgnore *~ *# HEADER* README* RCS CVS *,v *,t
====
systemctl start tftp.socket systemctl start tftp.socket
systemctl enable tftp.socket systemctl enable tftp.socket

@ -1,9 +1,67 @@
# Tradional BIOS based PXE menu
#
# Useful docs;
# - https://anaconda-installer.readthedocs.io/en/latest/boot-options.html
# - https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/installation_guide/chap-anaconda-boot-options
#
# Notes:
# - Use the 'vmlinuz' and 'initrd.img' from the Netinstall ISO. The others don't find the NIC, so can't net install.
#
# Use the high-colour menu system.
default vesamenu.c32 default vesamenu.c32
prompt 1
timeout 600
label linux # Time out and use the default menu option. Defined as tenths of a second.
menu label ^Install Anvil! M3 - Striker TIMEOUT 600
# Prompt the user. Set to '1' to automatically choose the default option. This
# is really meant for files matched to MAC addresses.
PROMPT 0
# Set the boot menu to be 1024x768 with a nice background image. Be careful to
# ensure that all your user's can see this resolution! Default is 640x480.
MENU RESOLUTION 1024 768
# The background image
MENU BACKGROUND splash.jpg
MENU TITLE Anvil! - Install Target Menu
# Below, the hash (#) character is replaced with the countdown timer. The
# '{,s}' allows for pluralizing a word and is used when the value is >= '2'.
MENU AUTOBOOT Will boot the next device as configured in your BIOS in # second{,s}.
MENU TABMSG Press the <tab> key to edit the boot parameters of the highlighted option.
MENU NOTABMSG Editing of this option is disabled.
# inst.repo is the image of the install media, looks for .treeinfo
label fedora
menu label Install ^Fedora 28 64-bit
kernel fedora28/vmlinuz
append initrd=fedora28/initrd.img root=live:http://10.1.4.1/fedora28/x86_64/os/images/install.img
label striker
menu label Install a ^Striker dashboard (Fedora 28)
menu default menu default
kernel fedora28/vmlinuz kernel fedora28/vmlinuz
append initrd=fedora28/initrd.img inst.stage2=http://10.1.4.1/fedora28/x86_64/iso/ ip=dhcp ks=http://10.1.4.1/fedora28/x86_64/kickstart/striker.ks append initrd=fedora28/initrd.img root=live:http://10.1.4.1/fedora28/x86_64/os/images/install.img inst.stage2=http://10.1.4.1/fedora28/x86_64/os/ ip=dhcp inst.ks=http://10.1.4.1/fedora28/x86_64/kickstart/striker.ks inst.sshd rd.debug
label node
menu label Install a Anvil! ^Node (Fedora 28)
kernel fedora28/vmlinuz
append initrd=fedora28/initrd.img root=live:http://10.1.4.1/fedora28/x86_64/os/images/install.img inst.stage2=http://10.1.4.1/fedora28/x86_64/os/ ip=dhcp inst.ks=http://10.1.4.1/fedora28/x86_64/kickstart/node.ks inst.sshd rd.debug
label node
menu label Install a ^Disaster Recover Host (Fedora 28)
kernel fedora28/vmlinuz
append initrd=fedora28/initrd.img root=live:http://10.1.4.1/fedora28/x86_64/os/images/install.img inst.stage2=http://10.1.4.1/fedora28/x86_64/os/ ip=dhcp inst.ks=http://10.1.4.1/fedora28/x86_64/kickstart/dr.ks inst.sshd rd.debug
label rescue
menu label ^Rescue installed system
kernel fedora28/vmlinuz
append initrd=fedora28initrd.img ip=dhcp root=live:http://10.1.4.1/fedora28/x86_64/os/LiveOS/squashfs.img rescue
label next
#menu default
menu label Boot from Next ^Boot Device
localboot 0xffff

Binary file not shown.

After

Width:  |  Height:  |  Size: 474 KiB

@ -17,9 +17,11 @@
use strict; use strict;
use warnings; use warnings;
# Set to '1' for verbose output
my $debug = 0; my $debug = 0;
my $type = defined $ARGV[0] ? $ARGV[0] : "";
#print "Type: [".$type."]\n"; ### NOTE: This must be set to 'striker', 'node' or 'dr' when incorporated into a kickstart %pre script!
my $type = "";
if ($type =~ /striker/i) if ($type =~ /striker/i)
{ {
print "Finding install drive for a Striker dashboard.\n"; print "Finding install drive for a Striker dashboard.\n";
@ -37,8 +39,11 @@ elsif ($type =~ /dr/i)
} }
else else
{ {
print "Error: Target type not specified.\n"; print "
print "Usage: ".$0." [striker,node,dr]\n"; Error: Target type not specified.
Be sure that '\$type' is set to 'striker', 'node' or 'dr' in the \%pre section
of the kickstart script
";
exit(1); exit(1);
} }
@ -55,6 +60,9 @@ foreach my $line (split/\n/, $lsblk)
print __LINE__."; [ Debug ] - lsblk: [".$line."]\n" if $debug; print __LINE__."; [ Debug ] - lsblk: [".$line."]\n" if $debug;
my ($path, $removable, $hotplug, $type, $size, $transport, $rotational) = ($line =~ /NAME="(.*?)" RM="(\d)" HOTPLUG="(\d)" TYPE="(.*?)" SIZE="(\d+)" TRAN="(.*?)" ROTA="(\d)"/); my ($path, $removable, $hotplug, $type, $size, $transport, $rotational) = ($line =~ /NAME="(.*?)" RM="(\d)" HOTPLUG="(\d)" TYPE="(.*?)" SIZE="(\d+)" TRAN="(.*?)" ROTA="(\d)"/);
print __LINE__."; [ Debug ] - Device: [".$path."], type: [".$type."], remvoable? [".$removable."], hotplug? [".$hotplug."], rotational? [".$rotational."], transport: [".$transport."], size: [".$size."]\n" if $debug; print __LINE__."; [ Debug ] - Device: [".$path."], type: [".$type."], remvoable? [".$removable."], hotplug? [".$hotplug."], rotational? [".$rotational."], transport: [".$transport."], size: [".$size."]\n" if $debug;
# Skip 'zramX' devices
next if ($path =~ /^\/dev\/zram\d/);
# Skip removable disks and anything that just isn't a disk at all.
next if (($removable) or ($hotplug) or ($type ne "disk")); next if (($removable) or ($hotplug) or ($type ne "disk"));
$device->{$path} = { $device->{$path} = {
type => $type, type => $type,
@ -174,7 +182,7 @@ if (not $use_drive)
} }
# Finally, we've got our output. # Finally, we've got our output.
my $partition_file = "/tmp/partition_plan"; my $partition_file = "/tmp/plan_partitions.out";
my $partition_body = "zerombr my $partition_body = "zerombr
clearpart --all --drives=".$use_drive." clearpart --all --drives=".$use_drive."
ignoredisk --only-use=".$use_drive." ignoredisk --only-use=".$use_drive."
@ -182,27 +190,36 @@ bootloader --location=mbr --driveorder=".$use_drive." --boot-drive=".$use_drive.
part biosboot --fstype=biosboot --size=1 part biosboot --fstype=biosboot --size=1
part /boot --fstype=ext4 --size=1024 --asprimary --ondisk=".$use_drive." part /boot --fstype=ext4 --size=1024 --asprimary --ondisk=".$use_drive."
part swap --fstype=swap --size=4096 --asprimary --ondisk=".$use_drive." part swap --fstype=swap --size=4096 --asprimary --ondisk=".$use_drive;
";
if ($type eq "striker") if ($type eq "striker")
{ {
$partition_body = " $partition_body .= "
part / --fstype xfs --size=100 --asprimary --ondisk=".$use_drive." --grow part / --fstype xfs --size=100 --asprimary --ondisk=".$use_drive." --grow
"; ";
} }
else else
{ {
$partition_body = " $partition_body .= "
part / --fstype xfs --size=100 --asprimary --ondisk=".$use_drive." part / --fstype xfs --size=100 --asprimary --ondisk=".$use_drive."
"; ";
} }
print __LINE__."; [ Debug ] - partition_body: [".$partition_body."]\n" if $debug;
print "Writing out the partition plan to: [".$partition_file."]\n"; print "Writing out the partition plan to: [".$partition_file."]\n";
#print __LINE__."; [ Debug ] - partition_body: [".$partition_body."]\n" if $debug;
print __LINE__."; [ Debug ] - partition_body: [".$partition_body."]\n";
# Write it to the temp file that the kickstart's %include will look for.
my $shell_call = $partition_file;
print __LINE__."; [ Debug ] - shell_call: [".$shell_call."]\n" if $debug;
open (my $file_handle, ">", $shell_call) or die "Failed to write: [".$shell_call."], the error was: ".$!."\n";
print $file_handle $partition_body;
close $file_handle;
print "Completed successfully, exiting.\n";
# We're done.
exit(0); exit(0);
### Functions
# Make the size easier to read for users
sub hr_size sub hr_size
{ {
my ($size) = @_; my ($size) = @_;

Loading…
Cancel
Save