Przeglądaj źródła

udev-rules-rpi: Use 99-com.rules directly from upstream

Rather than have an unsynchronized copy of this file, let's use this
udev rule directly from upstream.

Signed-off-by: Florin Sarbu <florin@balena.io>
Florin Sarbu 2 lat temu
rodzic
commit
492cb5a5d9

+ 4 - 3
recipes-core/udev/udev-rules-rpi.bb

@@ -3,16 +3,17 @@ LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
 
 SRC_URI = " \
-	file://99-com.rules \
+	git://github.com/RPi-Distro/raspberrypi-sys-mods;protocol=https;branch=master \
 	file://can.rules \
 	"
+SRCREV = "5ce3ef2b7f377c23fea440ca9df0e30f3f8447cf"
 
-S = "${WORKDIR}"
+S = "${WORKDIR}/git"
 
 INHIBIT_DEFAULT_DEPS = "1"
 
 do_install () {
     install -d ${D}${sysconfdir}/udev/rules.d
-    install -m 0644 ${WORKDIR}/99-com.rules ${D}${sysconfdir}/udev/rules.d/
+    install -m 0644 ${S}/etc.armhf/udev/rules.d/99-com.rules ${D}${sysconfdir}/udev/rules.d/
     install -m 0644 ${WORKDIR}/can.rules ${D}${sysconfdir}/udev/rules.d/
 }

+ 0 - 21
recipes-core/udev/udev-rules-rpi/99-com.rules

@@ -1,21 +0,0 @@
-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"