]> rtime.felk.cvut.cz Git - novaboot.git/commitdiff
Disable echo in default stty arguments
authorJan Kaisrlik <jan.kaisrlik@avast.com>
Mon, 4 Nov 2019 16:28:01 +0000 (17:28 +0100)
committerMichal Sojka <michal.sojka@cvut.cz>
Wed, 6 Nov 2019 09:04:32 +0000 (10:04 +0100)
From time to time I observe that the novaboot hangs in the uboot menu
with weird characters on the line like this

    => MC:   mmc@7000: 0^M^JLoading Environment from MMC... OK^M^JIn:    serial@3000^M^JNet:   eth0: ethernet@ff3f0000^M^JHit any key to stop autoboot:  2 ^H^H^H 0^M^J=> MC:   mmc@7000: 0^M^JLoading Environment from MMC... OK^M^JIn:    serial@3000^M^JNet:
    Unknown command 'MC:' - try 'help'

When I tried to play with stty options I realized that the echo option
breaks the communication. The reason is that when echo is
enabled (which is by default), all characters sent by the target are
echoed back to the target, which may interpret them.

To confirm that, I tested the following options:

    --stty="raw -crtscts -onlcr 115200 -echo" (working)
    --stty="raw -crtscts -onlcr 115200 echo" (not working)

It turns out that the problem appears only during the first initial
novaboot conversation with the bootloader after. After switching to
interactive mode, echo is automatically disabled by Expect.pm and for
subsequent boots, echo remains disabled.

[Note: Commit message updated by Michal Sojka based on GitHub
discussion https://github.com/wentasah/novaboot/pull/5 and his
investigation of the issue.]

novaboot

index ed347cfd838f574a8a15da2f11755d76bda4df33..b86dba0b3adedd1d60f6ee667234c2434188b7ec 100755 (executable)
--- a/novaboot
+++ b/novaboot
@@ -141,7 +141,7 @@ my ($target_reset, $target_power_on, $target_power_off);
     );
 $rsync_flags = '';
 $rom_prefix = 'rom://';
-$stty = 'raw -crtscts -onlcr 115200';
+$stty = 'raw -crtscts -onlcr -echo 115200';
 $reset = 1;                    # Reset target by default
 $interaction = 1;              # Perform target interaction by default
 $final_eol = 1;