From: Kay Sievers Date: Mon, 15 Aug 2005 13:40:20 +0000 Subject: Re: +rule: query device inode by Major and Minor - am i inventing brand new bycicle ? Message-Id: <20050815134020.GB24373@vrfy.org> List-Id: References: <4300318B.8040505@nm.ru> In-Reply-To: <4300318B.8040505@nm.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Mon, Aug 15, 2005 at 10:09:15AM +0400, Arioch wrote: > I made (and attached) a tiny rule, and hope it will be interesting to > some of you. > See attach. > I made it with two thought in background: > > 1) Some drivers with incomplete SYSFS support (namely, wbsd on my box) > publiches major and minor, but not the device inode name :-( > If i wantr to find it from script - how ? ls -lR | grep ? BRR! :-) Hate > RegExp's :-) You mean the device 'node', the file in /dev, right? What does publish major/minor mean? That the driver does not create an entry in /sys/block/*? > 2) On my box pktsetup (packet-mode CD-RW burning helper, part of > udfhelper) creates two block device per drive! I wanted to catch this. > After all it seems that it creates second inode by mknod, not kernel > call and UDEV. But surprisingly i saw a number of other duplicate inodes > with the identical major-minor What nodes exactly have the same major/minor? That setup may need to be fixed. > So, as i want to be famous, would You, please, considering including > this rule into UDEV examples ? :-) We don't provide a dead example file anymore. Nobody cared about that file, it was outdated and some people expected this as "the default" udev file and complained about the entries, so I just deleted it. Instead we carry a lot of distro rules as examples now. So you need to convince a distro to ship your rule to get it included. Good luck! :) > Ouugh, almost forgot to state a wish: > Can there be on more key for rules ? > Similar to RETURN, but matching not string form stdout, but the return > code of program ( $? ) ? You mean similar to "RESULT"? > Why - cause i wanted to do if/else/then. > I run a program to check if a symlink already exists - then i run > another program to check if it does not exists ! PROGRAM!="..." should catch non-zero exit's. You also can jump with GOTO="..." to a LABEL="..." line (see the persistent disk rules examples). > And i cannot use /bin/ls or /bin/readlink and then use RESULT - it puts > its output onto stderr if file not found, which seems to make UDEV > ignore that rule inn the future (i could not find this in man, but i > guess it is said somewhere on some wiki - but i'm still offline) . As > well, stderr is not intercepted and user sees that unpretty sign of my > sillyness :) > And i didn't want to create a separate file (bash script) for such a > simple task. Yes stderr is ignored. You will need to fork a shell for that to catch. > To end this mindflow, if i mentioned man's, i'd like to say that i saw a > typo in the "man udev". > When describing "=" operation, there is word "iNplicit" instead of > "iMplicit". If it is not my English - it is is a typo :-) Will fix that. Thanks! Thanks, Kay ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ 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