]> rtime.felk.cvut.cz Git - novaboot.git/commitdiff
Fix u-boot prompt handling
authorMichal Sojka <michal.sojka@cvut.cz>
Mon, 25 Apr 2022 20:49:03 +0000 (22:49 +0200)
committerMichal Sojka <michal.sojka@cvut.cz>
Mon, 25 Apr 2022 21:09:37 +0000 (23:09 +0200)
Commit 9c9a064 ("Reset u-boot download timeout with every '#'",
2022-04-03) broke behavior on systems with '#' in u-boot prompt. Due
to that commit, the prompt after file transfer is not detected and
novaboot timeouts. We fix that by switching the order of expect
patterns so that the prompt has priority over progress bar '#'
characters.

novaboot

index 756cbe37b100e5a2bac186863a8d16ec610366cd..cd59748d35e6cb9633f345f6ce2d6d504ec4c149 100755 (executable)
--- a/novaboot
+++ b/novaboot
@@ -1295,8 +1295,9 @@ if (defined $uboot) {
            die "No '--uboot-addr kernel' given" unless $uboot_addr{kernel};
            $exp->send("tftpboot $uboot_addr{kernel} $prefix$kbin\n");
            $exp->expect(15,
-                        [qr/#/, sub { exp_continue; }],
-                        $uboot_prompt) || die "Kernel load: " . ($! || "timeout");
+                         $uboot_prompt,
+                        [qr/#/, sub { exp_continue; }]
+                ) || die "Kernel load: " . ($! || "timeout");
        }
        if (defined $dtb) {
            die "No '--uboot-addr fdt' given" unless $uboot_addr{fdt};