Udev rule from Yocto 1.8.1 no longer works in Yocto 2.2.2
(too old to reply)
Brian Hutchinson
2017-08-16 18:52:02 UTC
Raw Message

I have a case where I have basically a cold plugged USB based mass storage

This is an embedded application, so I do some magic with udev rules (not
using systemd yet which would make this easier from what I hear) to make
sure the device has e2fsck ran on it before it mounts.

To make a long story short, I have one "add" rule that adds the device
symlink and sets a user environment variable (lets call it my_usb_storage).

Later when init is running, I have a rc.local script that runs e2fsck on
the device if the expected symlink is present (udev enumerated it as we
expected) and when fsck returns with a clean status, a udevadm trigger
event fires and I have a matching rule that tests user set environment
variable ENV{my_usb_storage}=="1".

This testing of a user set environment variable used to work but now it

In researching the problem, I stumbled on this email in the archives:


... which clued me into maybe having to use a rule that does IMPORT{db}.
In trying to find info on IMPORT{db} I found the original commit of the


... which was done in 2010 but my udev from Yocto 1.8.1 is beyond udev 152
so don't know how I didn't run into this problem earlier.

So I still can't find any good examples or documentation on how to use
IMPORT{db} to get back the expected behavior I had before.

Ironnically my udevadm trigger that worked was also a "add" trigger and I
get the idea that I shouldn't have done that but I basically hacked the
standard mount.sh udev script to use with my special cold plugged device
and it won't mount unless it's a "add" even so that's why I did it.

Anybody know what I'm getting at here and how I can get my rules to work