I'm trying to set up some udev rules in order to auto-mount USB drives in the system. First I mounted a USB drive to test how it would come up and ran
udevadm monitor --env
to check what events were thrown. I saw there was a block device being added for /dev/sda1:
KERNEL[5321.019898] add /devices/ocp.2/47400000.usb/47401400.usb/musb-hdrc.0.auto/usb1/1-1/1-1:1.0/host12/target12:0:0/12:0:0:0/block/sda/sda1 (block) ACTION=add DEVNAME=/dev/sda1 DEVPATH=/devices/ocp.2/47400000.usb/47401400.usb/musb-hdrc.0.auto/usb1/1-1/1-1:1.0/host12/target12:0:0/12:0:0:0/block/sda/sda1 DEVTYPE=partition MAJOR=8 MINOR=1 SEQNUM=1581 SUBSYSTEM=block
So I chose to write a quick rule to test this out. In /etc/udev/rules.d I made a new rule. I named it: 01-usbmount.rules. I chose the 01 so it would be the first selected rule. I made sure it was by running
udevadm test 01-usbmount.rules
This provided the list of rules that would be run and my rule was listed amongst the top of the list:
[root /etc/udev/rules.d]# udevadm test 01-usbmount.rules run_command: calling: test adm_test: version 182 This program is for debugging only, it does not run any program, specified by a RUN key. It may show incorrect results, because some values may be different, or not available at a simulation run. builtin_kmod_init: load module index add_matching_files: unable to open '/var/run/udev/rules.d': No such file or directory parse_file: reading '/etc/udev/rules.d/01-usbmount.rules' as rules file parse_file: reading '/lib/udev/rules.d/42-usb-hid-pm.rules' as rules file parse_file: reading '/lib/udev/rules.d/50-udev-default.rules' as rules file
The rule itself I made just a quick test. On any "block" device being "add"ed into the system I would create a symbolic link with a long obvious name so I could find it quickly. Here's the rule:
[root /etc/udev/rules.d]# cat 01-usbmount.rules # Run the mount rules for USB insertion ACTION=="add", SUBSYSTEMS=="block", SYMLINK+="helloooooo", MODE="0456"
When I insert a USB stick into my TI AM335x based board, I do not see this rule executed (no symlink shows up in /dev). Just to make sure I did everything correctly, I did the exact same thing on my Ubuntu development machine and tested out the rule. Everything worked and the symlink was created successfully.
What's wrong with the TI board? Does something need to be enabled to get udev to work?