From: Thomas Bechtold <thomasbechtold@jpberlin.de>
To: linux-hotplug@vger.kernel.org
Subject: Re: How to trigger a udev rule
Date: Thu, 03 Mar 2011 09:52:03 +0000 [thread overview]
Message-ID: <4D6F64C3.20409@jpberlin.de> (raw)
In-Reply-To: <1299133287.2394.10.camel@salbei>
Hi Martin,
On 03/03/11 09:54, Martin Pitt wrote:
> Hello Thomas,
>
> funny that you ask, a few days ago someone asked exactly the same
> thing in #udev.
that was me:)
> Thomas Bechtold [2011-03-03 7:21 +0100]:
>> ### only check /dev/ttyS1 (atmel_usart.1) for modem ###
>> ACTION!="add|change", GOTO="mm_platform_device_whitelist_end"
>> SUBSYSTEM!="platform", GOTO="mm_platform_device_whitelist_end"
>> DRIVERS="atmel_usart",KERNELS="atmel_usart.1",ENV{ID_MM_PLATFORM_DRIVER_PROBE}="1"
>> LABEL="mm_platform_device_whitelist_end"
>
> I'm afraid udevadm trigger doesn't support the same parental matching
> as udev rules themselves do, so I don't think there can be a precise
> trigger unless you already know the corresponding /dev/ttySn device
> node. If you do, then just do
>
> udevadm trigger --sysname-match=ttySn
i know the device name. it's always ttyS1. But your trigger does not
match the rule:
# udevadm trigger --sysname-match=ttyS1 --verbose
/sys/devices/platform/atmel_usart.1/tty/ttyS1
I tried to do this with udevadm (modemmanager is running in background
and log is written to sdtout):
# udevadm trigger --actiond --subsystem-match=tty
--subsystem-match=platform --sysname-match=ttyS1 --verbose
/sys/devices/platform/atmel_usart.1/tty/ttyS1
Here, ModemManager does nothing.
When i execute the command with ttyS0, the output is:
# udevadm trigger --actiond --subsystem-match=tty
--subsystem-match=platform --sysname-match=ttyS0 --verbose
/sys/devices/platform/atmel_usart.1/tty/ttyS0
modem-manager[772]: <debug> [1299145393.216952] [mm-manager.c:802]
device_added(): (tty/ttyS0): port's parent platform driver is not
whitelisted
Here, ModemManager detects the trigger.
I think the question is how to set DRIVERS="atmel_usart" and
KERNELS="atmel_usart.1" !?
Cheers,
Tom
next prev parent reply other threads:[~2011-03-03 9:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-03 6:21 How to trigger a udev rule Thomas Bechtold
2011-03-03 6:36 ` Andrey Borzenkov
2011-03-03 6:49 ` J. Bakshi
2011-03-03 8:54 ` Martin Pitt
2011-03-03 9:52 ` Thomas Bechtold [this message]
2011-03-03 10:39 ` Andrey Borzenkov
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=4D6F64C3.20409@jpberlin.de \
--to=thomasbechtold@jpberlin.de \
--cc=linux-hotplug@vger.kernel.org \
/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 NNTP newsgroup(s).