Skip to contentSkip to conversation

systemd: Add udev rules for persistent naming of the can devices

PATCH Superseded Aniket Limaye 5 participants 9 messages Feb 8, 2024 – Feb 21, 2024 1 message not in the archive

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 systemd: Add udev rules for persistent naming of the can devices

When multiple CAN's are present, then names that are getting assigned change after every boot even after providing alias in the device tree.
So add udev rules to specify the interface name to use for each mcan device, to make it persistent across reboots.

---
v4:
- Reformat patch to avoid repeated code for k3 devices
- Add udev rules for dra7xx and ti33x too, as suggested
- Still keeping separate files per platform to avoid potential confusion created by merging all the rules into one file
v3: Fix typos in the filename being installed in v2
v2:
- Switch to udev rules instead of systemd network links, as per feedback from v1: https://lists.yoctoproject.org/g/meta-arago/message/15104
- Also, extend to Sitara devices as well

---
 .../systemd/systemd/37-can-am62.rules         |  4 ++
 .../systemd/systemd/37-can-dra7.rules         |  2 +
 .../systemd/systemd/37-can-j7.rules           | 20 ++++++++++
 .../systemd/systemd/37-can-ti33x.rules        |  2 +
 .../recipes-core/systemd/systemd_%.bbappend   | 37 +++++++++++++++++++
 5 files changed, 65 insertions(+)
 create mode 100644 meta-arago-distro/recipes-core/systemd/systemd/37-can-am62.rules
 create mode 100644 meta-arago-distro/recipes-core/systemd/systemd/37-can-dra7.rules
 create mode 100644 meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules
 create mode 100644 meta-arago-distro/recipes-core/systemd/systemd/37-can-ti33x.rules
meta-arago-distro/recipes-core/systemd/systemd/37-can-am62.rules new file +4 -0
new file mode 100644
index 00000000..59dc8075
@@ -0,0 +1,4 @@
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="4e08000.can", NAME="mcu_mcan0"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="4e18000.can", NAME="mcu_mcan1"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="20701000.can", NAME="main_mcan0"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="20711000.can", NAME="main_mcan1"
meta-arago-distro/recipes-core/systemd/systemd/37-can-dra7.rules new file +2 -0
new file mode 100644
index 00000000..3b14150d
@@ -0,0 +1,2 @@
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="4ae3c000.can", NAME="main_dcan1"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="48480000.can", NAME="main_dcan2"
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +20 -0
new file mode 100644
index 00000000..f2804ecd
@@ -0,0 +1,20 @@
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="40528000.can", NAME="mcu_mcan0"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="40568000.can", NAME="mcu_mcan1"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2701000.can", NAME="main_mcan0"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2711000.can", NAME="main_mcan1"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2721000.can", NAME="main_mcan2"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2731000.can", NAME="main_mcan3"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2741000.can", NAME="main_mcan4"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2751000.can", NAME="main_mcan5"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2761000.can", NAME="main_mcan6"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2771000.can", NAME="main_mcan7"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2781000.can", NAME="main_mcan8"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2791000.can", NAME="main_mcan9"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="27a1000.can", NAME="main_mcan10"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="27b1000.can", NAME="main_mcan11"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="27c1000.can", NAME="main_mcan12"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="27d1000.can", NAME="main_mcan13"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2681000.can", NAME="main_mcan14"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2691000.can", NAME="main_mcan15"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="26a1000.can", NAME="main_mcan16"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="26b1000.can", NAME="main_mcan17"
meta-arago-distro/recipes-core/systemd/systemd/37-can-ti33x.rules new file +2 -0
new file mode 100644
index 00000000..62d650fe
@@ -0,0 +1,2 @@
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="481cc000.can", NAME="main_dcan0"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="481d0000.can", NAME="main_dcan1"
meta-arago-distro/recipes-core/systemd/systemd_%.bbappend +37 -0
index f38606f2..f9919708 100644
@@ -2,6 +2,21 @@ PR:append = ".arago7"
 
 FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
 
+CAN_RULES_SRC = ""
+CAN_RULES_SRC:j721e = "37-can-j7.rules"
+CAN_RULES_SRC:j7200 = "37-can-j7.rules"
+CAN_RULES_SRC:j721s2 = "37-can-j7.rules"
+CAN_RULES_SRC:j784s4 = "37-can-j7.rules"
+CAN_RULES_SRC:am65xx = "37-can-j7.rules"
+CAN_RULES_SRC:am62xx = "37-can-am62.rules"
+CAN_RULES_SRC:am62pxx = "37-can-am62.rules"
+CAN_RULES_SRC:am62axx = "37-can-am62.rules"
+CAN_RULES_SRC:am64xx = "37-can-am62.rules"
+CAN_RULES_SRC:j722s = "37-can-am62.rules"
+CAN_RULES_SRC:dra7xx = "37-can-dra7.rules"
+CAN_RULES_SRC:ti33x = "37-can-ti33x.rules"
+CAN_RULES_TGT = "${libdir}/udev/rules.d/37-can.rules"
+
 SRC_URI:append = " \
     file://local.rules \
     file://usb1-rules.sh \
@@ -14,6 +29,10 @@ SRC_URI:append = " \
     file://timesyncd.conf \
 "
 
