In order to be compatible with a standard U-Boot way of having
variables containin U-Boot commands and using 'run' to expand variable
references in them, we check kernel command line if it starts with
'setenv bootargs'. If yes, we simply run this command, otherwise, we
preprend 'setenv bootargs' ourselves.
Examples:
1) Novaboot script contains:
load linux console=${console} quiet
U-Boot is instructed to run:
setenv bootargs console=${console} quiet
2) Novaboot script contains:
load linux ${netargs} quiet
and the U-Boot variable netargs contsins "setenv bootargs console=${console}"
U-Boot is instructed to run:
setenv bootargs console=${console} quiet
Note that in case 1) novaboot prepends "setenv bootargs" itselv
whereas in 2) inly executes the command line as is.
[qr/#/, sub { exp_continue; }],
$uboot_prompt) || die "Initrd load failed";
}
- $exp->send("setenv bootargs $kcmd\n");
+ $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->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";