1 |
On Fri, Nov 30, 2012 at 09:58:10AM +0000, Jorge Almeida wrote |
2 |
> On Fri, Nov 30, 2012 at 3:09 AM, Walter Dnes <waltdnes@××××××××.org> wrote: |
3 |
> |
4 |
> > 1) For a USB mass storage device (pen or external hard drive) with N |
5 |
> > partitions, the hotplug handler will get N+1 events when inserting and |
6 |
> > also when removing. E.g. if your pen drive has 3 partitions, you'll get |
7 |
> > 4 events... |
8 |
> |
9 |
> Right. The helper program is launched 4 times and will create (or remove, |
10 |
> depending on $ACTION) 4 symlinks. |
11 |
|
12 |
In my case, it would be 3 mounts. There's no point in mounting the |
13 |
underlying /dev/sdd, unless it happens to be the weird Windows format |
14 |
where the entire device is a FAT partition, with no partition table. |
15 |
|
16 |
> I thought of keeping data-- (key,value) = (serial_number, |
17 |
> custom_name_of_device)-- in a cdb database. I think it is faster than |
18 |
> reading a text file, and no parsing needed. It is also scalable |
19 |
> (although this is probably irrelevant on a custom-workstation |
20 |
> scale...). My (untested) program is about 11k, statically compiled. |
21 |
|
22 |
Come to think of it, I'd want to make it more general. I'd have my |
23 |
script read through a textfile ("flat-file database") with 3 columns. |
24 |
|
25 |
1) Attribute; one of "manufacturer", "product", or "serial"; are there |
26 |
any others? |
27 |
|
28 |
2) Value to match, i.e. manufacturer string, product name, or serial #. |
29 |
|
30 |
3) The custom name I want my device to have |
31 |
|
32 |
> By the way, I don't suppose there is a mailing list to talk about these |
33 |
> matters (mdev/ udev-alternative/ udev-fork related)? This is really |
34 |
> distro-agnostic stuff... |
35 |
|
36 |
For mdev-related questions, the best place I know of is the busybox |
37 |
mailing list http://lists.busybox.net/mailman/listinfo/busybox mdev is |
38 |
part of busybox. |
39 |
|
40 |
-- |
41 |
Walter Dnes <waltdnes@××××××××.org> |