+SRC_URI:append:k3 = " file://${CAN_RULES_SRC}"
+SRC_URI:append:dra7xx = " file://${CAN_RULES_SRC}"
+SRC_URI:append:ti33x = " file://${CAN_RULES_SRC}"
+
 do_install:append() {
     install -d ${D}${sysconfdir}/udev/rules.d/
     install -m 0644 ${WORKDIR}/local.rules ${D}${sysconfdir}/udev/rules.d/
@@ -43,3 +62,21 @@ do_install:append() {
     install -d ${D}${sysconfdir}/systemd/
     install -m 0644 ${WORKDIR}/timesyncd.conf ${D}${sysconfdir}/systemd/
 }
+
+do_install:append:k3() {
+    install -d ${D}${libdir}/udev/rules.d
+    install -m 0644 ${WORKDIR}/${CAN_RULES_SRC} ${D}${CAN_RULES_TGT}
+}
+
+do_install:append:dra7xx() {
+    install -d ${D}${libdir}/udev/rules.d
+    install -m 0644 ${WORKDIR}/${CAN_RULES_SRC} ${D}${CAN_RULES_TGT}
+}
+
+do_install:append:ti33x() {
+    install -d ${D}${libdir}/udev/rules.d
+    install -m 0644 ${WORKDIR}/${CAN_RULES_SRC} ${D}${CAN_RULES_TGT}
+}
+
+FILES:udev += "${CAN_RULES_TGT}"
+
Signature · 1 line
2.34.1
#1 lore raw
Quoted 6 lines · Aniket Limaye via lists.yoctoproject.org

When multiple CAN's are present, then names that are getting assigned change after every boot even after providing alias in the device tree.
So add udev rules to specify the interface name to use for each mcan device, to make it persistent across reboots.

Quoted 8 lines

---
v4:
- Reformat patch to avoid repeated code for k3 devices
- Add udev rules for dra7xx and ti33x too, as suggested
- Still keeping separate files per platform to avoid potential confusion created by merging all the rules into one file

You can keep the rules in separate files, but you need to install them all unconditionally for all machines. Otherwise this package becomes machine specific, which we should avoid.

Andrew

Quoted 128 lines

v3: Fix typos in the filename being installed in v2
v2:
- Switch to udev rules instead of systemd network links, as per feedback from v1: https://lists.yoctoproject.org/g/meta-arago/message/15104
- Also, extend to Sitara devices as well

---
  .../systemd/systemd/37-can-am62.rules         |  4 ++
  .../systemd/systemd/37-can-dra7.rules         |  2 +
  .../systemd/systemd/37-can-j7.rules           | 20 ++++++++++
  .../systemd/systemd/37-can-ti33x.rules        |  2 +
  .../recipes-core/systemd/systemd_%.bbappend   | 37 +++++++++++++++++++
  5 files changed, 65 insertions(+)

create mode 100644 meta-arago-distro/recipes-core/systemd/systemd/37-can-am62.rules create mode 100644 meta-arago-distro/recipes-core/systemd/systemd/37-can-dra7.rules create mode 100644 meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules create mode 100644 meta-arago-distro/recipes-core/systemd/systemd/37-can-ti33x.rules

meta-arago-distro/recipes-core/systemd/systemd/37-can-am62.rules new file +4 -0
new file mode 100644
index 00000000..59dc8075
@@ -0,0 +1,4 @@
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="4e08000.can", NAME="mcu_mcan0"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="4e18000.can", NAME="mcu_mcan1"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="20701000.can", NAME="main_mcan0"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="20711000.can", NAME="main_mcan1"
meta-arago-distro/recipes-core/systemd/systemd/37-can-dra7.rules new file +2 -0
new file mode 100644
index 00000000..3b14150d
@@ -0,0 +1,2 @@
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="4ae3c000.can", NAME="main_dcan1"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="48480000.can", NAME="main_dcan2"
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +20 -0
new file mode 100644
index 00000000..f2804ecd
@@ -0,0 +1,20 @@
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="40528000.can", NAME="mcu_mcan0"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="40568000.can", NAME="mcu_mcan1"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2701000.can", NAME="main_mcan0"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2711000.can", NAME="main_mcan1"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2721000.can", NAME="main_mcan2"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2731000.can", NAME="main_mcan3"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2741000.can", NAME="main_mcan4"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2751000.can", NAME="main_mcan5"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2761000.can", NAME="main_mcan6"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2771000.can", NAME="main_mcan7"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2781000.can", NAME="main_mcan8"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2791000.can", NAME="main_mcan9"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="27a1000.can", NAME="main_mcan10"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="27b1000.can", NAME="main_mcan11"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="27c1000.can", NAME="main_mcan12"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="27d1000.can", NAME="main_mcan13"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2681000.can", NAME="main_mcan14"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2691000.can", NAME="main_mcan15"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="26a1000.can", NAME="main_mcan16"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="26b1000.can", NAME="main_mcan17"
meta-arago-distro/recipes-core/systemd/systemd/37-can-ti33x.rules new file +2 -0
new file mode 100644
index 00000000..62d650fe
@@ -0,0 +1,2 @@
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="481cc000.can", NAME="main_dcan0"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="481d0000.can", NAME="main_dcan1"
meta-arago-distro/recipes-core/systemd/systemd_%.bbappend +37 -0
index f38606f2..f9919708 100644
@@ -2,6 +2,21 @@ PR:append = ".arago7"
 
  FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
 
+CAN_RULES_SRC = ""
+CAN_RULES_SRC:j721e = "37-can-j7.rules"
+CAN_RULES_SRC:j7200 = "37-can-j7.rules"
+CAN_RULES_SRC:j721s2 = "37-can-j7.rules"
+CAN_RULES_SRC:j784s4 = "37-can-j7.rules"
+CAN_RULES_SRC:am65xx = "37-can-j7.rules"
+CAN_RULES_SRC:am62xx = "37-can-am62.rules"
+CAN_RULES_SRC:am62pxx = "37-can-am62.rules"
+CAN_RULES_SRC:am62axx = "37-can-am62.rules"
+CAN_RULES_SRC:am64xx = "37-can-am62.rules"
+CAN_RULES_SRC:j722s = "37-can-am62.rules"
+CAN_RULES_SRC:dra7xx = "37-can-dra7.rules"
+CAN_RULES_SRC:ti33x = "37-can-ti33x.rules"
+CAN_RULES_TGT = "${libdir}/udev/rules.d/37-can.rules"
+
  SRC_URI:append = " \
      file://local.rules \
      file://usb1-rules.sh \
@@ -14,6 +29,10 @@ SRC_URI:append = " \
      file://timesyncd.conf \
  "
 
+SRC_URI:append:k3 = " file://${CAN_RULES_SRC}"
+SRC_URI:append:dra7xx = " file://${CAN_RULES_SRC}"
+SRC_URI:append:ti33x = " file://${CAN_RULES_SRC}"
+
  do_install:append() {
      install -d ${D}${sysconfdir}/udev/rules.d/
      install -m 0644 ${WORKDIR}/local.rules ${D}${sysconfdir}/udev/rules.d/
@@ -43,3 +62,21 @@ do_install:append() {
      install -d ${D}${sysconfdir}/systemd/
      install -m 0644 ${WORKDIR}/timesyncd.conf ${D}${sysconfdir}/systemd/
  }
+
+do_install:append:k3() {
+    install -d ${D}${libdir}/udev/rules.d
+    install -m 0644 ${WORKDIR}/${CAN_RULES_SRC} ${D}${CAN_RULES_TGT}
+}
+
+do_install:append:dra7xx() {
+    install -d ${D}${libdir}/udev/rules.d
+    install -m 0644 ${WORKDIR}/${CAN_RULES_SRC} ${D}${CAN_RULES_TGT}
+}
+
+do_install:append:ti33x() {
+    install -d ${D}${libdir}/udev/rules.d
+    install -m 0644 ${WORKDIR}/${CAN_RULES_SRC} ${D}${CAN_RULES_TGT}
+}
+
+FILES:udev += "${CAN_RULES_TGT}"
+
#2 lore raw
Quoted 16 lines · Andrew Davis
Quoted 6 lines · Aniket Limaye via lists.yoctoproject.org

When multiple CAN's are present, then names that are getting assigned change after every boot even after providing alias in the device tree.
So add udev rules to specify the interface name to use for each mcan device, to make it persistent across reboots.

Quoted 8 lines

---
v4:
     - Reformat patch to avoid repeated code for k3 devices
     - Add udev rules for dra7xx and ti33x too, as suggested
     - Still keeping separate files per platform to avoid potential confusion created by merging all the rules into one file

Quoted 5 lines

You can keep the rules in separate files, but you need to install them all unconditionally for all machines. Otherwise this package becomes machine specific, which we should avoid.

Andrew

Ahhh I misunderstood earlier then.... Yeah that makes sense. Sending a v5...

Aniket

Quoted 154 lines
Quoted 154 lines

v3: Fix typos in the filename being installed in v2
v2:
     - Switch to udev rules instead of systemd network links, as per feedback from v1: https://lists.yoctoproject.org/g/meta-arago/message/15104
     - Also, extend to Sitara devices as well
---
  .../systemd/systemd/37-can-am62.rules         |  4 ++ .../systemd/systemd/37-can-dra7.rules         |  2 + .../systemd/systemd/37-can-j7.rules           | 20 ++++++++++ .../systemd/systemd/37-can-ti33x.rules        |  2 + .../recipes-core/systemd/systemd_%.bbappend   | 37 +++++++++++++++++++

  5 files changed, 65 insertions(+)

  create mode 100644 meta-arago-distro/recipes-core/systemd/systemd/37-can-am62.rules create mode 100644 meta-arago-distro/recipes-core/systemd/systemd/37-can-dra7.rules create mode 100644 meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules create mode 100644 meta-arago-distro/recipes-core/systemd/systemd/37-can-ti33x.rules

meta-arago-distro/recipes-core/systemd/systemd/37-can-am62.rules new file +1 -0
new file mode 100644
index 00000000..59dc8075
@@ -0,0 +1,4 @@
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="4e08000.can", 

NAME="mcu_mcan0"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="4e18000.can", NAME="mcu_mcan1"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="20701000.can", NAME="main_mcan0"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="20711000.can", NAME="main_mcan1"

meta-arago-distro/recipes-core/systemd/systemd/37-can-dra7.rules new file +1 -0
new file mode 100644
index 00000000..3b14150d
@@ -0,0 +1,2 @@
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="4ae3c000.can", 

NAME="main_dcan1"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="48480000.can", NAME="main_dcan2"

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
new file mode 100644
index 00000000..f2804ecd
@@ -0,0 +1,20 @@
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="40528000.can", 

NAME="mcu_mcan0"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="40568000.can", NAME="mcu_mcan1"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2701000.can", NAME="main_mcan0"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2711000.can", NAME="main_mcan1"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2721000.can", NAME="main_mcan2"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2731000.can", NAME="main_mcan3"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2741000.can", NAME="main_mcan4"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2751000.can", NAME="main_mcan5"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2761000.can", NAME="main_mcan6"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2771000.can", NAME="main_mcan7"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2781000.can", NAME="main_mcan8"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2791000.can", NAME="main_mcan9"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="27a1000.can", NAME="main_mcan10"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="27b1000.can", NAME="main_mcan11"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="27c1000.can", NAME="main_mcan12"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="27d1000.can", NAME="main_mcan13"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2681000.can", NAME="main_mcan14"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2691000.can", NAME="main_mcan15"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="26a1000.can", NAME="main_mcan16"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="26b1000.can", NAME="main_mcan17"

meta-arago-distro/recipes-core/systemd/systemd/37-can-ti33x.rules new file +1 -0
new file mode 100644
index 00000000..62d650fe
@@ -0,0 +1,2 @@
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="481cc000.can", 

NAME="main_dcan0"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="481d0000.can", NAME="main_dcan1"

meta-arago-distro/recipes-core/systemd/systemd_%.bbappend +0 -0
index f38606f2..f9919708 100644
@@ -2,6 +2,21 @@ PR:append = ".arago7"

    FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" +CAN_RULES_SRC = ""

meta-arago-distro/recipes-core/systemd/systemd_%.bbappend +14 -0
+CAN_RULES_SRC:j721e = "37-can-j7.rules"
+CAN_RULES_SRC:j7200 = "37-can-j7.rules"
+CAN_RULES_SRC:j721s2 = "37-can-j7.rules"
+CAN_RULES_SRC:j784s4 = "37-can-j7.rules"
+CAN_RULES_SRC:am65xx = "37-can-j7.rules"
+CAN_RULES_SRC:am62xx = "37-can-am62.rules"
+CAN_RULES_SRC:am62pxx = "37-can-am62.rules"
+CAN_RULES_SRC:am62axx = "37-can-am62.rules"
+CAN_RULES_SRC:am64xx = "37-can-am62.rules"
+CAN_RULES_SRC:j722s = "37-can-am62.rules"
+CAN_RULES_SRC:dra7xx = "37-can-dra7.rules"
+CAN_RULES_SRC:ti33x = "37-can-ti33x.rules"
+CAN_RULES_TGT = "${libdir}/udev/rules.d/37-can.rules"
+

  SRC_URI:append = " \
      file://local.rules \
      file://usb1-rules.sh \

meta-arago-distro/recipes-core/systemd/systemd_%.bbappend +0 -0
@@ -14,6 +29,10 @@ SRC_URI:append = " \
       file://timesyncd.conf \

  "
  +SRC_URI:append:k3 = " file://${CAN_RULES_SRC}"

meta-arago-distro/recipes-core/systemd/systemd_%.bbappend +3 -0
+SRC_URI:append:dra7xx = " file://${CAN_RULES_SRC}"
+SRC_URI:append:ti33x = " file://${CAN_RULES_SRC}"
+

  do_install:append() {
      install -d ${D}${sysconfdir}/udev/rules.d/
      install -m 0644 ${WORKDIR}/local.rules ${D}${sysconfdir}/udev/rules.d/

meta-arago-distro/recipes-core/systemd/systemd_%.bbappend +0 -0
@@ -43,3 +62,21 @@ do_install:append() {

      install -d ${D}${sysconfdir}/systemd/
      install -m 0644 ${WORKDIR}/timesyncd.conf ${D}${sysconfdir}/systemd/ }

meta-arago-distro/recipes-core/systemd/systemd_%.bbappend +18 -0
+
+do_install:append:k3() {
+    install -d ${D}${libdir}/udev/rules.d
+    install -m 0644 ${WORKDIR}/${CAN_RULES_SRC} ${D}${CAN_RULES_TGT}
+}
+
+do_install:append:dra7xx() {
+    install -d ${D}${libdir}/udev/rules.d
+    install -m 0644 ${WORKDIR}/${CAN_RULES_SRC} ${D}${CAN_RULES_TGT}
+}
+
+do_install:append:ti33x() {
+    install -d ${D}${libdir}/udev/rules.d
+    install -m 0644 ${WORKDIR}/${CAN_RULES_SRC} ${D}${CAN_RULES_TGT}
+}
+
+FILES:udev += "${CAN_RULES_TGT}"
+
#3 lore raw
In reply to Andrew Davis

BTW, what about sysvinit support?

Quoted 147 lines · Andrew Davis via lists.yoctoproject.org
Quoted 6 lines · Aniket Limaye via lists.yoctoproject.org

When multiple CAN's are present, then names that are getting assigned change after every boot even after providing alias in the device tree.
So add udev rules to specify the interface name to use for each mcan device, to make it persistent across reboots.

Quoted 8 lines

---
v4:
- Reformat patch to avoid repeated code for k3 devices
- Add udev rules for dra7xx and ti33x too, as suggested
- Still keeping separate files per platform to avoid potential confusion created by merging all the rules into one file

You can keep the rules in separate files, but you need to install them all unconditionally for all machines. Otherwise this package becomes machine specific, which we should avoid.

Andrew

Quoted 125 lines

v3: Fix typos in the filename being installed in v2
v2:
- Switch to udev rules instead of systemd network links, as per feedback from v1: https://lists.yoctoproject.org/g/meta-arago/message/15104
- Also, extend to Sitara devices as well

---
 .../systemd/systemd/37-can-am62.rules         |  4 ++
 .../systemd/systemd/37-can-dra7.rules         |  2 +
 .../systemd/systemd/37-can-j7.rules           | 20 ++++++++++
 .../systemd/systemd/37-can-ti33x.rules        |  2 +
 .../recipes-core/systemd/systemd_%.bbappend   | 37 +++++++++++++++++++
 5 files changed, 65 insertions(+)
 create mode 100644 meta-arago-distro/recipes-core/systemd/systemd/37-can-am62.rules
 create mode 100644 meta-arago-distro/recipes-core/systemd/systemd/37-can-dra7.rules
 create mode 100644 meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules
 create mode 100644 meta-arago-distro/recipes-core/systemd/systemd/37-can-ti33x.rules
meta-arago-distro/recipes-core/systemd/systemd/37-can-am62.rules new file +4 -0
new file mode 100644
index 00000000..59dc8075
@@ -0,0 +1,4 @@
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="4e08000.can", NAME="mcu_mcan0"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="4e18000.can", NAME="mcu_mcan1"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="20701000.can", NAME="main_mcan0"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="20711000.can", NAME="main_mcan1"
meta-arago-distro/recipes-core/systemd/systemd/37-can-dra7.rules new file +2 -0
new file mode 100644
index 00000000..3b14150d
@@ -0,0 +1,2 @@
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="4ae3c000.can", NAME="main_dcan1"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="48480000.can", NAME="main_dcan2"
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +20 -0
new file mode 100644
index 00000000..f2804ecd
@@ -0,0 +1,20 @@
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="40528000.can", NAME="mcu_mcan0"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="40568000.can", NAME="mcu_mcan1"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2701000.can", NAME="main_mcan0"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2711000.can", NAME="main_mcan1"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2721000.can", NAME="main_mcan2"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2731000.can", NAME="main_mcan3"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2741000.can", NAME="main_mcan4"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2751000.can", NAME="main_mcan5"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2761000.can", NAME="main_mcan6"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2771000.can", NAME="main_mcan7"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2781000.can", NAME="main_mcan8"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2791000.can", NAME="main_mcan9"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="27a1000.can", NAME="main_mcan10"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="27b1000.can", NAME="main_mcan11"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="27c1000.can", NAME="main_mcan12"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="27d1000.can", NAME="main_mcan13"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2681000.can", NAME="main_mcan14"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2691000.can", NAME="main_mcan15"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="26a1000.can", NAME="main_mcan16"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="26b1000.can", NAME="main_mcan17"
meta-arago-distro/recipes-core/systemd/systemd/37-can-ti33x.rules new file +2 -0
new file mode 100644
index 00000000..62d650fe
@@ -0,0 +1,2 @@
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="481cc000.can", NAME="main_dcan0"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="481d0000.can", NAME="main_dcan1"
meta-arago-distro/recipes-core/systemd/systemd_%.bbappend +37 -0
index f38606f2..f9919708 100644
@@ -2,6 +2,21 @@ PR:append = ".arago7"
 FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+CAN_RULES_SRC = ""
+CAN_RULES_SRC:j721e = "37-can-j7.rules"
+CAN_RULES_SRC:j7200 = "37-can-j7.rules"
+CAN_RULES_SRC:j721s2 = "37-can-j7.rules"
+CAN_RULES_SRC:j784s4 = "37-can-j7.rules"
+CAN_RULES_SRC:am65xx = "37-can-j7.rules"
+CAN_RULES_SRC:am62xx = "37-can-am62.rules"
+CAN_RULES_SRC:am62pxx = "37-can-am62.rules"
+CAN_RULES_SRC:am62axx = "37-can-am62.rules"
+CAN_RULES_SRC:am64xx = "37-can-am62.rules"
+CAN_RULES_SRC:j722s = "37-can-am62.rules"
+CAN_RULES_SRC:dra7xx = "37-can-dra7.rules"
+CAN_RULES_SRC:ti33x = "37-can-ti33x.rules"
+CAN_RULES_TGT = "${libdir}/udev/rules.d/37-can.rules"
+
 SRC_URI:append = " \
     file://local.rules \
     file://usb1-rules.sh \
@@ -14,6 +29,10 @@ SRC_URI:append = " \
     file://timesyncd.conf \
 "
+SRC_URI:append:k3 = " file://${CAN_RULES_SRC}"
+SRC_URI:append:dra7xx = " file://${CAN_RULES_SRC}"
+SRC_URI:append:ti33x = " file://${CAN_RULES_SRC}"
+
 do_install:append() {
     install -d ${D}${sysconfdir}/udev/rules.d/
     install -m 0644 ${WORKDIR}/local.rules ${D}${sysconfdir}/udev/rules.d/
@@ -43,3 +62,21 @@ do_install:append() {
     install -d ${D}${sysconfdir}/systemd/
     install -m 0644 ${WORKDIR}/timesyncd.conf ${D}${sysconfdir}/systemd/
 }
+
+do_install:append:k3() {
+    install -d ${D}${libdir}/udev/rules.d
+    install -m 0644 ${WORKDIR}/${CAN_RULES_SRC} ${D}${CAN_RULES_TGT}
+}
+
+do_install:append:dra7xx() {
+    install -d ${D}${libdir}/udev/rules.d
+    install -m 0644 ${WORKDIR}/${CAN_RULES_SRC} ${D}${CAN_RULES_TGT}
+}
+
+do_install:append:ti33x() {
+    install -d ${D}${libdir}/udev/rules.d
+    install -m 0644 ${WORKDIR}/${CAN_RULES_SRC} ${D}${CAN_RULES_TGT}
+}
+
+FILES:udev += "${CAN_RULES_TGT}"
+
#4 lore raw

I assume the question being how do we plan to handle images where sysvinit is used instead of systemd?

I do not have a lot of experience with sysvinit vs systemd or udev rules for that matter. Do you have any suggestions to make these naming conventions apply to both?

Regards,
Aniket

Quoted 150 lines · Denys Dmytriyenko

BTW, what about sysvinit support?

Quoted 146 lines · Andrew Davis via lists.yoctoproject.org
Quoted 6 lines · Aniket Limaye via lists.yoctoproject.org

When multiple CAN's are present, then names that are getting assigned change after every boot even after providing alias in the device tree.
So add udev rules to specify the interface name to use for each mcan device, to make it persistent across reboots.

Quoted 8 lines

---
v4:
- Reformat patch to avoid repeated code for k3 devices
- Add udev rules for dra7xx and ti33x too, as suggested
- Still keeping separate files per platform to avoid potential confusion created by merging all the rules into one file

You can keep the rules in separate files, but you need to install them all unconditionally for all machines. Otherwise this package becomes machine specific, which we should avoid.

Andrew

Quoted 125 lines

v3: Fix typos in the filename being installed in v2
v2:
- Switch to udev rules instead of systemd network links, as per feedback from v1: https://lists.yoctoproject.org/g/meta-arago/message/15104
- Also, extend to Sitara devices as well

---
  .../systemd/systemd/37-can-am62.rules         |  4 ++
  .../systemd/systemd/37-can-dra7.rules         |  2 +
  .../systemd/systemd/37-can-j7.rules           | 20 ++++++++++
  .../systemd/systemd/37-can-ti33x.rules        |  2 +
  .../recipes-core/systemd/systemd_%.bbappend   | 37 +++++++++++++++++++
  5 files changed, 65 insertions(+)

create mode 100644 meta-arago-distro/recipes-core/systemd/systemd/37-can-am62.rules create mode 100644 meta-arago-distro/recipes-core/systemd/systemd/37-can-dra7.rules create mode 100644 meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules create mode 100644 meta-arago-distro/recipes-core/systemd/systemd/37-can-ti33x.rules

meta-arago-distro/recipes-core/systemd/systemd/37-can-am62.rules new file +4 -0
new file mode 100644
index 00000000..59dc8075
@@ -0,0 +1,4 @@
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="4e08000.can", NAME="mcu_mcan0"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="4e18000.can", NAME="mcu_mcan1"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="20701000.can", NAME="main_mcan0"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="20711000.can", NAME="main_mcan1"
meta-arago-distro/recipes-core/systemd/systemd/37-can-dra7.rules new file +2 -0
new file mode 100644
index 00000000..3b14150d
@@ -0,0 +1,2 @@
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="4ae3c000.can", NAME="main_dcan1"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="48480000.can", NAME="main_dcan2"
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +20 -0
new file mode 100644
index 00000000..f2804ecd
@@ -0,0 +1,20 @@
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="40528000.can", NAME="mcu_mcan0"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="40568000.can", NAME="mcu_mcan1"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2701000.can", NAME="main_mcan0"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2711000.can", NAME="main_mcan1"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2721000.can", NAME="main_mcan2"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2731000.can", NAME="main_mcan3"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2741000.can", NAME="main_mcan4"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2751000.can", NAME="main_mcan5"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2761000.can", NAME="main_mcan6"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2771000.can", NAME="main_mcan7"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2781000.can", NAME="main_mcan8"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2791000.can", NAME="main_mcan9"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="27a1000.can", NAME="main_mcan10"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="27b1000.can", NAME="main_mcan11"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="27c1000.can", NAME="main_mcan12"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="27d1000.can", NAME="main_mcan13"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2681000.can", NAME="main_mcan14"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2691000.can", NAME="main_mcan15"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="26a1000.can", NAME="main_mcan16"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="26b1000.can", NAME="main_mcan17"
meta-arago-distro/recipes-core/systemd/systemd/37-can-ti33x.rules new file +2 -0
new file mode 100644
index 00000000..62d650fe
@@ -0,0 +1,2 @@
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="481cc000.can", NAME="main_dcan0"
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="481d0000.can", NAME="main_dcan1"
meta-arago-distro/recipes-core/systemd/systemd_%.bbappend +37 -0
index f38606f2..f9919708 100644
@@ -2,6 +2,21 @@ PR:append = ".arago7"
  FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+CAN_RULES_SRC = ""
+CAN_RULES_SRC:j721e = "37-can-j7.rules"
+CAN_RULES_SRC:j7200 = "37-can-j7.rules"
+CAN_RULES_SRC:j721s2 = "37-can-j7.rules"
+CAN_RULES_SRC:j784s4 = "37-can-j7.rules"
+CAN_RULES_SRC:am65xx = "37-can-j7.rules"
+CAN_RULES_SRC:am62xx = "37-can-am62.rules"
+CAN_RULES_SRC:am62pxx = "37-can-am62.rules"
+CAN_RULES_SRC:am62axx = "37-can-am62.rules"
+CAN_RULES_SRC:am64xx = "37-can-am62.rules"
+CAN_RULES_SRC:j722s = "37-can-am62.rules"
+CAN_RULES_SRC:dra7xx = "37-can-dra7.rules"
+CAN_RULES_SRC:ti33x = "37-can-ti33x.rules"
+CAN_RULES_TGT = "${libdir}/udev/rules.d/37-can.rules"
+
  SRC_URI:append = " \
      file://local.rules \
      file://usb1-rules.sh \
@@ -14,6 +29,10 @@ SRC_URI:append = " \
      file://timesyncd.conf \
  "
+SRC_URI:append:k3 = " file://${CAN_RULES_SRC}"
+SRC_URI:append:dra7xx = " file://${CAN_RULES_SRC}"
+SRC_URI:append:ti33x = " file://${CAN_RULES_SRC}"
+
  do_install:append() {
      install -d ${D}${sysconfdir}/udev/rules.d/
      install -m 0644 ${WORKDIR}/local.rules ${D}${sysconfdir}/udev/rules.d/
@@ -43,3 +62,21 @@ do_install:append() {
      install -d ${D}${sysconfdir}/systemd/
      install -m 0644 ${WORKDIR}/timesyncd.conf ${D}${sysconfdir}/systemd/
  }
+
+do_install:append:k3() {
+    install -d ${D}${libdir}/udev/rules.d
+    install -m 0644 ${WORKDIR}/${CAN_RULES_SRC} ${D}${CAN_RULES_TGT}
+}
+
+do_install:append:dra7xx() {
+    install -d ${D}${libdir}/udev/rules.d
+    install -m 0644 ${WORKDIR}/${CAN_RULES_SRC} ${D}${CAN_RULES_TGT}
+}
+
+do_install:append:ti33x() {
+    install -d ${D}${libdir}/udev/rules.d
+    install -m 0644 ${WORKDIR}/${CAN_RULES_SRC} ${D}${CAN_RULES_TGT}
+}
+
+FILES:udev += "${CAN_RULES_TGT}"
+
#5 lore raw

I think the current issue is that we are bbappend-ing a systemd recipe now to install the udev rules. Perhaps there is a udev recipe that should be bbappended instead?

Quoted 222 lines · Aniket Limaye via lists.yoctoproject.org

I assume the question being how do we plan to handle images where sysvinit is used instead of systemd?

I do not have a lot of experience with sysvinit vs systemd or udev rules for that matter. Do you have any suggestions to make these naming conventions apply to both?

Regards,
Aniket

Quoted 4 lines · Denys Dmytriyenko

BTW, what about sysvinit support?

On Thu, Feb 08, 2024 at 01:28:47PM -0600, Andrew Davis via

Quoted 19 lines · lists.yoctoproject.org
Quoted 19 lines · Aniket Limaye via lists.yoctoproject.org
Quoted 6 lines

When multiple CAN's are present, then names that are getting assigned change after every boot even after providing alias in the device tree.
So add udev rules to specify the interface name to use for each mcan device, to make it persistent across reboots.

Quoted 8 lines

---
v4:
- Reformat patch to avoid repeated code for k3 devices
- Add udev rules for dra7xx and ti33x too, as suggested
- Still keeping separate files per platform to avoid potential confusion created by merging all the rules into one file

You can keep the rules in separate files, but you need to install them all unconditionally for all machines. Otherwise this package becomes machine specific, which we should avoid.

Quoted 6 lines
Quoted 6 lines

Andrew

Quoted 4 lines

v3: Fix typos in the filename being installed in v2
v2:
- Switch to udev rules instead of systemd network links, as per feedback from v1:

https://lists.yoctoproject.org/g/meta-arago/message/15104

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

- Also, extend to Sitara devices as well

---
  .../systemd/systemd/37-can-am62.rules         |  4 ++
  .../systemd/systemd/37-can-dra7.rules         |  2 +
  .../systemd/systemd/37-can-j7.rules           | 20 ++++++++++
  .../systemd/systemd/37-can-ti33x.rules        |  2 +
  .../recipes-core/systemd/systemd_%.bbappend   | 37

+++++++++++++++++++

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
  5 files changed, 65 insertions(+)

create mode 100644

meta-arago-distro/recipes-core/systemd/systemd/37-can-am62.rules

Quoted 1 line
Quoted 1 line
Quoted 1 line

create mode 100644

meta-arago-distro/recipes-core/systemd/systemd/37-can-dra7.rules

Quoted 1 line
Quoted 1 line
Quoted 1 line

create mode 100644

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules

Quoted 1 line
Quoted 1 line
Quoted 1 line

create mode 100644

meta-arago-distro/recipes-core/systemd/systemd/37-can-ti33x.rules

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

diff --git

a/meta-arago-distro/recipes-core/systemd/systemd/37-can-am62.rules b/meta-arago-distro/recipes-core/systemd/systemd/37-can-am62.rules

Quoted 6 lines
Quoted 6 lines

meta-arago-distro/recipes-core/systemd/systemd/37-can-am62.rules line 1

Quoted 6 lines

new file mode 100644
index 00000000..59dc8075

meta-arago-distro/recipes-core/systemd/systemd/37-can-am62.rules new file +1 -0
@@ -0,0 +1,4 @@
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="4e08000.can",

NAME="mcu_mcan0"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-am62.rules line 2

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-am62.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="4e18000.can",

NAME="mcu_mcan1"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-am62.rules line 3

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-am62.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="20701000.can",

NAME="main_mcan0"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-am62.rules line 4

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-am62.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="20711000.can",

NAME="main_mcan1"

Quoted 1 line
Quoted 1 line
Quoted 1 line

diff --git

a/meta-arago-distro/recipes-core/systemd/systemd/37-can-dra7.rules b/meta-arago-distro/recipes-core/systemd/systemd/37-can-dra7.rules

Quoted 6 lines
Quoted 6 lines

meta-arago-distro/recipes-core/systemd/systemd/37-can-dra7.rules line 1

Quoted 6 lines

new file mode 100644
index 00000000..3b14150d

meta-arago-distro/recipes-core/systemd/systemd/37-can-dra7.rules new file +1 -0
@@ -0,0 +1,2 @@
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="4ae3c000.can",

NAME="main_dcan1"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-dra7.rules line 2

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-dra7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="48480000.can",

NAME="main_dcan2"

Quoted 1 line
Quoted 1 line
Quoted 1 line

diff --git

a/meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules b/meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules

Quoted 6 lines
Quoted 6 lines

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 1

Quoted 6 lines

new file mode 100644
index 00000000..f2804ecd

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
@@ -0,0 +1,20 @@
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="40528000.can",

NAME="mcu_mcan0"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 2

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="40568000.can",

NAME="mcu_mcan1"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 3

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2701000.can",

NAME="main_mcan0"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 4

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2711000.can",

NAME="main_mcan1"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 5

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2721000.can",

NAME="main_mcan2"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 6

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2731000.can",

NAME="main_mcan3"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 7

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2741000.can",

NAME="main_mcan4"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 8

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2751000.can",

NAME="main_mcan5"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 9

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2761000.can",

NAME="main_mcan6"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 10

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2771000.can",

NAME="main_mcan7"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 11

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2781000.can",

NAME="main_mcan8"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 12

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2791000.can",

NAME="main_mcan9"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 13

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="27a1000.can",

NAME="main_mcan10"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 14

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="27b1000.can",

NAME="main_mcan11"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 15

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="27c1000.can",

NAME="main_mcan12"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 16

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="27d1000.can",

NAME="main_mcan13"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 17

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2681000.can",

NAME="main_mcan14"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 18

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2691000.can",

NAME="main_mcan15"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 19

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="26a1000.can",

NAME="main_mcan16"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 20

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="26b1000.can",

NAME="main_mcan17"

Quoted 1 line
Quoted 1 line
Quoted 1 line

diff --git

a/meta-arago-distro/recipes-core/systemd/systemd/37-can-ti33x.rules b/meta-arago-distro/recipes-core/systemd/systemd/37-can-ti33x.rules

Quoted 6 lines
Quoted 6 lines

meta-arago-distro/recipes-core/systemd/systemd/37-can-ti33x.rules line 1

Quoted 6 lines

new file mode 100644
index 00000000..62d650fe

meta-arago-distro/recipes-core/systemd/systemd/37-can-ti33x.rules new file +1 -0
@@ -0,0 +1,2 @@
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="481cc000.can",

NAME="main_dcan0"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-ti33x.rules line 2

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-ti33x.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="481d0000.can",

NAME="main_dcan1"

Quoted 1 line
Quoted 1 line

Review

Quoted 1 line
(quoted diff) +0 -0

b/meta-arago-distro/recipes-core/systemd/systemd_%.bbappend

Quoted 25 lines
Quoted 25 lines
Quoted 25 lines

index f38606f2..f9919708 100644

meta-arago-distro/recipes-core/systemd/systemd_%.bbappend +15 -0
@@ -2,6 +2,21 @@ PR:append = ".arago7"
  FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+CAN_RULES_SRC = ""
+CAN_RULES_SRC:j721e = "37-can-j7.rules"
+CAN_RULES_SRC:j7200 = "37-can-j7.rules"
+CAN_RULES_SRC:j721s2 = "37-can-j7.rules"
+CAN_RULES_SRC:j784s4 = "37-can-j7.rules"
+CAN_RULES_SRC:am65xx = "37-can-j7.rules"
+CAN_RULES_SRC:am62xx = "37-can-am62.rules"
+CAN_RULES_SRC:am62pxx = "37-can-am62.rules"
+CAN_RULES_SRC:am62axx = "37-can-am62.rules"
+CAN_RULES_SRC:am64xx = "37-can-am62.rules"
+CAN_RULES_SRC:j722s = "37-can-am62.rules"
+CAN_RULES_SRC:dra7xx = "37-can-dra7.rules"
+CAN_RULES_SRC:ti33x = "37-can-ti33x.rules"
+CAN_RULES_TGT = "${libdir}/udev/rules.d/37-can.rules"
+
  SRC_URI:append = " \
      file://local.rules \
      file://usb1-rules.sh \
@@ -14,6 +29,10 @@ SRC_URI:append = " \
      file://timesyncd.conf \
Quoted 8 lines
Quoted 8 lines

meta-arago-distro/recipes-core/systemd/systemd_%.bbappend SRC_URI:append = " \

Quoted 8 lines
meta-arago-distro/recipes-core/systemd/systemd_%.bbappend +4 -0
  "
+SRC_URI:append:k3 = " file://${CAN_RULES_SRC}"
+SRC_URI:append:dra7xx = " file://${CAN_RULES_SRC}"
+SRC_URI:append:ti33x = " file://${CAN_RULES_SRC}"
+
  do_install:append() {
      install -d ${D}${sysconfdir}/udev/rules.d/
      install -m 0644 ${WORKDIR}/local.rules

${D}${sysconfdir}/udev/rules.d/

Quoted 3 lines
Quoted 3 lines

meta-arago-distro/recipes-core/systemd/systemd_%.bbappend do_install:append() { · line 63

Quoted 3 lines
meta-arago-distro/recipes-core/systemd/systemd_%.bbappend +0 -0
@@ -43,3 +62,21 @@ do_install:append() {
      install -d ${D}${sysconfdir}/systemd/
      install -m 0644 ${WORKDIR}/timesyncd.conf

${D}${sysconfdir}/systemd/

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
meta-arago-distro/recipes-core/systemd/systemd_%.bbappend +10 -0
  }
+
+do_install:append:k3() {
+    install -d ${D}${libdir}/udev/rules.d
+    install -m 0644 ${WORKDIR}/${CAN_RULES_SRC} ${D}${CAN_RULES_TGT}
+}
+
+do_install:append:dra7xx() {
+    install -d ${D}${libdir}/udev/rules.d
+    install -m 0644 ${WORKDIR}/${CAN_RULES_SRC} ${D}${CAN_RULES_TGT}
+}
Quoted 8 lines
Quoted 8 lines

meta-arago-distro/recipes-core/systemd/systemd_%.bbappend do_install:append() { · line 82

Quoted 8 lines
meta-arago-distro/recipes-core/systemd/systemd_%.bbappend +8 -0
+
+do_install:append:ti33x() {
+    install -d ${D}${libdir}/udev/rules.d
+    install -m 0644 ${WORKDIR}/${CAN_RULES_SRC} ${D}${CAN_RULES_TGT}
+}
+
+FILES:udev += "${CAN_RULES_TGT}"
+

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#15201):
https://lists.yoctoproject.org/g/meta-arago/message/15201
Mute This Topic: https://lists.yoctoproject.org/mt/104244496/7902621
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-arago/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

A message that is not in the archive (sent off-list or not yet received): [email protected]

#7 lore raw

This is probably a better recipe to bbappend, sources/oe-core/meta/recipes-core/udev/udev-extraconf_1.1.bb

Quoted 239 lines · Jon Cormier via lists.yoctoproject.org

I think the current issue is that we are bbappend-ing a systemd recipe now to install the udev rules. Perhaps there is a udev recipe that should be bbappended instead?

Quoted 56 lines · Aniket Limaye via lists.yoctoproject.org

I assume the question being how do we plan to handle images where sysvinit is used instead of systemd?

I do not have a lot of experience with sysvinit vs systemd or udev rules for that matter. Do you have any suggestions to make these naming conventions apply to both?

Regards,
Aniket

Quoted 4 lines · Denys Dmytriyenko

BTW, what about sysvinit support?

On Thu, Feb 08, 2024 at 01:28:47PM -0600, Andrew Davis via

Quoted 19 lines · lists.yoctoproject.org
Quoted 19 lines · Aniket Limaye via lists.yoctoproject.org
Quoted 6 lines

When multiple CAN's are present, then names that are getting assigned change after every boot even after providing alias in the device tree.
So add udev rules to specify the interface name to use for each mcan device, to make it persistent across reboots.

Quoted 8 lines

---
v4:
- Reformat patch to avoid repeated code for k3 devices
- Add udev rules for dra7xx and ti33x too, as suggested
- Still keeping separate files per platform to avoid potential confusion created by merging all the rules into one file

You can keep the rules in separate files, but you need to install them all unconditionally for all machines. Otherwise this package becomes machine specific, which we should avoid.

Quoted 6 lines
Quoted 6 lines

Andrew

Quoted 4 lines

v3: Fix typos in the filename being installed in v2
v2:
- Switch to udev rules instead of systemd network links, as per feedback from v1:

https://lists.yoctoproject.org/g/meta-arago/message/15104

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

- Also, extend to Sitara devices as well

---
  .../systemd/systemd/37-can-am62.rules         |  4 ++
  .../systemd/systemd/37-can-dra7.rules         |  2 +
  .../systemd/systemd/37-can-j7.rules           | 20 ++++++++++
  .../systemd/systemd/37-can-ti33x.rules        |  2 +
  .../recipes-core/systemd/systemd_%.bbappend   | 37

+++++++++++++++++++

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
  5 files changed, 65 insertions(+)

create mode 100644

meta-arago-distro/recipes-core/systemd/systemd/37-can-am62.rules

Quoted 1 line
Quoted 1 line
Quoted 1 line

create mode 100644

meta-arago-distro/recipes-core/systemd/systemd/37-can-dra7.rules

Quoted 12 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

create mode 100644

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules

Quoted 1 line
Quoted 1 line
Quoted 1 line

create mode 100644

meta-arago-distro/recipes-core/systemd/systemd/37-can-ti33x.rules

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

diff --git

a/meta-arago-distro/recipes-core/systemd/systemd/37-can-am62.rules b/meta-arago-distro/recipes-core/systemd/systemd/37-can-am62.rules

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

new file mode 100644
index 00000000..59dc8075
--- /dev/null
+++

b/meta-arago-distro/recipes-core/systemd/systemd/37-can-am62.rules

Quoted 4 lines
Quoted 2 lines
Quoted 2 lines

Review line 1

Quoted 2 lines
(quoted diff) +1 -0
@@ -0,0 +1,4 @@
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="4e08000.can",

NAME="mcu_mcan0"

Quoted 1 line
Quoted 1 line

Review line 2

Quoted 1 line
(quoted diff) +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="4e18000.can",
Quoted 12 lines

NAME="mcu_mcan1"

Quoted 1 line
Quoted 1 line

Review line 3

Quoted 1 line
(quoted diff) +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="20701000.can",

NAME="main_mcan0"

Quoted 1 line
Quoted 1 line

Review line 4

Quoted 1 line
(quoted diff) +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="20711000.can",

NAME="main_mcan1"

Quoted 1 line
Quoted 1 line
Quoted 1 line

diff --git

a/meta-arago-distro/recipes-core/systemd/systemd/37-can-dra7.rules b/meta-arago-distro/recipes-core/systemd/systemd/37-can-dra7.rules

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

new file mode 100644
index 00000000..3b14150d
--- /dev/null
+++

b/meta-arago-distro/recipes-core/systemd/systemd/37-can-dra7.rules

Quoted 48 lines
Quoted 2 lines
Quoted 2 lines

Review line 1

Quoted 2 lines
(quoted diff) +1 -0
@@ -0,0 +1,2 @@
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="4ae3c000.can",

NAME="main_dcan1"

Quoted 1 line
Quoted 1 line

Review line 2

Quoted 1 line
(quoted diff) +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="48480000.can",

NAME="main_dcan2"

Quoted 1 line
Quoted 1 line
Quoted 1 line

diff --git

a/meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules b/meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules

Quoted 6 lines
Quoted 6 lines

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 1

Quoted 6 lines

new file mode 100644
index 00000000..f2804ecd

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
@@ -0,0 +1,20 @@
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="40528000.can",

NAME="mcu_mcan0"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 2

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="40568000.can",

NAME="mcu_mcan1"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 3

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2701000.can",

NAME="main_mcan0"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 4

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2711000.can",

NAME="main_mcan1"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 5

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2721000.can",

NAME="main_mcan2"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 6

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2731000.can",

NAME="main_mcan3"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 7

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2741000.can",

NAME="main_mcan4"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 8

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2751000.can",

NAME="main_mcan5"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 9

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2761000.can",

NAME="main_mcan6"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 10

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2771000.can",

NAME="main_mcan7"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 11

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2781000.can",

NAME="main_mcan8"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 12

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2791000.can",

NAME="main_mcan9"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 13

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="27a1000.can",

NAME="main_mcan10"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 14

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="27b1000.can",

NAME="main_mcan11"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 15

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="27c1000.can",

NAME="main_mcan12"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 16

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="27d1000.can",

NAME="main_mcan13"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 17

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2681000.can",

NAME="main_mcan14"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 18

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="2691000.can",
Quoted 12 lines

NAME="main_mcan15"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 19

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="26a1000.can",

NAME="main_mcan16"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 20

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="26b1000.can",

NAME="main_mcan17"

Quoted 1 line
Quoted 1 line
Quoted 1 line

diff --git

a/meta-arago-distro/recipes-core/systemd/systemd/37-can-ti33x.rules b/meta-arago-distro/recipes-core/systemd/systemd/37-can-ti33x.rules

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

new file mode 100644
index 00000000..62d650fe
--- /dev/null
+++

b/meta-arago-distro/recipes-core/systemd/systemd/37-can-ti33x.rules

Quoted 6 lines
Quoted 2 lines
Quoted 2 lines

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 1

Quoted 2 lines
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
@@ -0,0 +1,2 @@
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="481cc000.can",

NAME="main_dcan0"

Quoted 1 line
Quoted 1 line

meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules line 2

Quoted 1 line
meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules new file +1 -0
+SUBSYSTEM=="net", ACTION=="add", KERNELS=="481d0000.can",

NAME="main_dcan1"

Quoted 1 line
Quoted 1 line
Quoted 1 line

diff --git

a/meta-arago-distro/recipes-core/systemd/systemd_%.bbappend

Quoted 50 lines

b/meta-arago-distro/recipes-core/systemd/systemd_%.bbappend

Quoted 25 lines
Quoted 25 lines
Quoted 25 lines

index f38606f2..f9919708 100644

meta-arago-distro/recipes-core/systemd/systemd_%.bbappend +15 -0
@@ -2,6 +2,21 @@ PR:append = ".arago7"
  FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+CAN_RULES_SRC = ""
+CAN_RULES_SRC:j721e = "37-can-j7.rules"
+CAN_RULES_SRC:j7200 = "37-can-j7.rules"
+CAN_RULES_SRC:j721s2 = "37-can-j7.rules"
+CAN_RULES_SRC:j784s4 = "37-can-j7.rules"
+CAN_RULES_SRC:am65xx = "37-can-j7.rules"
+CAN_RULES_SRC:am62xx = "37-can-am62.rules"
+CAN_RULES_SRC:am62pxx = "37-can-am62.rules"
+CAN_RULES_SRC:am62axx = "37-can-am62.rules"
+CAN_RULES_SRC:am64xx = "37-can-am62.rules"
+CAN_RULES_SRC:j722s = "37-can-am62.rules"
+CAN_RULES_SRC:dra7xx = "37-can-dra7.rules"
+CAN_RULES_SRC:ti33x = "37-can-ti33x.rules"
+CAN_RULES_TGT = "${libdir}/udev/rules.d/37-can.rules"
+
  SRC_URI:append = " \
      file://local.rules \
      file://usb1-rules.sh \
@@ -14,6 +29,10 @@ SRC_URI:append = " \
      file://timesyncd.conf \
Quoted 8 lines
Quoted 8 lines

meta-arago-distro/recipes-core/systemd/systemd_%.bbappend SRC_URI:append = " \

Quoted 8 lines
meta-arago-distro/recipes-core/systemd/systemd_%.bbappend +4 -0
  "
+SRC_URI:append:k3 = " file://${CAN_RULES_SRC}"
+SRC_URI:append:dra7xx = " file://${CAN_RULES_SRC}"
+SRC_URI:append:ti33x = " file://${CAN_RULES_SRC}"
+
  do_install:append() {
      install -d ${D}${sysconfdir}/udev/rules.d/
      install -m 0644 ${WORKDIR}/local.rules

${D}${sysconfdir}/udev/rules.d/

Quoted 3 lines
Quoted 3 lines

meta-arago-distro/recipes-core/systemd/systemd_%.bbappend do_install:append() { · line 63

Quoted 3 lines
meta-arago-distro/recipes-core/systemd/systemd_%.bbappend +0 -0
@@ -43,3 +62,21 @@ do_install:append() {
      install -d ${D}${sysconfdir}/systemd/
      install -m 0644 ${WORKDIR}/timesyncd.conf

${D}${sysconfdir}/systemd/

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
meta-arago-distro/recipes-core/systemd/systemd_%.bbappend +10 -0
  }
+
+do_install:append:k3() {
+    install -d ${D}${libdir}/udev/rules.d
+    install -m 0644 ${WORKDIR}/${CAN_RULES_SRC} ${D}${CAN_RULES_TGT}
+}
+
+do_install:append:dra7xx() {
+    install -d ${D}${libdir}/udev/rules.d
+    install -m 0644 ${WORKDIR}/${CAN_RULES_SRC} ${D}${CAN_RULES_TGT}
+}
Quoted 14 lines
Quoted 8 lines
Quoted 8 lines

meta-arago-distro/recipes-core/systemd/systemd_%.bbappend do_install:append() { · line 82

Quoted 8 lines
meta-arago-distro/recipes-core/systemd/systemd_%.bbappend +8 -0
+
+do_install:append:ti33x() {
+    install -d ${D}${libdir}/udev/rules.d
+    install -m 0644 ${WORKDIR}/${CAN_RULES_SRC} ${D}${CAN_RULES_TGT}
+}
+
+FILES:udev += "${CAN_RULES_TGT}"
+

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#15202):
https://lists.yoctoproject.org/g/meta-arago/message/15202
Mute This Topic: https://lists.yoctoproject.org/mt/104244496/7902621
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-arago/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 12 lines
Jonathan Cormier
Software Engineer

Voice:  315.425.4045 x222



http://www.CriticalLink.com <http://www.criticallink.com/>
6712 Brooklawn Parkway, Syracuse, NY 13211

<https://www.linkedin.com/company/critical-link-llc>
<https://twitter.com/Critical_Link>
#8 lore raw
Quoted 1 line · Jon Cormier

This is probably a better recipe to bbappend, sources/oe-core/meta/recipes-core/udev/udev-extraconf_1.1.bb <http://udev-extraconf_1.1.bb>

That's not a bad idea.

Aniket, can you take a look and see if moving these changes over to that recipe allows us to support both systemd and sysvinint? Bear in mind, we have already accepted this patch series, so any changes would need to be a new patch.

Quoted 273 lines · On Sat, Feb 17, 2024 at 8:30 AM Jon Cormier via lists.yoctoproject.org…
    I think the current issue is that we are bbappend-ing a systemd
    recipe now
    to install the udev rules. Perhaps there is a udev recipe that should be
    bbappended instead?

    On Fri, Feb 16, 2024, 3:14 AM Aniket Limaye via
    lists.yoctoproject.org <http://lists.yoctoproject.org>
    <[email protected]
    <mailto:[email protected]>> wrote:

     > I assume the question being how do we plan to handle images where
     > sysvinit is used instead of systemd?
     >
     > I do not have a lot of experience with sysvinit vs systemd or
    udev rules
     > for that matter. Do you have any suggestions to make these naming
     > conventions apply to both?
     >
     > Regards,
     > Aniket
     >
     >
     > On 2/13/2024 11:10 PM, Denys Dmytriyenko wrote:
     > > BTW, what about sysvinit support?
     > >
     > >
     > > On Thu, Feb 08, 2024 at 01:28:47PM -0600, Andrew Davis via
     > lists.yoctoproject.org <http://lists.yoctoproject.org> wrote:
     > >> On 2/8/24 12:37 PM, Aniket Limaye via lists.yoctoproject.org
    <http://lists.yoctoproject.org> wrote:
     > >>> When multiple CAN's are present, then names that are getting
    assigned
     > >>> change after every boot even after providing alias in the device
     > >>> tree.
     > >>> So add udev rules to specify the interface name to use for
     > >>> each mcan device, to make it persistent across reboots.
     > >>>
     > >>> Signed-off-by: Bhavya Kapoor <[email protected]
    <mailto:[email protected]>>
     > >>> Signed-off-by: Aniket Limaye <[email protected]
    <mailto:[email protected]>>
     > >>> ---
     > >>> v4:
     > >>>      - Reformat patch to avoid repeated code for k3 devices
     > >>>      - Add udev rules for dra7xx and ti33x too, as suggested
     > >>>      - Still keeping separate files per platform to avoid
    potential
     > >>>        confusion created by merging all the rules into one file
     > >> You can keep the rules in separate files, but you need to install
     > >> them all unconditionally for all machines. Otherwise this package
     > >> becomes machine specific, which we should avoid.
     > >>
     > >> Andrew
     > >>
     > >>> v3: Fix typos in the filename being installed in v2
     > >>> v2:
     > >>>      - Switch to udev rules instead of systemd network links,
    as per
     > >>>        feedback from v1:
     > https://lists.yoctoproject.org/g/meta-arago/message/15104
    <https://lists.yoctoproject.org/g/meta-arago/message/15104>
     > >>>      - Also, extend to Sitara devices as well
     > >>> ---
     > >>>   .../systemd/systemd/37-can-am62.rules         |  4 ++
     > >>>   .../systemd/systemd/37-can-dra7.rules         |  2 +
     > >>>   .../systemd/systemd/37-can-j7.rules           | 20 ++++++++++
     > >>>   .../systemd/systemd/37-can-ti33x.rules        |  2 +
     > >>>   .../recipes-core/systemd/systemd_%.bbappend   | 37
     > +++++++++++++++++++
     > >>>   5 files changed, 65 insertions(+)
     > >>>   create mode 100644
     > meta-arago-distro/recipes-core/systemd/systemd/37-can-am62.rules
     > >>>   create mode 100644
     > meta-arago-distro/recipes-core/systemd/systemd/37-can-dra7.rules
     > >>>   create mode 100644
     > meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules
     > >>>   create mode 100644
     > meta-arago-distro/recipes-core/systemd/systemd/37-can-ti33x.rules
     > >>>
     > >>> diff --git
     > a/meta-arago-distro/recipes-core/systemd/systemd/37-can-am62.rules
     > b/meta-arago-distro/recipes-core/systemd/systemd/37-can-am62.rules
     > >>> new file mode 100644
     > >>> index 00000000..59dc8075
     > >>> --- /dev/null
     > >>> +++
    b/meta-arago-distro/recipes-core/systemd/systemd/37-can-am62.rules
     > >>> @@ -0,0 +1,4 @@
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="4e08000.can",
     > NAME="mcu_mcan0"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="4e18000.can",
     > NAME="mcu_mcan1"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="20701000.can",
     > NAME="main_mcan0"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="20711000.can",
     > NAME="main_mcan1"
     > >>> diff --git
     > a/meta-arago-distro/recipes-core/systemd/systemd/37-can-dra7.rules
     > b/meta-arago-distro/recipes-core/systemd/systemd/37-can-dra7.rules
     > >>> new file mode 100644
     > >>> index 00000000..3b14150d
     > >>> --- /dev/null
     > >>> +++
    b/meta-arago-distro/recipes-core/systemd/systemd/37-can-dra7.rules
     > >>> @@ -0,0 +1,2 @@
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="4ae3c000.can",
     > NAME="main_dcan1"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="48480000.can",
     > NAME="main_dcan2"
     > >>> diff --git
     > a/meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules
     > b/meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules
     > >>> new file mode 100644
     > >>> index 00000000..f2804ecd
     > >>> --- /dev/null
     > >>> +++
    b/meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules
     > >>> @@ -0,0 +1,20 @@
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="40528000.can",
     > NAME="mcu_mcan0"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="40568000.can",
     > NAME="mcu_mcan1"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="2701000.can",
     > NAME="main_mcan0"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="2711000.can",
     > NAME="main_mcan1"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="2721000.can",
     > NAME="main_mcan2"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="2731000.can",
     > NAME="main_mcan3"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="2741000.can",
     > NAME="main_mcan4"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="2751000.can",
     > NAME="main_mcan5"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="2761000.can",
     > NAME="main_mcan6"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="2771000.can",
     > NAME="main_mcan7"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="2781000.can",
     > NAME="main_mcan8"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="2791000.can",
     > NAME="main_mcan9"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="27a1000.can",
     > NAME="main_mcan10"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="27b1000.can",
     > NAME="main_mcan11"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="27c1000.can",
     > NAME="main_mcan12"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="27d1000.can",
     > NAME="main_mcan13"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="2681000.can",
     > NAME="main_mcan14"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="2691000.can",
     > NAME="main_mcan15"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="26a1000.can",
     > NAME="main_mcan16"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="26b1000.can",
     > NAME="main_mcan17"
     > >>> diff --git
     > a/meta-arago-distro/recipes-core/systemd/systemd/37-can-ti33x.rules
     > b/meta-arago-distro/recipes-core/systemd/systemd/37-can-ti33x.rules
     > >>> new file mode 100644
     > >>> index 00000000..62d650fe
     > >>> --- /dev/null
     > >>> +++
    b/meta-arago-distro/recipes-core/systemd/systemd/37-can-ti33x.rules
     > >>> @@ -0,0 +1,2 @@
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="481cc000.can",
     > NAME="main_dcan0"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="481d0000.can",
     > NAME="main_dcan1"
     > >>> diff --git
    a/meta-arago-distro/recipes-core/systemd/systemd_%.bbappend
     > b/meta-arago-distro/recipes-core/systemd/systemd_%.bbappend
     > >>> index f38606f2..f9919708 100644
     > >>> --- a/meta-arago-distro/recipes-core/systemd/systemd_%.bbappend
     > >>> +++ b/meta-arago-distro/recipes-core/systemd/systemd_%.bbappend
     > >>> @@ -2,6 +2,21 @@ PR:append = ".arago7"
     > >>>   FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
     > >>> +CAN_RULES_SRC = ""
     > >>> +CAN_RULES_SRC:j721e = "37-can-j7.rules"
     > >>> +CAN_RULES_SRC:j7200 = "37-can-j7.rules"
     > >>> +CAN_RULES_SRC:j721s2 = "37-can-j7.rules"
     > >>> +CAN_RULES_SRC:j784s4 = "37-can-j7.rules"
     > >>> +CAN_RULES_SRC:am65xx = "37-can-j7.rules"
     > >>> +CAN_RULES_SRC:am62xx = "37-can-am62.rules"
     > >>> +CAN_RULES_SRC:am62pxx = "37-can-am62.rules"
     > >>> +CAN_RULES_SRC:am62axx = "37-can-am62.rules"
     > >>> +CAN_RULES_SRC:am64xx = "37-can-am62.rules"
     > >>> +CAN_RULES_SRC:j722s = "37-can-am62.rules"
     > >>> +CAN_RULES_SRC:dra7xx = "37-can-dra7.rules"
     > >>> +CAN_RULES_SRC:ti33x = "37-can-ti33x.rules"
     > >>> +CAN_RULES_TGT = "${libdir}/udev/rules.d/37-can.rules"
     > >>> +
     > >>>   SRC_URI:append = " \
     > >>>       file://local.rules \
     > >>>       file://usb1-rules.sh \
     > >>> @@ -14,6 +29,10 @@ SRC_URI:append = " \
     > >>>       file://timesyncd.conf \
     > >>>   "
     > >>> +SRC_URI:append:k3 = " file://${CAN_RULES_SRC}"
     > >>> +SRC_URI:append:dra7xx = " file://${CAN_RULES_SRC}"
     > >>> +SRC_URI:append:ti33x = " file://${CAN_RULES_SRC}"
     > >>> +
     > >>>   do_install:append() {
     > >>>       install -d ${D}${sysconfdir}/udev/rules.d/
     > >>>       install -m 0644 ${WORKDIR}/local.rules
     > ${D}${sysconfdir}/udev/rules.d/
     > >>> @@ -43,3 +62,21 @@ do_install:append() {
     > >>>       install -d ${D}${sysconfdir}/systemd/
     > >>>       install -m 0644 ${WORKDIR}/timesyncd.conf
     > ${D}${sysconfdir}/systemd/
     > >>>   }
     > >>> +
     > >>> +do_install:append:k3() {
     > >>> +    install -d ${D}${libdir}/udev/rules.d
     > >>> +    install -m 0644 ${WORKDIR}/${CAN_RULES_SRC}
    ${D}${CAN_RULES_TGT}
     > >>> +}
     > >>> +
     > >>> +do_install:append:dra7xx() {
     > >>> +    install -d ${D}${libdir}/udev/rules.d
     > >>> +    install -m 0644 ${WORKDIR}/${CAN_RULES_SRC}
    ${D}${CAN_RULES_TGT}
     > >>> +}
     > >>> +
     > >>> +do_install:append:ti33x() {
     > >>> +    install -d ${D}${libdir}/udev/rules.d
     > >>> +    install -m 0644 ${WORKDIR}/${CAN_RULES_SRC}
    ${D}${CAN_RULES_TGT}
     > >>> +}
     > >>> +
     > >>> +FILES:udev += "${CAN_RULES_TGT}"
     > >>> +
     >
     >
     >
     >
     >
     >


    -=-=-=-=-=-=-=-=-=-=-=-
    Links: You receive all messages sent to this group.
    View/Reply Online (#15202):
    https://lists.yoctoproject.org/g/meta-arago/message/15202
    <https://lists.yoctoproject.org/g/meta-arago/message/15202>
    Mute This Topic: https://lists.yoctoproject.org/mt/104244496/7902621
    <https://lists.yoctoproject.org/mt/104244496/7902621>
    Group Owner: [email protected]
    <mailto:meta-arago%[email protected]>
    Unsubscribe: https://lists.yoctoproject.org/g/meta-arago/unsub
    <https://lists.yoctoproject.org/g/meta-arago/unsub>
    [[email protected] <mailto:[email protected]>]
    -=-=-=-=-=-=-=-=-=-=-=-
Signature · 11 lines
Jonathan Cormier
Software Engineer

Voice: 315.425.4045 x222



http://www.CriticalLink.com <http://www.criticallink.com/>
6712 Brooklawn Parkway, Syracuse, NY 13211

<https://www.linkedin.com/company/critical-link-llc> <https://twitter.com/Critical_Link>
Signature · 3 lines
Ryan Eatmon                [email protected]
-----------------------------------------
Texas Instruments, Inc.  -  LCPD  -  MGTS
#9 lore raw
Quoted 5 lines · Ryan Eatmon
Quoted 1 line · Jon Cormier

This is probably a better recipe to bbappend, sources/oe-core/meta/recipes-core/udev/udev-extraconf_1.1.bb <http://udev-extraconf_1.1.bb>

Jon,

Thanks for the suggestion!

Quoted 4 lines

That's not a bad idea.

Aniket, can you take a look and see if moving these changes over to that recipe allows us to support both systemd and sysvinint? Bear in mind, we have already accepted this patch series, so any changes would need to be a new patch.

Ryan,

Yeah sure... I can give it a shot, as a new patch.

Quoted 275 lines
Quoted 274 lines · On Sat, Feb 17, 2024 at 8:30 AM Jon Cormier via lists.yoctoproject.org…

    I think the current issue is that we are bbappend-ing a systemd recipe now
    to install the udev rules. Perhaps there is a udev recipe that should be bbappended instead?

    On Fri, Feb 16, 2024, 3:14 AM Aniket Limaye via lists.yoctoproject.org <http://lists.yoctoproject.org>
    <[email protected] <mailto:[email protected]>> wrote:

     > I assume the question being how do we plan to handle images where > sysvinit is used instead of systemd?
     >
     > I do not have a lot of experience with sysvinit vs systemd or udev rules
     > for that matter. Do you have any suggestions to make these naming > conventions apply to both?
     >
     > Regards,
     > Aniket
     >
     >
     > On 2/13/2024 11:10 PM, Denys Dmytriyenko wrote:
     > > BTW, what about sysvinit support?
     > >
     > >
     > > On Thu, Feb 08, 2024 at 01:28:47PM -0600, Andrew Davis via > lists.yoctoproject.org <http://lists.yoctoproject.org> wrote:
     > >> On 2/8/24 12:37 PM, Aniket Limaye via lists.yoctoproject.org
    <http://lists.yoctoproject.org> wrote:
     > >>> When multiple CAN's are present, then names that are getting assigned
     > >>> change after every boot even after providing alias in the device > >>> tree.
     > >>> So add udev rules to specify the interface name to use for > >>> each mcan device, to make it persistent across reboots. > >>>
     > >>> Signed-off-by: Bhavya Kapoor <[email protected] <mailto:[email protected]>>
     > >>> Signed-off-by: Aniket Limaye <[email protected] <mailto:[email protected]>>
     > >>> ---
     > >>> v4:
     > >>>      - Reformat patch to avoid repeated code for k3 devices > >>>      - Add udev rules for dra7xx and ti33x too, as suggested > >>>      - Still keeping separate files per platform to avoid potential
     > >>>        confusion created by merging all the rules into one file > >> You can keep the rules in separate files, but you need to install > >> them all unconditionally for all machines. Otherwise this package > >> becomes machine specific, which we should avoid.
     > >>
     > >> Andrew
     > >>
     > >>> v3: Fix typos in the filename being installed in v2 > >>> v2:
     > >>>      - Switch to udev rules instead of systemd network links, as per
     > >>>        feedback from v1:
     > https://lists.yoctoproject.org/g/meta-arago/message/15104
<https://lists.yoctoproject.org/g/meta-arago/message/15104>
     > >>>      - Also, extend to Sitara devices as well
     > >>> ---
     > >>>   .../systemd/systemd/37-can-am62.rules        |  4 ++ > >>>   .../systemd/systemd/37-can-dra7.rules        |  2 + > >>>   .../systemd/systemd/37-can-j7.rules        | 20 ++++++++++ > >>>   .../systemd/systemd/37-can-ti33x.rules       |  2 + > >>>  .../recipes-core/systemd/systemd_%.bbappend   | 37 > +++++++++++++++++++
     > >>>   5 files changed, 65 insertions(+)
     > >>>   create mode 100644
     > meta-arago-distro/recipes-core/systemd/systemd/37-can-am62.rules > >>>   create mode 100644
     > meta-arago-distro/recipes-core/systemd/systemd/37-can-dra7.rules > >>>   create mode 100644
     > meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules > >>>   create mode 100644
     > meta-arago-distro/recipes-core/systemd/systemd/37-can-ti33x.rules > >>>
     > >>> diff --git
     > a/meta-arago-distro/recipes-core/systemd/systemd/37-can-am62.rules > b/meta-arago-distro/recipes-core/systemd/systemd/37-can-am62.rules > >>> new file mode 100644
     > >>> index 00000000..59dc8075
     > >>> --- /dev/null
     > >>> +++ b/meta-arago-distro/recipes-core/systemd/systemd/37-can-am62.rules > >>> @@ -0,0 +1,4 @@
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="4e08000.can", > NAME="mcu_mcan0"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="4e18000.can", > NAME="mcu_mcan1"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="20701000.can", > NAME="main_mcan0"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="20711000.can", > NAME="main_mcan1"
     > >>> diff --git
     > a/meta-arago-distro/recipes-core/systemd/systemd/37-can-dra7.rules > b/meta-arago-distro/recipes-core/systemd/systemd/37-can-dra7.rules > >>> new file mode 100644
     > >>> index 00000000..3b14150d
     > >>> --- /dev/null
     > >>> +++ b/meta-arago-distro/recipes-core/systemd/systemd/37-can-dra7.rules > >>> @@ -0,0 +1,2 @@
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="4ae3c000.can", > NAME="main_dcan1"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="48480000.can", > NAME="main_dcan2"
     > >>> diff --git
     > a/meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules > b/meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules > >>> new file mode 100644
     > >>> index 00000000..f2804ecd
     > >>> --- /dev/null
     > >>> +++ b/meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules > >>> @@ -0,0 +1,20 @@
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="40528000.can", > NAME="mcu_mcan0"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="40568000.can", > NAME="mcu_mcan1"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="2701000.can", > NAME="main_mcan0"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="2711000.can", > NAME="main_mcan1"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="2721000.can", > NAME="main_mcan2"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="2731000.can", > NAME="main_mcan3"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="2741000.can", > NAME="main_mcan4"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="2751000.can", > NAME="main_mcan5"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="2761000.can", > NAME="main_mcan6"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="2771000.can", > NAME="main_mcan7"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="2781000.can", > NAME="main_mcan8"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="2791000.can", > NAME="main_mcan9"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="27a1000.can", > NAME="main_mcan10"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="27b1000.can", > NAME="main_mcan11"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="27c1000.can", > NAME="main_mcan12"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="27d1000.can", > NAME="main_mcan13"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="2681000.can", > NAME="main_mcan14"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="2691000.can", > NAME="main_mcan15"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="26a1000.can", > NAME="main_mcan16"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="26b1000.can", > NAME="main_mcan17"
     > >>> diff --git
     > a/meta-arago-distro/recipes-core/systemd/systemd/37-can-ti33x.rules > b/meta-arago-distro/recipes-core/systemd/systemd/37-can-ti33x.rules > >>> new file mode 100644
     > >>> index 00000000..62d650fe
     > >>> --- /dev/null
     > >>> +++ b/meta-arago-distro/recipes-core/systemd/systemd/37-can-ti33x.rules > >>> @@ -0,0 +1,2 @@
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="481cc000.can", > NAME="main_dcan0"
     > >>> +SUBSYSTEM=="net", ACTION=="add", KERNELS=="481d0000.can", > NAME="main_dcan1"
     > >>> diff --git a/meta-arago-distro/recipes-core/systemd/systemd_%.bbappend > b/meta-arago-distro/recipes-core/systemd/systemd_%.bbappend > >>> index f38606f2..f9919708 100644
     > >>> --- a/meta-arago-distro/recipes-core/systemd/systemd_%.bbappend > >>> +++ b/meta-arago-distro/recipes-core/systemd/systemd_%.bbappend > >>> @@ -2,6 +2,21 @@ PR:append = ".arago7"
     > >>>   FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
     > >>> +CAN_RULES_SRC = ""
     > >>> +CAN_RULES_SRC:j721e = "37-can-j7.rules"
     > >>> +CAN_RULES_SRC:j7200 = "37-can-j7.rules"
     > >>> +CAN_RULES_SRC:j721s2 = "37-can-j7.rules"
     > >>> +CAN_RULES_SRC:j784s4 = "37-can-j7.rules"
     > >>> +CAN_RULES_SRC:am65xx = "37-can-j7.rules"
     > >>> +CAN_RULES_SRC:am62xx = "37-can-am62.rules"
     > >>> +CAN_RULES_SRC:am62pxx = "37-can-am62.rules"
     > >>> +CAN_RULES_SRC:am62axx = "37-can-am62.rules"
     > >>> +CAN_RULES_SRC:am64xx = "37-can-am62.rules"
     > >>> +CAN_RULES_SRC:j722s = "37-can-am62.rules"
     > >>> +CAN_RULES_SRC:dra7xx = "37-can-dra7.rules"
     > >>> +CAN_RULES_SRC:ti33x = "37-can-ti33x.rules"
     > >>> +CAN_RULES_TGT = "${libdir}/udev/rules.d/37-can.rules" > >>> +
     > >>>   SRC_URI:append = " \
     > >>>       file://local.rules \
     > >>>       file://usb1-rules.sh \
     > >>> @@ -14,6 +29,10 @@ SRC_URI:append = " \
     > >>>       file://timesyncd.conf \
     > >>>   "
     > >>> +SRC_URI:append:k3 = " file://${CAN_RULES_SRC}"
     > >>> +SRC_URI:append:dra7xx = " file://${CAN_RULES_SRC}" > >>> +SRC_URI:append:ti33x = " file://${CAN_RULES_SRC}"
     > >>> +
     > >>>   do_install:append() {
     > >>>       install -d ${D}${sysconfdir}/udev/rules.d/
     > >>>       install -m 0644 ${WORKDIR}/local.rules
     > ${D}${sysconfdir}/udev/rules.d/
     > >>> @@ -43,3 +62,21 @@ do_install:append() {
     > >>>       install -d ${D}${sysconfdir}/systemd/
     > >>>       install -m 0644 ${WORKDIR}/timesyncd.conf
     > ${D}${sysconfdir}/systemd/
     > >>>   }
     > >>> +
     > >>> +do_install:append:k3() {
     > >>> +    install -d ${D}${libdir}/udev/rules.d
     > >>> +    install -m 0644 ${WORKDIR}/${CAN_RULES_SRC} ${D}${CAN_RULES_TGT}
     > >>> +}
     > >>> +
     > >>> +do_install:append:dra7xx() {
     > >>> +    install -d ${D}${libdir}/udev/rules.d
     > >>> +    install -m 0644 ${WORKDIR}/${CAN_RULES_SRC} ${D}${CAN_RULES_TGT}
     > >>> +}
     > >>> +
     > >>> +do_install:append:ti33x() {
     > >>> +    install -d ${D}${libdir}/udev/rules.d
     > >>> +    install -m 0644 ${WORKDIR}/${CAN_RULES_SRC} ${D}${CAN_RULES_TGT}
     > >>> +}
     > >>> +
     > >>> +FILES:udev += "${CAN_RULES_TGT}"
     > >>> +
     >
     >
     >
     >
     >
     >

    -=-=-=-=-=-=-=-=-=-=-=-
    Links: You receive all messages sent to this group. View/Reply Online (#15202):
    https://lists.yoctoproject.org/g/meta-arago/message/15202
<https://lists.yoctoproject.org/g/meta-arago/message/15202>
    Mute This Topic: https://lists.yoctoproject.org/mt/104244496/7902621
    <https://lists.yoctoproject.org/mt/104244496/7902621>
    Group Owner: [email protected] <mailto:meta-arago%[email protected]>
    Unsubscribe: https://lists.yoctoproject.org/g/meta-arago/unsub
    <https://lists.yoctoproject.org/g/meta-arago/unsub>
    [[email protected] <mailto:[email protected]>]
    -=-=-=-=-=-=-=-=-=-=-=-

Signature · 11 lines
Jonathan Cormier
Software Engineer

Voice: 315.425.4045 x222



http://www.CriticalLink.com <http://www.criticallink.com/>
6712 Brooklawn Parkway, Syracuse, NY 13211

<https://www.linkedin.com/company/critical-link-llc> <https://twitter.com/Critical_Link>