From: Russell Neches Date: Sat, 15 May 2004 05:42:42 +0000 Subject: Re: 2.6.6/udev weirdness Message-Id: <20040515054242.GA12524@heliopause.vort.org> List-Id: References: <20040512235509.GA3836@heliopause.vort.org> In-Reply-To: <20040512235509.GA3836@heliopause.vort.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Thu, May 13, 2004 at 02:02:17PM -0700, Greg KH wrote: > On Thu, May 13, 2004 at 01:51:38PM -0400, Russell Neches wrote: > > > > The likely stupidity of the above rules notwithstanding, the > > > > underlying behavior of the system changed, and my rules broke. > > > > That shouldn't happen, even if the rules are dumb. This is a Bad > > > > Thing. > > > > > > Um, dumb rules are a Bad Thing, nothing we can do here about that > > > :) > > > > No doubt about that. My point is that dumb rules should probably > > continue to do the same dumb thing, at least if you're only moving > > between stable kernels. > > You didn't answer my question about the sg device. Did you change > your config between the two kernels? Perhaps the sg device is bound > to the device before the sd driver is now, which caused the change you > saw. Oh, I hadn't realized you asked a question. No, the configurations are identical. Otherwise, I would blamed that for the problem. > Either way, if you have a very general rule, like you had, expecting > it to work the same way all the time is nothing you can do, sorry. > > Again, make the rule a specific as you can to help prevent things like > this happening in the future. That much, I understand completely. What I don't understand is what constitutes a general rule and what constitutes a specific rule. My intention was to make it as specific as possible by matching the device's serial number. In this sense, the my original rule actually worked just fine (it only matched my USB memory stick, and not other things). The problem arose from the precedence of virtual devices associated with the (correctly matched) real device. Matching the name the kernel assigns seems to be _less_ specific, not more. So, clearly there is some subtlety required in one's approach to writing good rules. Can you offer any advice? Or, can you offer some examples of things that look right, but turn out to be "gotchas"? For instance, this document http://www.reactivated.net/udevrules.php mentions rules like BUS="scsi", SYSFS{manufacturer}="Tekom Technologies, Inc", NAME="%k" won't work because it combines information from different directories in sysfs. That's why I wrote the my rule the way I did -- because I thought it was necessary to avoid this problem. The example USB storage device rule from that HOWTO includes the KERNEL="sd*" parameter, but doesn't explain the rational for why it is necessary. (Now that I think of it, I did see this key when I wrote my rules, and left it out because it worked without it. By the time I got to 2.6.6, I'd forgotten all about it.) So, if I promise not to be grouchy about it, can you shed some light on how udev works as it pertains to writing good rules? I like udev. I think udev is cool. But, you have to admit that using it properly is still a bit mysterious. Russell ------------------------------------------------------- This SF.Net email is sponsored by: SourceForge.net Broadband Sign-up now for SourceForge Broadband and get the fastest 6.0/768 connection for only $19.95/mo for the first 3 months! http://ads.osdn.com/?ad_id%62&alloc_ida84&op=click _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel