<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div><div><div><div>Hi,<br><br></div>I have a case where I have basically a cold plugged USB based mass storage device.<br><br></div>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.<br><br></div>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).<br><br></div>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".<br><br></div>This testing of a user set environment variable used to work but now it doesn't.<br><br></div>In researching the problem, I stumbled on this email in the archives:<br><br><a href="https://lists.freedesktop.org/archives/systemd-devel/2013-December/015707.html">https://lists.freedesktop.org/archives/systemd-devel/2013-December/015707.html</a><br><br></div>... 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 feature???<br><br><a href="https://www.redhat.com/archives/lvm-devel/2010-April/msg00225.html">https://www.redhat.com/archives/lvm-devel/2010-April/msg00225.html</a><br><br></div>... 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.<br><br></div>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.<br><br></div>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.<br><br></div>Anybody know what I'm getting at here and how I can get my rules to work again???<br><br></div>Thanks!<br><br></div>Regards,<br><br></div>Brian<br><div><div><div><div><div><div><div><br></div></div></div></div></div></div></div></div>