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 6269013877A for ; Sat, 28 Jun 2014 17:43:54 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3ACECE0ADD; Sat, 28 Jun 2014 17:43:49 +0000 (UTC) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com [209.85.217.174]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 107FFE0ACB for ; Sat, 28 Jun 2014 17:43:47 +0000 (UTC) Received: by mail-lb0-f174.google.com with SMTP id u10so4775434lbd.5 for ; Sat, 28 Jun 2014 10:43:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=udvPpgzWYrhBvCLZTyg9acRCWeCYHjidBk5M+ME9Gnk=; b=joJ2x3OTf6Cjeq/6PvnjtwqLMHMsxQOuw2jIYTG9JaecOAOt0l0BiK/NsPi0cGMyQN PtvqLZ1j+A5cpCgvhhUf4hb5LUV4n5Dvt7tfoM0z9is4sbdAUV+MFv2Hsg0OCw89jSP5 0VkTYuqHqK3f7Abh5Z+AWULLtvXApu9h4/woCvhXoqLUEV203dWlgGAflxHUQdCZmHGw OaRIvQ2LF6A2A/PA6IuqLHf7rYCUkZVEHEzmtc7EadNV41srA4mqg5+6aJBAbxGd50nl 4O1JNjLmkg7m5xwPRu1lWUiicjnHkkLd333yoKYZjckOR+fatjhrsG/lyNVsbgBnPoWI T1MQ== 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 X-Received: by 10.152.203.168 with SMTP id kr8mr21964341lac.17.1403977426525; Sat, 28 Jun 2014 10:43:46 -0700 (PDT) Received: by 10.112.171.74 with HTTP; Sat, 28 Jun 2014 10:43:46 -0700 (PDT) In-Reply-To: <20140628145755.GB3881@solfire> References: <20140628145755.GB3881@solfire> Date: Sat, 28 Jun 2014 11:43:46 -0600 Message-ID: Subject: Re: [gentoo-user] Udev confusion: Rules for a mp3 player From: =?UTF-8?Q?Jc_Garc=C3=ADa?= To: gentoo-user@lists.gentoo.org Content-Type: text/plain; charset=UTF-8 X-Archives-Salt: fd7cb086-6203-4f7e-a5af-0aed616bddf6 X-Archives-Hash: 056f5d42a8b10140a17abd1c7f3a2407 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 firmware > (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 work. > > 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=="block",ATTRS{model}=="Internal Storage",ATTRS{serial}=="1A8C518301403210B00000000",SYMLINK+="sansaclipzip_root" > SUBSYSTEM=="block",ATTRS{model}=="SD Card Slot ",ATTR{partition}=="1", ATTRS{serial}=="1A8C518301403210B00000000", SYMLINK+="sansaclipzip_data_1" > SUBSYSTEM=="block",ATTRS{model}=="SD Card Slot ",ATTRS{serial}=="1A8C518301403210B00000000", SYMLINK+="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.