distribution/packages/kernel/linux-firmware/brcmfmac_sdio-firmware-rpi/udev.d/90-rpi-add-serial.rules

22 lines
706 B
Text
Raw Normal View History

2022-02-05 14:23:32 +00:00
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"