tsreadconfig();
+our $bootonly;
+our $memdisk_append;
+our $record_append;
+while (@ARGV && $ARGV[0] =~ m/^-/g) {
+ if ($ARGV[0] =~ m/^--memdisk-append=(.*)/) {
+ $memdisk_append = $1;
+ } elsif ($ARGV[0] eq "--test-boot") {
+ $memdisk_append //= "NONE";
+ $bootonly = 1;
+ } elsif ($ARGV[0] eq "--record-append") {
+ $record_append = 1;
+ } else {
+ die "Unknown argument $ARGV[0]";
+ }
+ shift @ARGV;
+}
+
+die "--record-append specified without --test-boot"
+ if $record_append and !$bootonly;
+
our ($whhost) = @ARGV;
$whhost ||= 'host';
our $ho= selecthost($whhost);
# Setup the pxelinux config file
logm("Booting from installer image at $pxeimg");
- setup_netboot_memdisk($ho, $pxeimg);
+ setup_netboot_memdisk($ho, $pxeimg, $memdisk_append);
}
sub install () {
logm("Waiting for the installer to boot");
await_tcp(get_timeout($ho,'reboot',$timeout), 5, $ho);
+if ($bootonly) {
+ hostprop_putative_record($ho, "MemdiskAppend", $memdisk_append)
+ if $record_append;
+ exit 0;
+}
+
# Next boot will be from local disk
setup_netboot_local($ho);