Hey all (especially packagers):

I want to make sure we have usable udev and policykit support in 0.21. I
have scripts that are roughly similar to the ones Doug posted here:
  https://rpm.silfreed.net:8002/file/9181b7d0c023/harmony/

But there's a couple situations I want to support, and more importantly, I
want things to work well for packagers. Here are the various things I'm
thinking about, and I'd like input:

   1. Not all distros use policykit, and whether or not you're using
      policykit changes your udev rules. This instantly creates the need to
      be able to generate two kinds of udev files.

   2. It's gotta (assuming the user knows if they use policykit) gotta "just
      work" with a "run this script as root to setup udev with the right
      argument"  (more on this later).

   3. If at all possible I'd like it to be something packagers use so they
      don't have to keep their udev and/or policykit scripts in sync.

So I'm wrote a script that works like this:

   gen_udev_support [-u|-p]

Where -u (udev-only) generates rules like:

   SYSFS{idVendor}=="046d", SYSFS{idProduct}=="c111", MODE="0660",
GROUP="dialout"

But -p (policykit) generates rules like this:

   ATTR{idVendor}=="046d", ATTR{idProduct}=="c111", SYMLINK+="harmony-%k"'

And then a corresponding policykit rule file to match it and a policykit
permissions rules ala:

   <harmony>=/dev/harmony*
   <console> 0600 <harmony> 0600 root

(The policykit stuff is completely ripped from Doug's fedora package.)

It generates these in the local directory, and it would get run by an
appropriate "make" target such as "make udevonly" or "make udev_policykit"
and then a make install_$whatever would install them in the right place.

The sample script I wrote is:
   http://www.phildev.net/concordance/gen_udev_support

It doesn't have a good help or anything yet, but it has a usage statement
and it should be clear from this email how to use it.

Thoughts? Comments?
-- 
Phil Dibowitz                             p...@ipom.com
Open Source software and tech docs        Insanity Palace of Metallica
http://www.phildev.net/                   http://www.ipom.com/

"Never write it in C if you can do it in 'awk';
 Never do it in 'awk' if 'sed' can handle it;
 Never use 'sed' when 'tr' can do the job;
 Never invoke 'tr' when 'cat' is sufficient;
 Avoid using 'cat' whenever possible" -- Taylor's Laws of Programming


Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
concordance-devel mailing list
concordance-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/concordance-devel

Reply via email to