All of lore.kernel.org
 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

* Re: udev rules file validation
  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
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Marco d'Itri @ 2009-09-04  1:28 UTC (permalink / raw)
  To: linux-hotplug

On Sep 04, Alesh Slovak <alesh.slovak@avasys.jp> wrote:

> 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.
FYI, this has since been fixed.

-- 
ciao,
Marco

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

* Re: udev rules file validation
  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
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: clemens fischer @ 2009-09-04 21:30 UTC (permalink / raw)
  To: linux-hotplug

On Fri-2009/09/04-02:06 Alesh Slovak wrote:

> `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.

What is meant by "temp.conf simply points to a temporary directory
containing the candidate udev rules"?  I can find only the directives
"udev_root" and "udev_log" but none specifying the location of rule
files.


clemens


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

* Re: udev rules file validation
  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
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Alesh Slovak @ 2009-09-06 23:09 UTC (permalink / raw)
  To: linux-hotplug

clemens fischer wrote:
> On Fri-2009/09/04-02:06 Alesh Slovak wrote:
> 
>> `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.
> 
> What is meant by "temp.conf simply points to a temporary directory
> containing the candidate udev rules"?  I can find only the directives
> "udev_root" and "udev_log" but none specifying the location of rule
> files.

There is also a "udev_rules" directive. I create "temp.conf" that 
defines this to the same location as where I generate the udev rules 
file I wish to validate.

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

* Re: udev rules file validation
  2009-09-04  0:06 udev rules file validation Alesh Slovak
                   ` (2 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: Alesh Slovak @ 2009-09-15  8:00 UTC (permalink / raw)
  To: linux-hotplug

Marco d'Itri wrote:
>> 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.
> FYI, this has since been fixed.

Despite this being fixed, I would still like to be able to validate my 
generated udev rules files. Anyone have any ideas?

-- 
Alesh Slovak                    Linux Team -- AVASYS Corporation
alesh.slovak@avasys.jp          http://avasys.jp

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

* Re: udev rules file validation
  2009-09-04  0:06 udev rules file validation Alesh Slovak
                   ` (3 preceding siblings ...)
  2009-09-15  8:00 ` Alesh Slovak
@ 2009-09-15  8:54 ` Sujit K M
  2009-09-15 23:39 ` Alesh Slovak
  5 siblings, 0 replies; 7+ messages in thread
From: Sujit K M @ 2009-09-15  8:54 UTC (permalink / raw)
  To: linux-hotplug

I donot understand what you mean by validate. It could have several meanings.
For Example.
1. We could have something like XML/Document Validation. Much more
seen in SGML/XML Environment.
2. We could have Run Time Validation Like Certificates. Much More of
an RSS/Feed Environment/Web site Design.
3. We could have Validation of Resources. Having an inbuilt database
of the resources udev is trying to load/unload/link.
4. We could have validation of the functionality of the generated
script or an already present script.

By Validation what do you mean?



On Tue, Sep 15, 2009 at 1:30 PM, Alesh Slovak <alesh.slovak@avasys.jp> wrote:
> Marco d'Itri wrote:
>>>
>>> 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.
>>
>> FYI, this has since been fixed.
>
> Despite this being fixed, I would still like to be able to validate my
> generated udev rules files. Anyone have any ideas?
>
> --
> Alesh Slovak                    Linux Team -- AVASYS Corporation
> alesh.slovak@avasys.jp          http://avasys.jp
> --
> To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>



-- 
-- Sujit K M

blog(http://kmsujit.blogspot.com/)

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

* Re: udev rules file validation
  2009-09-04  0:06 udev rules file validation Alesh Slovak
                   ` (4 preceding siblings ...)
  2009-09-15  8:54 ` Sujit K M
@ 2009-09-15 23:39 ` Alesh Slovak
  5 siblings, 0 replies; 7+ messages in thread
From: Alesh Slovak @ 2009-09-15 23:39 UTC (permalink / raw)
  To: linux-hotplug

Sujit K M wrote:
> I donot understand what you mean by validate. It could have several meanings.
> For Example.
> 1. We could have something like XML/Document Validation. Much more
> seen in SGML/XML Environment.
> 2. We could have Run Time Validation Like Certificates. Much More of
> an RSS/Feed Environment/Web site Design.
> 3. We could have Validation of Resources. Having an inbuilt database
> of the resources udev is trying to load/unload/link.
> 4. We could have validation of the functionality of the generated
> script or an already present script.
> 
> By Validation what do you mean?
What I mean by validating udev rules files is probably closest to #1 
above. Because I generate udev rules automagically with a script at 
install time I would like to be sure that the rules files are formatted 
correctly before installing them on the system and potentially screwing 
things up (like happened before). I could write my own validation script 
but if there is a good way to validate rules files using udev itself, 
that would obviously be the better way to go.

Regards,
-- 
Alesh Slovak                    Linux Team -- AVASYS Corporation
alesh.slovak@avasys.jp          http://avasys.jp

^ 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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.