mirror of
https://github.com/home-assistant/operating-system.git
synced 2025-07-28 07:26:28 +00:00
RaspberryPI: Fix issue with correct SYMLINK with ttyAMA (#915)
This commit is contained in:
parent
fa242e32d7
commit
0495ba25ad
@ -1,4 +1,5 @@
|
||||
KERNEL=="ttyAMA[01]", ATTR{iomem_base}=="0xFE201000", PROGRAM="/bin/sh -c '\
|
||||
|
||||
KERNEL=="ttyAMA0", PROGRAM="/bin/sh -c '\
|
||||
ALIASES=/proc/device-tree/aliases; \
|
||||
if cmp -s $ALIASES/uart0 $ALIASES/serial0; then \
|
||||
echo 0;\
|
||||
@ -9,6 +10,19 @@ KERNEL=="ttyAMA[01]", ATTR{iomem_base}=="0xFE201000", PROGRAM="/bin/sh -c '\
|
||||
fi\
|
||||
'", SYMLINK+="serial%c"
|
||||
|
||||
KERNEL=="ttyAMA1", PROGRAM="/bin/sh -c '\
|
||||
ALIASES=/proc/device-tree/aliases; \
|
||||
if [ -e /dev/ttyAMA0 ]; then \
|
||||
exit 1; \
|
||||
elif cmp -s $ALIASES/uart0 $ALIASES/serial0; then \
|
||||
echo 0;\
|
||||
elif cmp -s $ALIASES/uart0 $ALIASES/serial1; then \
|
||||
echo 1; \
|
||||
else \
|
||||
exit 1; \
|
||||
fi\
|
||||
'", SYMLINK+="serial%c"
|
||||
|
||||
KERNEL=="ttyS0", PROGRAM="/bin/sh -c '\
|
||||
ALIASES=/proc/device-tree/aliases; \
|
||||
if cmp -s $ALIASES/uart1 $ALIASES/serial0; then \
|
Loading…
x
Reference in New Issue
Block a user