On Fri, Nov 30, 2012 at 09:58:10AM +0000, Jorge Almeida wrote
> On Fri, Nov 30, 2012 at 3:09 AM, Walter Dnes <[email protected]> wrote:
> 
> > 1) For a USB mass storage device (pen or external hard drive) with N
> > partitions, the hotplug handler will get N+1 events when inserting and
> > also when removing.  E.g. if your pen drive has 3 partitions, you'll get
> > 4 events...
> 
> Right. The helper program is launched 4 times and will create (or remove,
> depending on $ACTION) 4 symlinks.

  In my case, it would be 3 mounts.  There's no point in mounting the
underlying /dev/sdd, unless it happens to be the weird Windows format
where the entire device is a FAT partition, with no partition table.

> I thought of keeping data-- (key,value) = (serial_number,
> custom_name_of_device)-- in a cdb database. I think it is faster than
> reading a text file, and no parsing needed. It is also scalable
> (although this is probably irrelevant on a custom-workstation
> scale...). My (untested) program is about 11k, statically compiled.

  Come to think of it, I'd want to make it more general.  I'd have my
script read through a textfile ("flat-file database") with 3 columns.

1) Attribute; one of "manufacturer", "product", or "serial"; are there
   any others?

2) Value to match, i.e. manufacturer string, product name, or serial #.

3) The custom name I want my device to have

> By the way, I don't suppose there is a mailing list to talk about these
> matters (mdev/ udev-alternative/ udev-fork related)? This is really
> distro-agnostic stuff...

  For mdev-related questions, the best place I know of is the busybox
mailing list http://lists.busybox.net/mailman/listinfo/busybox  mdev is
part of busybox.

-- 
Walter Dnes <[email protected]>

Reply via email to