]> rtime.felk.cvut.cz Git - novaboot.git/commitdiff
uboot: Do not analyze expanded kernel command line
authorMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 31 Oct 2014 13:32:00 +0000 (14:32 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 31 Oct 2014 13:32:00 +0000 (14:32 +0100)
Previously, novaboot asked U-Boot to expand the kernel command line
before using it. If the expanded command line started with 'setenv
bootargs', it executed this command, otherwise, it prepended 'setenv
bootargs' and executed it.

This was present to allow using U-Boot environment variables that were
meant to be used with the "run" command in the kernel command line. As
those variables can contain other commands than just "setenv bootargs",
this didn't always work correctly. Therefore, we remove this
functionality. If users are need this functionality, they can use the
uboot lines in the novaboot script to explicitly invoke the run command.

For example, the following novaboot script

    load linux/arch/arm/boot/uImage ${netargs} myparam=1

should be rewritten as follows:

    uboot run netargs
    load linux/arch/arm/boot/uImage ${bootargs} myparam=1

The "run netargs" command sets the bootargs variable and this variable
is mentioned explicitly in the command line.

novaboot

index 42743a77489c09cd67d6b842663fd59e770a8bee..5f4cfe3fdc299e911bcc49363702107f9821a6df 100755 (executable)
--- a/novaboot
+++ b/novaboot
@@ -1068,14 +1068,9 @@ if (defined $uboot) {
        } else {
            $uboot_addr{ramdisk} = '-';
        }
-       $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");
-       }
+
+       $kcmd //= '';
+       $exp->send("setenv bootargs $kcmd\n");
        $exp->expect(5, $uboot_prompt)  || die "U-Boot prompt timeout";
 
        $uboot_cmd //= $variables->{UBOOT_CMD} // 'bootm $kernel_addr $ramdisk_addr $fdt_addr';