distribution/packages/kernel/linux-firmware/brcmfmac_sdio-firmware-rpi/udev.d/90-rpi-add-serial.rules
2022-02-05 09:23:32 -05:00

21 lines
706 B
Text
Executable file

KERNEL=="ttyAMA[01]", PROGRAM="/bin/sh -c '\
ALIASES=/proc/device-tree/aliases; \
if [ $(cat $ALIASES/uart0) = $(cat $ALIASES/serial0) ]; then \
echo 0;\
elif [ $(cat $ALIASES/uart0) = $(cat $ALIASES/serial1) ]; then \
echo 1; \
else \
exit 1; \
fi\
'", SYMLINK+="serial%c"
KERNEL=="ttyS0", PROGRAM="/bin/sh -c '\
ALIASES=/proc/device-tree/aliases; \
if [ $(cat $ALIASES/uart1) = $(cat $ALIASES/serial0) ]; then \
echo 0; \
elif [ $(cat $ALIASES/uart1) = $(cat $ALIASES/serial1) ]; then \
echo 1; \
else \
exit 1; \
fi \
'", SYMLINK+="serial%c"