linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alesh Slovak <alesh.slovak@avasys.jp>
To: linux-hotplug@vger.kernel.org
Subject: udev rules file validation
Date: Fri, 04 Sep 2009 00:06:55 +0000	[thread overview]
Message-ID: <4AA05A1F.2040009@avasys.jp> (raw)

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

             reply	other threads:[~2009-09-04  0:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-04  0:06 Alesh Slovak [this message]
2009-09-04  1:28 ` udev rules file validation 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AA05A1F.2040009@avasys.jp \
    --to=alesh.slovak@avasys.jp \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).