Gentoo Archives: gentoo-user

From: meino.cramer@×××.de
To: Gentoo <gentoo-user@l.g.o>
Subject: [gentoo-user] Udev confusion: Rules for a mp3 player
Date: Sat, 28 Jun 2014 14:58:04
Message-Id: 20140628145755.GB3881@solfire
1 Hi,
2
3 For my mp3-player I want to write udev rules to give better names
4 to the according entries under /dev
5
6 Problem is: Th eplayer has an internal flash, which only holds the firmware
7 (in my case) and a sd-card slot, in which you can insert a flash card
8 with music files.
9
10 The internal memory has a partition directly on - say - sdb and the
11 sd-card in the slot is regulary formatted and represents itsself as
12 sdc and sdc1.
13
14 With udevadm I determined the serial number of the device (to make it
15 unique) and the model ("Internal storage" and "SD card slot"), which
16 seems to make it easy to buit rules from.
17 The one and only reason for not being THAT happy is: The rules didn't work.
18
19 Here:
20 http://www.reactivated.net/writing_udev_rules.html
21
22 I read some instructions.
23 It is said that one should not combine elements of one device and more
24 than one parent.
25
26 Is "device" meant as "the entry under /dev" or is it to be understand
27 as "the electric entity on my desktop (the player)".
28
29 I want rules which also work, if another sdcard of a different size is
30 inserted into the player...
31
32 How can I write rules to map the internal storage, the whole device
33 (aka /dev/sdc) of the sdcard (for example for reformatting reasons)
34 and the partition of the sdcard (aka /dev/sdc1), which work?
35
36 To this email I have attached the gzipped outputs of the according
37 udevadm calls.
38
39 Thank you very much for any help in advance!
40 Best regards,
41 mcc
42
43 PS:
44 This is what I have tried and which does *NOT* work!
45 SUBSYSTEM=="block",ATTRS{model}=="Internal Storage",ATTRS{serial}=="1A8C518301403210B00000000",SYMLINK+="sansaclipzip_root"
46 SUBSYSTEM=="block",ATTRS{model}=="SD Card Slot ",ATTR{partition}=="1", ATTRS{serial}=="1A8C518301403210B00000000", SYMLINK+="sansaclipzip_data_1"
47 SUBSYSTEM=="block",ATTRS{model}=="SD Card Slot ",ATTRS{serial}=="1A8C518301403210B00000000", SYMLINK+="sansaclipzip_data"

Attachments

File name MIME type
sansadatadevice.txt.gz application/x-gunzip
sansadatapartition.txt.gz application/x-gunzip
sansainternal.txt.gz application/x-gunzip

Replies

Subject Author
Re: [gentoo-user] Udev confusion: Rules for a mp3 player "Jc García" <jyo.garcia@×××××.com>