]> rtime.felk.cvut.cz Git - novaboot.git/commitdiff
Reset u-boot download timeout with every '#'
authorMichal Sojka <michal.sojka@cvut.cz>
Sun, 3 Apr 2022 12:25:53 +0000 (14:25 +0200)
committerMichal Sojka <michal.sojka@cvut.cz>
Sun, 3 Apr 2022 12:25:53 +0000 (14:25 +0200)
Previously, we used two consecutive hash characters, but it turned out
that a Raspberry Pi, on our network experiences few timeouts at the
beginning (see '#T ' sequences below) and there are never two
consecutive hashes before the timeout elapses.

    U-Boot> tftpboot ${kernel_addr_r} /rpi/kernel
    Using ethernet@7d580000 device
    TFTP from server 10.35.95.2; our IP address is 10.35.95.45
    Filename '/rpi/kernel'.
    Load address: 0x80000
    Loading: #T #T T T Kernel load: timeout at /home/wsh/.nix-profile/bin/novaboot line 1298, <> line 7.

Therefore, we reset the timeout after just a single hash. Now the
above example runs as shown below:

    U-Boot> tftpboot ${kernel_addr_r} /rpi/kernel
    Using ethernet@7d580000 device
    TFTP from server 10.35.95.2; our IP address is 10.35.95.45
    Filename '/rpi/kernel'.
    Load address: 0x80000
    Loading: #T #T T ################################################  45 MiB
             2 MiB/s
    done

novaboot

index b390d07294c5d62fbef78c2658b08f09d0de2a17..756cbe37b100e5a2bac186863a8d16ec610366cd 100755 (executable)
--- a/novaboot
+++ b/novaboot
@@ -1295,7 +1295,7 @@ 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; }],
+                        [qr/#/, sub { exp_continue; }],
                         $uboot_prompt) || die "Kernel load: " . ($! || "timeout");
        }
        if (defined $dtb) {