linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* udev rules file validation
@ 2009-09-04  0:06 Alesh Slovak
  2009-09-04  1:28 ` Marco d'Itri
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Alesh Slovak @ 2009-09-04  0:06 UTC (permalink / raw)
  To: linux-hotplug

Dear list,

I am a developer on iscan, which is a SANE driver and frontend for Epson
scanners.

We try to support the broadest range of distributions possible with our
packages. One of the ways in which we do this is by generating our udev
rules files automatically from existing rules files we find on the
system. Namely, rules files for other scanners that have been prepared
by the distribution. This also gives us the added benefit of following
distribution access policies without having to constantly keep up with them.

There seems to have been a change in udev recently that causes it to
abort if it encounters a broken rules file. This causes boot failures.
After this happened to iscan's packages with Debian testing, we became
aware of a bug in our generation script that had always been there, but
had gone unnoticed until the aforementioned changes were made to udev.

Of course, we fixed the bug, but in order to avoid this kind of problem 
in the future, I wanted to find a way to validate our udev rules files 
using udev itself, before actually installing them. I was able to come 
up with a fairly round-about way of validating a rules file using the 
output of the following command:
`UDEV_CONFIG_FILE=temp.conf udevadm test NULL`

The configuration file temp.conf simply points to a temporary directory 
containing the candidate udev rules file to avoid any possible 
interference from other rules files on the system. I used NULL for the 
device because I just want udev to load my rules file and tell me if 
there is anything wrong with it and `udevadm test` won't do anything 
unless I specify *something* for the device.

I wanted to get some opinions from the udev developers on this
admittedly somewhat flimsy method for udev rules file validation and 
whether there are any better ways to do this that I am overlooking. I 
would appreciate any comments or suggestions.

Regards,
Alesh

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-09-15 23:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-04  0:06 udev rules file validation Alesh Slovak
2009-09-04  1:28 ` Marco d'Itri
2009-09-04 21:30 ` clemens fischer
2009-09-06 23:09 ` Alesh Slovak
2009-09-15  8:00 ` Alesh Slovak
2009-09-15  8:54 ` Sujit K M
2009-09-15 23:39 ` Alesh Slovak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).