From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 8C3FA1381F3 for ; Sat, 1 Dec 2012 03:49:10 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1D2C6E0662; Sat, 1 Dec 2012 03:48:45 +0000 (UTC) Received: from ironport2-out.teksavvy.com (ironport2-out.teksavvy.com [206.248.154.182]) by pigeon.gentoo.org (Postfix) with ESMTP id C33E5E0574 for ; Sat, 1 Dec 2012 03:47:28 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ag4KAG6Zu09FxKha/2dsb2JhbABEsnYDgRiBCIIVAQEBAQIBAQEBNxwYEAsLGBwSFBMBERABJogJBQu5fosIHzuBRII8YgOIQoR8hTiCJIEQgWKCbYg6gViDB4E5 X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="208862194" Received: from 69-196-168-90.dsl.teksavvy.com (HELO waltdnes.org) ([69.196.168.90]) by ironport2-out.teksavvy.com with SMTP; 30 Nov 2012 22:47:27 -0500 Received: by waltdnes.org (sSMTP sendmail emulation); Fri, 30 Nov 2012 22:47:26 -0500 From: "Walter Dnes" Date: Fri, 30 Nov 2012 22:47:25 -0500 To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] serial in /sys Message-ID: <20121201034725.GA3991@waltdnes.org> References: <20121129192025.GO23914@server> <20121129223557.GA11921@waltdnes.org> <20121130030927.GA12990@waltdnes.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Archives-Salt: 7cd7ac8e-4b7f-4f48-9efa-5b6c6bb8091e X-Archives-Hash: 19d08c1b502a06569384dddca87a8850 On Fri, Nov 30, 2012 at 09:58:10AM +0000, Jorge Almeida wrote > On Fri, Nov 30, 2012 at 3:09 AM, Walter Dnes 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