From: "Limaye, Aniket" <a-limaye@ti.com>
To: Ryan Eatmon <reatmon@ti.com>, Jon Cormier <jcormier@criticallink.com>
Cc: Denys Dmytriyenko <denis@denix.org>, Davis <afd@ti.com>,
<meta-arago@lists.yoctoproject.org>,
Bhavya Kapoor <b-kapoor@ti.com>
Subject: Re: [meta-arago][kirkstone/master][PATCH v4] systemd: Add udev rules for persistent naming of the can devices
Date: Wed, 21 Feb 2024 11:30:55 +0530 [thread overview]
Message-ID: <b393231d-6b89-424a-bb7d-39afab2b340a@ti.com> (raw)
In-Reply-To: <c045325d-7a2c-4fee-83b9-0707301bc483@ti.com>
On 2/21/2024 2:23 AM, Ryan Eatmon wrote:
>
>
> On 2/20/2024 2:19 PM, Jon Cormier wrote:
>> 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!
> 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.
>
>> On Sat, Feb 17, 2024 at 8:30 AM Jon Cormier via
>> lists.yoctoproject.org <http://lists.yoctoproject.org>
>> <jcormier=criticallink.com@lists.yoctoproject.org
>> <mailto:criticallink.com@lists.yoctoproject.org>> wrote:
>>
>> 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>
>> <a-limaye=ti.com@lists.yoctoproject.org
>> <mailto:ti.com@lists.yoctoproject.org>> 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 <b-kapoor@ti.com
>> <mailto:b-kapoor@ti.com>>
>> > >>> Signed-off-by: Aniket Limaye <a-limaye@ti.com
>> <mailto:a-limaye@ti.com>>
>> > >>> ---
>> > >>> 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: meta-arago+owner@lists.yoctoproject.org
>> <mailto:meta-arago%2Bowner@lists.yoctoproject.org>
>> Unsubscribe: https://lists.yoctoproject.org/g/meta-arago/unsub
>> <https://lists.yoctoproject.org/g/meta-arago/unsub>
>> [jcormier@criticallink.com <mailto:jcormier@criticallink.com>]
>> -=-=-=-=-=-=-=-=-=-=-=-
>>
>>
>>
>>
>> --
>> 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>
>
prev parent reply other threads:[~2024-02-21 6:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-08 18:37 [meta-arago][kirkstone/master][PATCH v4] systemd: Add udev rules for persistent naming of the can devices Aniket Limaye
2024-02-08 19:28 ` Andrew Davis
2024-02-09 5:16 ` Limaye, Aniket
2024-02-13 17:40 ` Denys Dmytriyenko
2024-02-16 8:14 ` Limaye, Aniket
2024-02-17 13:30 ` Jon Cormier
[not found] ` <17B4A99ACD42F65A.28679@lists.yoctoproject.org>
2024-02-20 20:19 ` Jon Cormier
2024-02-20 20:53 ` Ryan Eatmon
2024-02-21 6:00 ` Limaye, Aniket [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b393231d-6b89-424a-bb7d-39afab2b340a@ti.com \
--to=a-limaye@ti.com \
--cc=afd@ti.com \
--cc=b-kapoor@ti.com \
--cc=denis@denix.org \
--cc=jcormier@criticallink.com \
--cc=meta-arago@lists.yoctoproject.org \
--cc=reatmon@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).