diff options
Diffstat (limited to 'meta-raspberrypi/recipes-core/udev/udev-rules-rpi/99-com.rules')
-rw-r--r-- | meta-raspberrypi/recipes-core/udev/udev-rules-rpi/99-com.rules | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/meta-raspberrypi/recipes-core/udev/udev-rules-rpi/99-com.rules b/meta-raspberrypi/recipes-core/udev/udev-rules-rpi/99-com.rules new file mode 100644 index 000000000..6bf019bd1 --- /dev/null +++ b/meta-raspberrypi/recipes-core/udev/udev-rules-rpi/99-com.rules @@ -0,0 +1,21 @@ +KERNEL=="ttyAMA[01]", PROGRAM="/bin/sh -c '\ + ALIASES=/proc/device-tree/aliases; \ + if 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 \ + echo 0; \ + elif cmp -s $ALIASES/uart1 $ALIASES/serial1; then \ + echo 1; \ + else \ + exit 1; \ + fi \ +'", SYMLINK+="serial%c" |