Skip to content

Commit

Permalink
99-com.rules: Improve serial matching on older Pis
Browse files Browse the repository at this point in the history
See: #84
  • Loading branch information
pelwell committed Oct 28, 2023
1 parent 9b582d5 commit 71635ca
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions etc.armhf/udev/rules.d/99-com.rules
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ SUBSYSTEM=="pwm", ACTION!="remove", PROGRAM="/bin/sh -c 'chgrp -R gpio /sys%p &&
KERNEL=="ttyAMA[0-9]*|ttyS[0-9]*", PROGRAM="/bin/sh -c '\
ALIASES=/proc/device-tree/aliases; \
TTYNODE=$$(readlink /sys/class/tty/%k/device/of_node | sed 's/base/:/' | cut -d: -f2); \
if [ -e $$ALIASES/bluetooth ] && [ $$TTYNODE/bluetooth = $$(strings $$ALIASES/bluetooth) ]; then \
echo 1; \
elif [ -e $$ALIASES/console ]; then \
if [ -e $$ALIASES/console ]; then \
if [ $$TTYNODE = $$(strings $$ALIASES/console) ]; then \
echo 0;\
echo 0; \
elif [ -e $$ALIASES/bluetooth ] && [ $$TTYNODE/bluetooth = $$(strings $$ALIASES/bluetooth) ]; then \
echo 1; \
else \
exit 1; \
fi \
Expand Down

0 comments on commit 71635ca

Please sign in to comment.