portsh: don't let kernel write to our serial console.
Add 'dmesg -n1' before doing anything so that kernel messages won't corrupt
our data stream.
diff --git a/portsh/portsh.py b/portsh/portsh.py
index 87f98b6..aa555ea 100755
--- a/portsh/portsh.py
+++ b/portsh/portsh.py
@@ -207,17 +207,17 @@
if got:
trace('(got %s)' % s)
return got[:-len(s)]
- raise port.ModemError("didn't find %r after 10 tries")
+ raise port.ModemError("didn't find %r after 10 tries" % s)
PY_SCRIPT1 = r"""
-stty sane; stty -echo; python -Sc '
+dmesg -n1; stty sane; stty -echo; python -Sc '
import sys, zlib
print "%s-READY\n" % "SPLITTER";
b = sys.stdin.readline().strip()
exec(zlib.decompress(b.decode("base64")))
assembler("SPLITTER")
-'; printf %s-EXIT-97\\n SPLITTER; stty sane; cat
+'; printf %s-EXIT-97\\n SPLITTER; stty sane; dmesg -n6; cat
"""
def main():