Gentoo Archives: gentoo-commits

From: "Matthias Schwarzott (zzam)" <zzam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-fs/udev/files: udev-fix-udevinfo-in-doc.diff udev-135-fix-dri-perms.diff
Date: Sat, 24 Jan 2009 21:14:16
Message-Id: E1LQppV-0004tp-IR@stork.gentoo.org
1 zzam 09/01/24 21:14:13
2
3 Added: udev-fix-udevinfo-in-doc.diff
4 udev-135-fix-dri-perms.diff
5 Log:
6 Fix permissions of dri devices, Bug #255841. Fix references to no longer existing udevinfo command, Bug #255955.
7 (Portage version: 2.1.6.7/cvs/Linux i686)
8
9 Revision Changes Path
10 1.1 sys-fs/udev/files/udev-fix-udevinfo-in-doc.diff
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udev/files/udev-fix-udevinfo-in-doc.diff?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udev/files/udev-fix-udevinfo-in-doc.diff?rev=1.1&content-type=text/plain
14
15 Index: udev-fix-udevinfo-in-doc.diff
16 ===================================================================
17 commit 04f2a4fb6eded359cc8be1ba4ce33d7f7db6919f
18 Author: Miklos Vajna <vmiklos@××××××××××.org>
19 Date: Fri Jan 23 03:55:24 2009 +0100
20
21 doc: writing udev rules - refer to 'udevadm info' instead of 'udevinfo'
22
23 Signed-off-by: Miklos Vajna <vmiklos@××××××××××.org>
24
25 diff --git a/docs/writing_udev_rules/index.html b/docs/writing_udev_rules/index.html
26 index 5fedb3f..ca4fb9d 100644
27 --- a/docs/writing_udev_rules/index.html
28 +++ b/docs/writing_udev_rules/index.html
29 @@ -52,7 +52,7 @@ The most recent version of this document can always be found at: <br />
30 <li>Finding suitable information from sysfs
31 <ul>
32 <li><a href="#sysfstree">The sysfs tree</a></li>
33 - <li><a href="#udevinfo">udevinfo</a></li>
34 + <li><a href="#udevadm">udevadm info</a></li>
35 <li><a href="#sysfsalt">Alternative methods</a></li>
36 </ul>
37 </li>
38 @@ -429,15 +429,15 @@ In a udev rule, I could use ATTR{size}=="234441648" to identify this disk. As ud
39 Although this serves as a useful introduction as to the structure of sysfs and exactly how udev matches values, manually trawling through sysfs is both time consuming and unnecessary.
40 </p>
41
42 -<a name="udevinfo"></a>
43 -<h3>udevinfo</h3>
44 +<a name="udevadm"></a>
45 +<h3>udevadm info</h3>
46
47 <p>
48 -Enter <em>udevinfo</em>, which is probably the most straightforward tool you can use to construct rules. All you need to know is the sysfs device path of the device in question. A trimmed example is shown below:
49 +Enter <em>udevadm info</em>, which is probably the most straightforward tool you can use to construct rules. All you need to know is the sysfs device path of the device in question. A trimmed example is shown below:
50 </p>
51
52 <blockquote><pre>
53 -# udevinfo -a -p /sys/block/sda
54 +# udevadm info -a -p /sys/block/sda
55
56 <span class="green"> looking at device '/block/sda':
57 KERNEL=="sda"
58 @@ -476,7 +476,7 @@ Enter <em>udevinfo</em>, which is probably the most straightforward tool you can
59 </pre></blockquote>
60
61 <p>
62 -As you can see, udevinfo simply produces a list of attributes you can use as-is as match keys in your udev rules. From the above example, I could produce (e.g.) either of the following two rules for this device:
63 +As you can see, udevadm info simply produces a list of attributes you can use as-is as match keys in your udev rules. From the above example, I could produce (e.g.) either of the following two rules for this device:
64 </p>
65
66 <blockquote><pre>
67 @@ -495,24 +495,24 @@ You are usually provided with a large number of attributes, and you must pick a
68 </p>
69
70 <p>
71 -Observe the effects of hierarchy in the udevinfo output. The <span class="green">green</span> section corresponding to the device in question uses the standard match keys such as KERNEL and ATTR. The <span class="blue">blue</span> and <span class="maroon">maroon</span> sections corresponding to parent devices use the parent-traversing variants such as SUBSYSTEMS and ATTRS. This is why the complexity introduced by the hierarchical structure is actually quite easy to deal with, just be sure to use the exact values that udevinfo suggests.
72 +Observe the effects of hierarchy in the udevadm info output. The <span class="green">green</span> section corresponding to the device in question uses the standard match keys such as KERNEL and ATTR. The <span class="blue">blue</span> and <span class="maroon">maroon</span> sections corresponding to parent devices use the parent-traversing variants such as SUBSYSTEMS and ATTRS. This is why the complexity introduced by the hierarchical structure is actually quite easy to deal with, just be sure to use the exact values that udevadm info suggests.
73 </p>
74
75 <p>
76 -Another point to note is that it is common for text attributes to appear in the udevinfo output to be padded with spaces (e.g. see ST3120827AS above). In your rules, you can either specify the extra spaces, or you can cut them off as I have done.
77 +Another point to note is that it is common for text attributes to appear in the udevadm info output to be padded with spaces (e.g. see ST3120827AS above). In your rules, you can either specify the extra spaces, or you can cut them off as I have done.
78 </p>
79
80 <p>
81 -The only complication with using udevinfo is that you are required to know the top-level device path (/sys/block/sda in the example above). This is not always obvious. However, as you are generally writing rules for device nodes which already exist, you can use udevinfo to look up the device path for you:
82 +The only complication with using udevadm info is that you are required to know the top-level device path (/sys/block/sda in the example above). This is not always obvious. However, as you are generally writing rules for device nodes which already exist, you can use udevadm info to look up the device path for you:
83 </p>
84
85 -<blockquote><pre># udevinfo -a -p $(udevinfo -q path -n /dev/sda)</pre></blockquote>
86 +<blockquote><pre># udevadm info -a -p $(udevadm info -q path -n /dev/sda)</pre></blockquote>
87
88 <a name="sysfsalt"></a>
89 <h3>Alternative methods</h3>
90
91 <p>
92 -Although udevinfo is almost certainly the most straightforward way of listing the exact attributes you can build rules from, some users are happier with other tools. Utilities such as <a href="http://www.kroah.com/linux/usb/">usbview</a> display a similar set of information, most of which can be used in rules.
93 +Although udevadm info is almost certainly the most straightforward way of listing the exact attributes you can build rules from, some users are happier with other tools. Utilities such as <a href="http://www.kroah.com/linux/usb/">usbview</a> display a similar set of information, most of which can be used in rules.
94 </p>
95
96 <h2>Advanced topics</h2>
97 @@ -659,11 +659,11 @@ For example, the rule below sets the group ownership on my hard disk node, and e
98 <h3>USB Printer</h3>
99
100 <p>
101 -I power on my printer, and it is assigned device node <em>/dev/lp0</em>. Not satisfied with such a bland name, I decide to use udevinfo to aid me in writing a rule which will provide an alternative name:
102 +I power on my printer, and it is assigned device node <em>/dev/lp0</em>. Not satisfied with such a bland name, I decide to use udevadm info to aid me in writing a rule which will provide an alternative name:
103 </p>
104
105 <blockquote><pre>
106 -# udevinfo -a -p $(udevinfo -q path -n /dev/lp0)
107 +# udevadm info -a -p $(udevadm info -q path -n /dev/lp0)
108 looking at device '/class/usb/lp0':
109 KERNEL=="lp0"
110 SUBSYSTEM=="usb"
111 @@ -695,7 +695,7 @@ Not all cameras work in this way: some of them use a non-storage protocol such a
112 </p>
113
114 <p>
115 -A common complication with USB camera devices is that they usually identify themselves as a disk with a single partition, in this case <em>/dev/sdb</em> with <em>/dev/sdb1</em>. The sdb node is useless to me, but sdb1 is interesting - this is the one I want to mount. There is a problem here that because sysfs is chained, the useful attributes which udevinfo produces for /dev/sdb1 are identical to the ones for /dev/sdb. This results in your rule potentially matching <u>both</u> the raw disk and the partition, which is not what you want, your rule should be <b>specific</b>.
116 +A common complication with USB camera devices is that they usually identify themselves as a disk with a single partition, in this case <em>/dev/sdb</em> with <em>/dev/sdb1</em>. The sdb node is useless to me, but sdb1 is interesting - this is the one I want to mount. There is a problem here that because sysfs is chained, the useful attributes which udevadm info produces for /dev/sdb1 are identical to the ones for /dev/sdb. This results in your rule potentially matching <u>both</u> the raw disk and the partition, which is not what you want, your rule should be <b>specific</b>.
117 </p>
118
119 <p>
120 @@ -703,7 +703,7 @@ To get around this, you simply need to think about what differs between sdb and
121 </p>
122
123 <blockquote><pre>
124 -# udevinfo -a -p $(udevinfo -q path -n /dev/sdb1)
125 +# udevadm info -a -p $(udevadm info -q path -n /dev/sdb1)
126 looking at device '/block/sdb/sdb1':
127 KERNEL=="sdb1"
128 SUBSYSTEM=="block"
129 @@ -781,7 +781,7 @@ These devices work as USB-serial devices, so by default, you only get the <em>tt
130 <blockquote><pre>SUBSYSTEMS=="usb", ATTRS{product}=="Palm Handheld", KERNEL=="ttyUSB*", SYMLINK+="pilot"</pre></blockquote>
131
132 <p>
133 -Note that the product string seems to vary from product to product, so make sure that you check (using udevinfo) which one applies to you.
134 +Note that the product string seems to vary from product to product, so make sure that you check (using udevadm info) which one applies to you.
135 </p>
136
137 <a name="example-cdrom"></a>
138 @@ -808,11 +808,11 @@ Even though they are referenced by names, network interfaces typically do not ha
139 </p>
140
141 <p>
142 -It makes sense to simply match the MAC address of your interface in the rule, as this is unique. However, make sure that you use the <em>exact</em> MAC address as shown as udevinfo, because if you do not match the case exactly, your rule will not work.
143 +It makes sense to simply match the MAC address of your interface in the rule, as this is unique. However, make sure that you use the <em>exact</em> MAC address as shown as udevadm info, because if you do not match the case exactly, your rule will not work.
144 </p>
145
146 <blockquote><pre>
147 -# udevinfo -a -p /sys/class/net/eth0
148 +# udevadm info -a -p /sys/class/net/eth0
149 looking at class device '/sys/class/net/eth0':
150 KERNEL=="eth0"
151 ATTR{address}=="00:52:8b:d5:04:48"
152
153
154
155 1.1 sys-fs/udev/files/udev-135-fix-dri-perms.diff
156
157 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udev/files/udev-135-fix-dri-perms.diff?rev=1.1&view=markup
158 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udev/files/udev-135-fix-dri-perms.diff?rev=1.1&content-type=text/plain
159
160 Index: udev-135-fix-dri-perms.diff
161 ===================================================================
162 commit 66d9b44f8302efe383ada6a52d8431655614bf76
163 Author: Kay Sievers <kay.sievers@××××.org>
164 Date: Thu Jan 15 17:06:14 2009 +0100
165
166 rules: add drm devices to group "video"
167
168 https://bugs.launchpad.net/bugs/317430
169
170 diff --git a/rules/rules.d/50-udev-default.rules b/rules/rules.d/50-udev-default.rules
171 index 7730f0d..95d82d7 100644
172 --- a/rules/rules.d/50-udev-default.rules
173 +++ b/rules/rules.d/50-udev-default.rules
174 @@ -38,6 +38,7 @@ KERNEL=="card[0-9]*", NAME="dri/%k"
175 KERNEL=="pmu", GROUP="video"
176 KERNEL=="nvidia*|nvidiactl*", GROUP="video"
177 SUBSYSTEM=="graphics", GROUP="video"
178 +SUBSYSTEM=="drm", GROUP="video"
179
180 # DVB (video)
181 SUBSYSTEM=="dvb", ENV{DVB_ADAPTER_NUM}=="?*", NAME="dvb/adapter$env{DVB_ADAPTER_NUM}/$env{DVB_DEVICE_TYPE}$env{DVB_DEVICE_NUM}", GROUP="video"