summaryrefslogtreecommitdiffstats
path: root/recipes-core
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-core')
-rw-r--r--recipes-core/udev/udev-rules-rpi.bb12
-rw-r--r--recipes-core/udev/udev-rules-rpi/99-com.rules21
2 files changed, 33 insertions, 0 deletions
diff --git a/recipes-core/udev/udev-rules-rpi.bb b/recipes-core/udev/udev-rules-rpi.bb
new file mode 100644
index 0000000..20443d3
--- /dev/null
+++ b/recipes-core/udev/udev-rules-rpi.bb
@@ -0,0 +1,12 @@
1DESCRIPTION = "udev rules for Raspberry Pi Boards"
2LICENSE = "MIT"
3LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
4
5SRC_URI = " file://99-com.rules"
6
7S = "${WORKDIR}"
8
9do_install () {
10 install -d ${D}${sysconfdir}/udev/rules.d
11 install -m 0644 ${WORKDIR}/99-com.rules ${D}${sysconfdir}/udev/rules.d/
12}
diff --git a/recipes-core/udev/udev-rules-rpi/99-com.rules b/recipes-core/udev/udev-rules-rpi/99-com.rules
new file mode 100644
index 0000000..6bf019b
--- /dev/null
+++ b/recipes-core/udev/udev-rules-rpi/99-com.rules
@@ -0,0 +1,21 @@
1KERNEL=="ttyAMA[01]", PROGRAM="/bin/sh -c '\
2 ALIASES=/proc/device-tree/aliases; \
3 if cmp -s $ALIASES/uart0 $ALIASES/serial0; then \
4 echo 0;\
5 elif cmp -s $ALIASES/uart0 $ALIASES/serial1; then \
6 echo 1; \
7 else \
8 exit 1; \
9 fi\
10'", SYMLINK+="serial%c"
11
12KERNEL=="ttyS0", PROGRAM="/bin/sh -c '\
13 ALIASES=/proc/device-tree/aliases; \
14 if cmp -s $ALIASES/uart1 $ALIASES/serial0; then \
15 echo 0; \
16 elif cmp -s $ALIASES/uart1 $ALIASES/serial1; then \
17 echo 1; \
18 else \
19 exit 1; \
20 fi \
21'", SYMLINK+="serial%c"