mirror of
https://github.com/ebrandi/FDD-book.git
synced 2026-12-06 00:23:30 +00:00
Organize companion code and materials by book part: part-01/ Foundations part-02/ Kernel & driver fundamentals part-03/ Character & block devices part-04/ Networking & storage part-05/ Buses & advanced topics part-06/ Debugging & performance part-07/ Real-world drivers appendices/ Supplementary material README.md Overview and build instructions
24 lines
475 B
Bash
Executable file
24 lines
475 B
Bash
Executable file
#!/bin/sh
|
|
#
|
|
# diagnose.sh - Compare termios settings on both ends of a TTY pair.
|
|
|
|
set -eu
|
|
|
|
A=${A:-/dev/nmdm0.A}
|
|
B=${B:-/dev/nmdm0.B}
|
|
|
|
if [ ! -c "${A}" ] || [ ! -c "${B}" ]; then
|
|
echo "One of ${A}, ${B} is missing. Load nmdm and open the pair."
|
|
exit 2
|
|
fi
|
|
|
|
echo "=== A: ${A} ==="
|
|
stty -a -f "${A}"
|
|
echo
|
|
echo "=== B: ${B} ==="
|
|
stty -a -f "${B}"
|
|
echo
|
|
echo "=== Diff ==="
|
|
diff -u \
|
|
<(stty -a -f "${A}" | tr ';' '\n' | sort) \
|
|
<(stty -a -f "${B}" | tr ';' '\n' | sort) || true
|