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 DE1E713877A for ; Sat, 28 Jun 2014 18:05:49 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 093DBE0ADC; Sat, 28 Jun 2014 18:05:45 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id ABE01E07FA for ; Sat, 28 Jun 2014 18:05:43 +0000 (UTC) Received: from gmx.net ([84.133.131.129]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0LdYSM-1WIZZ10EE6-00ijPO for ; Sat, 28 Jun 2014 20:05:42 +0200 Received: by gmx.net (nbSMTP-1.00) for uid 1001 (using TLSv1/SSLv3 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) meino.cramer@gmx.de; Sat, 28 Jun 2014 20:05:41 +0200 (CEST) Date: Sat, 28 Jun 2014 20:05:40 +0200 From: meino.cramer@gmx.de To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Udev confusion: Rules for a mp3 player Message-ID: <20140628180540.GB3918@solfire> References: <20140628145755.GB3881@solfire> 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=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: User-Agent: mutt-ng/devel-r804 (Linux) X-Provags-ID: V03:K0:F1BmqRqccAXUdE9HDyzsWTxPyj470bpuYg3IXrWM+7RzWrqUEMl znLanjy0hRfGxZAJrWESG0WClZAAE1TKoNLJfDYD4SNQ03PYtA/cqeVDskKAOT7S/PcewIa /5ZgoA242btw+6X/oxYgmjQZQwE1sjrUS6y96zNc5WU6GrXE9kq4RJdVwtrYZZzv89+SfeB jECEwaV+sF1BKn6Ekw9mA== X-Archives-Salt: a4832cc3-d90f-406f-a058-666133d4533c X-Archives-Hash: e3b23222b99add612e4cb2efb9a15780 Jc Garc=EDa [14-06-28 19:48]: > 2014-06-28 8:57 GMT-06:00 : > > Hi, > > > > For my mp3-player I want to write udev rules to give better names > > to the according entries under /dev > > > > Problem is: Th eplayer has an internal flash, which only holds the firm= ware > > (in my case) and a sd-card slot, in which you can insert a flash card > > with music files. > > > > The internal memory has a partition directly on - say - sdb and the > > sd-card in the slot is regulary formatted and represents itsself as > > sdc and sdc1. > > > > With udevadm I determined the serial number of the device (to make it > > unique) and the model ("Internal storage" and "SD card slot"), which > > seems to make it easy to buit rules from. > > The one and only reason for not being THAT happy is: The rules didn't w= ork. > > > > Here: > > http://www.reactivated.net/writing_udev_rules.html > > > > I read some instructions. > > It is said that one should not combine elements of one device and more > > than one parent. > > > > Is "device" meant as "the entry under /dev" or is it to be understand > > as "the electric entity on my desktop (the player)". > > > > I want rules which also work, if another sdcard of a different size is > > inserted into the player... > > > > How can I write rules to map the internal storage, the whole device > > (aka /dev/sdc) of the sdcard (for example for reformatting reasons) > > and the partition of the sdcard (aka /dev/sdc1), which work? > > > > To this email I have attached the gzipped outputs of the according > > udevadm calls. > > > > Thank you very much for any help in advance! > > Best regards, > > mcc > > > > PS: > > This is what I have tried and which does *NOT* work! > > SUBSYSTEM=3D=3D"block",ATTRS{model}=3D=3D"Internal Storage",ATTRS{seria= l}=3D=3D"1A8C518301403210B00000000",SYMLINK+=3D"sansaclipzip_root" > > SUBSYSTEM=3D=3D"block",ATTRS{model}=3D=3D"SD Card Slot ",ATTR{partit= ion}=3D=3D"1", ATTRS{serial}=3D=3D"1A8C518301403210B00000000", SYMLINK+=3D"= sansaclipzip_data_1" > > SUBSYSTEM=3D=3D"block",ATTRS{model}=3D=3D"SD Card Slot ",ATTRS{seria= l}=3D=3D"1A8C518301403210B00000000", SYMLINK+=3D"sansaclipzip_data" > > > > > I'm not going to help you with your udev rules, but just point out, it > seems to me you are going to a more complicated layer than you need > to, if you just want personalized naming for your partitions under > /dev (for using with scripts or something like that), I would suggest > you to use the label feature, of the filesystems you are going to use > for those blocks, this will cause udev to generate respective > /dev/disk/by-label/* symlinks, altought I guess if you already know > this if you are playing with udev rules. >=20 =2E..this would identify the sd-cards instead of the device, so I choose to udev-rules instead of labels... Best regards, mcc