]> rtime.felk.cvut.cz Git - novaboot.git/commitdiff
uboot: Make loading files and booting independent
authorMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 27 Jan 2015 12:38:44 +0000 (13:38 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 27 Jan 2015 12:38:44 +0000 (13:38 +0100)
When I want to boot the system from flash, I don't need to load
anything, but I need to run a boot command (UBOOT_CMD). This was not
possible without this change.

novaboot

index c8e5f63e9d5ed9ee19c5fc86478f7228662955ae..7603aa6e8d9cb661a1db6c7d5591616cbb02b7d3 100755 (executable)
--- a/novaboot
+++ b/novaboot
@@ -1094,9 +1094,8 @@ if (defined $uboot) {
        $exp->expect($timeout, $uboot_prompt) || die "U-Boot prompt timeout";
     }
 
-    # Boot the system if there are some load lines in the script
-    if ((scalar(@$modules) > 0 && !$variables->{NO_BOOT}) ||
-       defined $uboot_cmd) {
+    # Load files if there are some load lines in the script
+    if (scalar(@$modules) > 0  && !$variables->{NO_BOOT}) {
        my ($kbin, $kcmd) = split(' ', shift(@$modules), 2);
        my $dtb;
        @$modules = map { if (/\.dtb$/) { $dtb=$_; (); } else { $_ } } @$modules;
@@ -1130,6 +1129,8 @@ if (defined $uboot) {
        $exp->send("setenv bootargs $kcmd\n");
        $exp->expect(5, $uboot_prompt)  || die "U-Boot prompt timeout";
 
+    }
+    if (!$variables->{NO_BOOT}) {
        $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;