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, $exiton_timeout, @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);
+my ($amt, @append, $bender, @chainloaders, $concat, $config_name_opt, $dhcp_tftp, $dump_opt, $dump_config, @exiton, $exiton_timeout, @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_cmd, @uboot_init);
+
+%uboot_addr = (
+ 'kernel' => '${kernel_addr_r}',
+ 'ramdisk' => '${ramdisk_addr_r}',
+ 'fdt' => '${fdt_addr_r}',
+ );
$rsync_flags = '';
$rom_prefix = 'rom://';
"tftp-port=i" => \$tftp_port,
"uboot:s" => \$uboot,
"uboot-addr=s" => \%uboot_addr,
+ "uboot-cmd=s" => \$uboot_cmd,
"uboot-init=s" => \@uboot_init,
"h" => \$help,
"help" => \$man,
@$modules = map { if (/\.dtb$/) { $dtb=$_; (); } else { $_ } } @$modules;
my $initrd = shift @$modules;
- my ($ramdisk_addr, $fdt_addr) = ('-', '');
-
die "No '--uboot-addr kernel' given" unless $uboot_addr{kernel};
$exp->send("tftpboot $uboot_addr{kernel} $prefix$kbin\n");
$exp->expect(10,
$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->send("tftpboot $uboot_addr{fdt} $prefix$dtb\n");
$exp->expect(10,
[qr/##/, sub { exp_continue; }],
$uboot_prompt) || die "Device tree load timeout";
}
if (defined $initrd) {
die "No '--uboot-addr ramdisk' given" unless $uboot_addr{ramdisk};
- $ramdisk_addr = $uboot_addr{ramdisk};
- $exp->send("tftpboot $ramdisk_addr $prefix$initrd\n");
+ $exp->send("tftpboot $uboot_addr{ramdisk} $prefix$initrd\n");
$exp->expect(10,
- [qr/#/, sub { exp_continue; }],
+ [qr/##/, sub { exp_continue; }],
$uboot_prompt) || die "Initrd load timeout";
+ } else {
+ $uboot_addr{ramdisk} = '-';
}
$exp->send("echo $kcmd\n");
$exp->expect(1, '-re', qr{echo .*\n(.*)\n$uboot_prompt}) || die "Command line test timeout";
$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");
+
+ $uboot_cmd //= $variables->{UBOOT_CMD} // 'bootm $kernel_addr $ramdisk_addr $fdt_addr';
+ $uboot_cmd =~ s/\$kernel_addr/$uboot_addr{kernel}/g;
+ $uboot_cmd =~ s/\$ramdisk_addr/$uboot_addr{ramdisk}/g;
+ $uboot_cmd =~ s/\$fdt_addr/$uboot_addr{fdt}/g;
+
+ $exp->send($uboot_cmd . "\n");
$exp->expect(5, "\n") || die "U-Boot command timeout";
}
}
=item --no-reset, --reset
-Disable/enable reseting of the target.
+Disable/enable resetting of the target.
=back
where name is one of I<kernel>, I<ramdisk> or I<fdt> (flattened device
tree).
+The default addresses are ${I<name>_addr_r}, i.e. U-Boot environment
+variables used by convention for this purpose.
+
+=item --uboot-cmd=I<command>
+
+Specifies U-Boot command used to execute the OS. If the command
+contains strings C<$kernel_addr>, C<$ramdisk_addr>, C<$fdt_addr>,
+these are replaced with the addresses configured with B<--uboot-addr>.
+
+The default value is
+
+ bootm $kernel_addr $ramdisk_addr $fdt_addr
+
+or the C<UBOOT_CMD> variable if defined in the novaboot script.
+
=back
=head2 Target interaction phase
Use specific qemu flags (can be overridden with B<-q>).
+=item UBOOT_CMD
+
+See L</--uboot-cmd>.
+
=item WVDESC
Description of the WvTest-compliant program.