my $explicit_target;
GetOptions ("target|t=s" => \$explicit_target);
-my ($amt, @append, $bender, @chainloaders, $concat, $config_name_opt, $dhcp_tftp, $dump_opt, $dump_config, @exiton, @expect_raw, $gen_only, $grub_config, $grub_prefix, $grub_preamble, $grub2_prolog, $grub2_config, $help, $ider, $iprelay, $iso_image, $interactive, $kernel_opt, $make, $man, $no_file_gen, $off_opt, $on_opt, $pulsar, $pulsar_root, $qemu, $qemu_append, $qemu_flags_cmd, $remote_cmd, $remote_expect, $reset_cmd, $rom_prefix, $rsync_flags, @scriptmod, $scons, $serial, $server, $stty, $tftp, $tftp_port, $uboot, %uboot_addr, @uboot_init);
+my ($amt, @append, $bender, @chainloaders, $concat, $config_name_opt, $dhcp_tftp, $dump_opt, $dump_config, @exiton, @expect_raw, $gen_only, $grub_config, $grub_prefix, $grub_preamble, $grub2_prolog, $grub2_config, $help, $ider, $iprelay, $iso_image, $interactive, $kernel_opt, $make, $man, $no_file_gen, $off_opt, $on_opt, $pulsar, $pulsar_root, $qemu, $qemu_append, $qemu_flags_cmd, $remote_cmd, $remote_expect, $reset, $reset_cmd, $rom_prefix, $rsync_flags, @scriptmod, $scons, $serial, $server, $stty, $tftp, $tftp_port, $uboot, %uboot_addr, @uboot_init);
$rsync_flags = '';
$rom_prefix = 'rom://';
$stty = 'raw -crtscts -onlcr 115200';
+$reset = 1; # Reset target by default
my @expect_seen = ();
sub handle_expect
"qemu-flags|q=s" => \$qemu_flags_cmd,
"remote-cmd=s" => \$remote_cmd,
"remote-expect=s"=> \$remote_expect,
+ "reset!" => \$reset,
"reset-cmd=s" => \$reset_cmd,
"rsync-flags=s" => \$rsync_flags,
"scons:s" => \$scons,
### Reset target (IP relay, AMT, ...)
-if (defined $target_reset) {
+if (defined $target_reset && $reset) {
print "novaboot: Reseting the test box... ";
&$target_reset();
print "done\n";
$exp->send("tftpboot $uboot_addr{kernel} $prefix$kbin\n");
$exp->expect(10,
[qr/##/, sub { exp_continue; }],
- $uboot_prompt) || die "No U-Boot prompt deteceted";
+ $uboot_prompt) || die "Kernel load timeout";
if (defined $dtb) {
die "No '--uboot-addr fdt' given" unless $uboot_addr{fdt};
$fdt_addr = $uboot_addr{fdt};
$exp->send("tftpboot $fdt_addr $prefix$dtb\n");
$exp->expect(10,
[qr/##/, sub { exp_continue; }],
- $uboot_prompt) || die "Device tree load failed";
+ $uboot_prompt) || die "Device tree load timeout";
}
if (defined $initrd) {
die "No '--uboot-addr ramdisk' given" unless $uboot_addr{ramdisk};
$exp->send("tftpboot $ramdisk_addr $prefix$initrd\n");
$exp->expect(10,
[qr/#/, sub { exp_continue; }],
- $uboot_prompt) || die "Initrd load failed";
+ $uboot_prompt) || die "Initrd load timeout";
+ }
+ $exp->send("echo $kcmd\n");
+ $exp->expect(1, '-re', qr{echo .*\n(.*)\n$uboot_prompt}) || die "Command line test timeout";
+ my $args = ($exp->matchlist)[0];
+ if ($args =~ /^setenv\s+bootargs/) {
+ $exp->send("$args\n");
+ } else {
+ $exp->send("setenv bootargs $kcmd\n");
}
- $exp->send("setenv bootargs $kcmd\n");
$exp->expect(5, $uboot_prompt) || die "U-Boot prompt timeout";
$exp->send("bootm $uboot_addr{kernel} $ramdisk_addr $fdt_addr\n");
$exp->expect(5, "\n") || die "U-Boot command timeout";
Command that resets the target.
+=item --no-reset, --reset
+
+Disable/enable reseting of the target.
+
=back
=head2 Interaction with the bootloader on the target