Ah, yes good catch. Unfortunately it couldn't be something so simple
:(. I'm still getting the same behavior.
Amey, Geoff wrote:
I've since moved on to a different project, so I'm going from memory
here, but I believe that in the older versions of udev you might want
to use the single '=' sign in your rules files when checking the
'KERNEL' parameter.
------------------------------------------------------------------------
*From:* BJ Opp [mailto:[email protected]]
*Sent:* Tuesday, May 12, 2009 1:55 PM
*To:* Phil Quiney
*Cc:* Amey, Geoff; [email protected]
*Subject:* Re: How to know if a udev rule be executed?
Well after a long break, it's back to trying to figure out this udev
business. Using Phil's suggestions I verified that I was indeed
running version 56 of udev. After downloading and building (and
installing) version 57 on the target, I'm still having nothing but
problems trying to get udev to report anything during runtime when
inserting usb sticks.
The only time I can actually SEE that scripts get run is during the
creation of initial device nodes during bootup. Also, it seems that
the rpm information doesnt' get updated when doing a native
make/install of udev (as I really wouldn't expect it to), so when
running 'rpm -qf /sbin/udevd' I still get udev-0.056-3.0.1.0600975.
But when I do a direct version poll of udev, I get the expected
version of 57.
r...@dm355evm:~# udev -V
057
Digging further I tried to make use of udevtest but either things
aren't working right, or I'm not using the utility properly. The
following is the command line I used to run udevtest and a snip of the
rules file /etc/udev/rules.d/50-udev.rules with a few different RUN
scenarios.
------
r...@dm355evm:~# udevtest /sys/block/sda/
block
udevtest.c: looking at device '/block/sda/' from subsystem 'block'
udevtest.c: opened class_dev->name='sda'
udev_rules.c: no rule found, use kernel name 'sda'
udev_add.c: creating device node '/dev/sda', major = '8', minor = '0',
mode = '0660', uid = '0', gid = '0'
-------
******** snip of 50-udev.rules *******
#sd devices...namely usb thumb drives
KERNEL=="sd[a-z]1", RUN+="/bin/echo stick > /tmp/test.txt"
KERNEL=="sda", RUN+="/bin/echo blah"
KERNEL=="sda", RUN+="/bin/echo blah > /tmp/test.txt"
*********
I've gone through the kernel configuration and verified still that
CONFIG_HOTPLUG=y.
Sorry if this post was a bit erratic, I'm trying to give as much
information as possible because frankly I'm getting a bit frustrated
at this point.
BJ
Phil Quiney wrote:
Hi,
For udev (& anything else on the NFS root filesystem), you can use rpm to
tell you the package version.
It is a 2 step process, first find a binary or other file you want to find
the version of. Then query the rpm database to find which package it belongs to.
So for your example of udevd the process is
[email protected]:~# which udevd
/sbin/udevd
[email protected]:~# rpm -qf /sbin/udevd # You can alternatively use rpm
-qf `!!` if you like shortcuts
udev-0.056-3.0.1.0600975
..and as Geoff said, it is version 056.
Additionally, once you know the package name, you can get information about
the package (rpm -qi udev), list all files in the package (rpm -ql udev) and
verify the package integrity (rpm -V udev).
The above works on any RPM based linux distribution and can be a useful way
of finding your way around.
Regards
Phil Q
Phil Quiney, Senior Software Engineer
Trinity Convergence
Cambridge Business Park
Cowley Road
Cambridge CB4 0WZ, UK
T: +44(0)1223-435536
F: +44(0)1223-435560
www.trinityconvergence.com
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of bj
Sent: 29 September 2008 22:59
To: Amey, Geoff
Cc: [email protected]
Subject: Re: How to know if a udev rule be executed?
I'm trying to figure out exactly which version of udev I have with my
montavista distro. I try to run 'udevd --version' / 'udev --version'
but they just return me to the command prompt with no info at all. I made
sure to check that udev was indeed running with 'ps aux | grep udev' and it's
certainly there.
r...@dm355evm:~# udev --version
r...@dm355evm:~# udevd --version
r...@dm355evm:~# ps aux | grep udev
root 822 0.0 0.4 1416 388 ? S<s 00:00 0:00 udevd
root 1085 3.0 0.5 1572 456 ? S+ 00:02 0:00 grep udev
How did you figure out your version, and then also how did you update it
after realizing that your version wasn't up to snuff? The goal I'm trying to
reach here is to create a udev rule to mount usb flash drives upon insertion.
I saw the previous chatter about this topic and people claim that this issue
has been gone over and solved but I'm still having problems with it so please
don't direct me to 'just search the list'.
Thanks for any tips.
BJ
Amey, Geoff wrote:
Try looking into udevtest, I don't remember the exact sytax, but it
applies all of your udev rules to a particular /sys/ entry and prints
the result to the console.
Another thing to be aware of with udev is the version. The one that
came on my DM355 board was version 056, which doesn't support the RUN
keyword. I had to upgrade to 057 to use the RUN keyword. (udev is
currently somewhere around version 120). After downloading and cross
compiling 057 (udev, udevd, udevinfo, udevtest, etc...) I was able to
get my RUN rules to work.
Hope this helps
- Geoff
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On
Behalf Of John Wu
Sent: Tuesday, June 03, 2008 12:16 AM
To: [email protected]
Subject: How to know if a udev rule be executed?
I write a custom udev rule to auto mount the SD card, but it do not
mount the card when I plug in. I want to know if the rule be executed?
My rule content is:
RUN+="mount /dev/mmcblk0p1 /mnt"
I write a simplest rule with no condition the rule is named
/etc/udev/rules.d/60-local.rules
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source