%CFG::targets = (
'qemu' => '--qemu',
"tud" => '--server=erwin.inf.tu-dresden.de:~sojka/boot/novaboot --rsync-flags="--chmod=Dg+s,ug+w,o-w,+rX --rsync-path=\"umask 002 && rsync\"" --grub --grub-prefix=(nd)/tftpboot/sojka/novaboot --grub-preamble="timeout 0" --concat --iprelay=141.76.48.80:2324 --scriptmod=s/\\\\bhostserial\\\\b/hostserialpci/g',
- "novabox" => '--server=novabox@rtime.felk.cvut.cz:/srv/tftp/novaboot --rsync-flags="--chmod=Dg+s,ug+w,o-w,+rX --rsync-path=\"umask 002 && rsync\"" --pulsar --iprelay-cmd="ssh novabox@rtime.felk.cvut.cz nc localhost 2324"',
+ "novabox" => '--server=novabox@rtime.felk.cvut.cz:/srv/tftp/novaboot --rsync-flags="--chmod=Dg+s,ug+w,o-w,+rX --rsync-path=\"umask 002 && rsync\"" --pulsar --iprelay-cmd="ssh -tt novabox@rtime.felk.cvut.cz nc localhost 2324"',
"localhost" => '--scriptmod=s/console=tty[A-Z0-9,]+// --server=/boot/novaboot/$NAME --grub2 --grub-prefix=/boot/novaboot/$NAME --grub2-prolog=" set root=\'(hd0,msdos1)\'"',
"ryu" => '--uboot --uboot-init="mw f0000b00 \${psc_cfg}; sleep 1" --uboot-addr kernel=800000 --uboot-addr ramdisk=b00000 --uboot-addr fdt=7f0000',
"ryuglab" => '--target ryu --server=pc-sojkam.felk.cvut.cz:/srv/tftp --remote-cmd="ssh -tt pc-sojkam.felk.cvut.cz \"sterm -d -s 115200 /dev/ttyUSB0\""',
$t = $explicit_target;
}
- (undef, my @args) = @ARGV;
- @args = (@target_expanded, @args);
+ my @args = (@target_expanded, @ARGV);
print STDERR "novaboot: Effective options: @args\n";
Getopt::Long::Configure(qw/no_ignore_case no_pass_through/);
print $exp "\xFF\xF6"; # AYT
my $connected = $exp->expect(20, # Timeout in seconds
'<iprelayd: connected>',
- '-re', '<WEB51 HW[^>]*>');
+ '-re', '<WEB51 HW[^>]*>')
+ || die "iprelay connection: " . ($! || "timeout");
last if $connected;
}
$exp->log_stdout(0);
print $exp relaycmd($relay, $onoff);
my $confirmed = $exp->expect(20, # Timeout in seconds
- relayconf($relay, $onoff));
+ relayconf($relay, $onoff))
+ || die "iprelay command: " . ($! || "timeout");
if (!$confirmed) {
if ($can_giveup) {
print("Relay confirmation timeout - ignoring\n");
my $cmd = "amtterm -u $amt_user -p $amt_password $amt_host $amt_port";
print STDERR "novaboot: Running: $cmd\n" =~ s/\Q$amt_password\E/???/r;
$exp = Expect->spawn($cmd);
- $exp->expect(10, "RUN_SOL") || die "Expect for 'RUN_SOL' timed out";
-
+ $exp->expect(10, "RUN_SOL") || die "Expect for 'RUN_SOL': " . ($! || "timeout");
}
$exp->log_stdout(0);
}
$exp->expect($remote_expect_timeout >= 0 ? $remote_expect_timeout : undef,
- $remote_expect) || die "Expect for '$remote_expect' timed out";
+ $remote_expect) || die "Expect for '$remote_expect':" . ($! || "timeout");;
if (defined $remote_expect_silent) {
$exp->log_stdout($log);
print $exp->after() if $log;
$exp->send("tftpboot $uboot_addr{kernel} $prefix$kbin\n");
$exp->expect(10,
[qr/##/, sub { exp_continue; }],
- $uboot_prompt) || die "Kernel load timeout";
+ $uboot_prompt) || die "Kernel load: " . ($! || "timeout");
}
if (defined $dtb) {
die "No '--uboot-addr fdt' given" unless $uboot_addr{fdt};
$exp->send("tftpboot $uboot_addr{fdt} $prefix$dtb\n");
$exp->expect(10,
[qr/##/, sub { exp_continue; }],
- $uboot_prompt) || die "Device tree load timeout";
+ $uboot_prompt) || die "Device tree load: " . ($! || "timeout");
} else {
$uboot_addr{fdt} = '';
}
$exp->send("tftpboot $uboot_addr{ramdisk} $prefix$initrd\n");
$exp->expect(10,
[qr/##/, sub { exp_continue; }],
- $uboot_prompt) || die "Initrd load timeout";
+ $uboot_prompt) || die "Initrd load: " . ($! || "timeout");
} else {
$uboot_addr{ramdisk} = '-';
}
$kcmd //= '';
$exp->send("setenv bootargs $kcmd\n");
- $exp->expect(5, $uboot_prompt) || die "U-Boot prompt timeout";
+ $exp->expect(5, $uboot_prompt) || die "U-Boot prompt: " . ($! || "timeout");
}
$uboot_cmd //= $variables->{UBOOT_CMD} // 'bootm $kernel_addr $ramdisk_addr $fdt_addr';
$uboot_cmd =~ s/\$fdt_addr/$uboot_addr{fdt}/g;
$exp->send($uboot_cmd . "\n");
- $exp->expect(5, "\n") || die "U-Boot command timeout";
+ $exp->expect(5, "\n") || die "U-Boot command: " . ($! || "timeout");
}
}
print STDERR "novaboot: Serial line interaction (press $interrupt to interrupt)...\n";
$exp->log_stdout(1);
if (@exiton) {
- $exp->expect($exiton_timeout, @expect_raw, @exiton) || die("exiton timeout");
+ $exp->expect($exiton_timeout, @expect_raw, @exiton) || die("exiton: " . ($! || "timeout"));
} else {
my @inputs = ($exp);
my $infile = new IO::File;