Automatische Installation über /dev/ttyS0 mit CHAT bzw Bash-Script
Guten Tag, Nach Tagen an versuchen und googlen gebe ich mich so langsam geschlagen, das ich es alleine nicht hinbekommen werde. Folgendes, ich habe ein Gerät das über /dev/ttyS0 an meinen PC angschlossen ist. Über minicom/kermit sieht ich die Ausgabe von dem Gerät wie folgt aus: Kermit: U-Boot 1.1.4-ptx3-pcm027-3 (Aug 18 2006 - 14:42:49) U-Boot code: A0E00000 -> A0E265FC BSS: -> A0E5B640 RAM Configuration: Bank #0: a0000000 64 MB Flash: 32 MB Hit any key to stop autoboot: 0 Jetzt würde das Gerät weiter booten, da ich aber das Gerät neu "installieren" möchte, muss ich eine Taste drücken um in eine Art BIOS zukommen. Für den Tastendruck habe ich 3 Sekunden Zeit. Hit any key to stop autoboot: 3 2 1 0 <-- die letzte Zahl wird immer überschrieben, also ein reales runterzählen. Weder CHAT oder ein BASH-Script reagiert darauf. Was ich bis jetzt habe ist: Script1.sh #!/bin/bash stty -F /dev/ttyS0 ispeed 115200 ospeed 115200 -parenb -parodd cs8 hupcl -cstopb cread clocal -crtscts ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke rm serial.txt touch serial.txt cat /dev/ttyS0 >> serial.txt & tail -f serial.txt Script2.sh #!/bin/bash while read line do echo -e "$line" if [ "$line" == "Hit any key to stop autoboot:" ]; then echo "" > /dev/ttyS0 fi done < /home/scripte/infoman/serial.txt Oder noch das CHAT-Script ABORT "CRC checksum" "Hit any key to stop autoboot:" "/r" Im Anhang ist noch die serial.txt-Datei aus Script1.sh Ich hoffe mir kann jemand helfen. Vielen Dank Gruß Lennart Mordek
participants (1)
-
Lennart Mordek