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: ChangeLog udev-135-r4.ebuild
Date: Sat, 24 Jan 2009 21:14:16
Message-Id: E1LQppV-0004u4-Sh@stork.gentoo.org
1 zzam 09/01/24 21:14:13
2
3 Modified: ChangeLog
4 Added: udev-135-r4.ebuild
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.442 sys-fs/udev/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udev/ChangeLog?rev=1.442&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udev/ChangeLog?rev=1.442&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udev/ChangeLog?r1=1.441&r2=1.442
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/sys-fs/udev/ChangeLog,v
19 retrieving revision 1.441
20 retrieving revision 1.442
21 diff -u -r1.441 -r1.442
22 --- ChangeLog 24 Jan 2009 21:01:47 -0000 1.441
23 +++ ChangeLog 24 Jan 2009 21:14:13 -0000 1.442
24 @@ -1,6 +1,14 @@
25 # ChangeLog for sys-fs/udev
26 # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/ChangeLog,v 1.441 2009/01/24 21:01:47 zzam Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/ChangeLog,v 1.442 2009/01/24 21:14:13 zzam Exp $
29 +
30 +*udev-135-r4 (24 Jan 2009)
31 +
32 + 24 Jan 2009; Matthias Schwarzott <zzam@g.o>
33 + +files/udev-135-fix-dri-perms.diff, +files/udev-fix-udevinfo-in-doc.diff,
34 + +udev-135-r4.ebuild:
35 + Fix permissions of dri devices, Bug #255841. Fix references to no longer
36 + existing udevinfo command, Bug #255955.
37
38 *udev-137 (24 Jan 2009)
39
40
41
42
43 1.1 sys-fs/udev/udev-135-r4.ebuild
44
45 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udev/udev-135-r4.ebuild?rev=1.1&view=markup
46 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udev/udev-135-r4.ebuild?rev=1.1&content-type=text/plain
47
48 Index: udev-135-r4.ebuild
49 ===================================================================
50 # Copyright 1999-2009 Gentoo Foundation
51 # Distributed under the terms of the GNU General Public License v2
52 # $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-135-r4.ebuild,v 1.1 2009/01/24 21:14:13 zzam Exp $
53
54 inherit eutils flag-o-matic multilib toolchain-funcs versionator
55
56 DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)"
57 HOMEPAGE="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html"
58 SRC_URI="mirror://kernel/linux/utils/kernel/hotplug/${P}.tar.bz2"
59
60 LICENSE="GPL-2"
61 SLOT="0"
62 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
63 IUSE="selinux"
64
65 DEPEND="selinux? ( sys-libs/libselinux )"
66 RDEPEND="!sys-apps/coldplug
67 !<sys-fs/device-mapper-1.02.19-r1"
68 RDEPEND="${DEPEND} ${RDEPEND}
69 >=sys-apps/baselayout-1.12.5"
70 # We need the lib/rcscripts/addon support
71 PROVIDE="virtual/dev-manager"
72
73 pkg_setup() {
74 udev_helper_dir="/$(get_libdir)/udev"
75
76 # comparing kernel version without linux-info.eclass to not pull
77 # virtual/linux-sources
78
79 local KV=$(uname -r)
80 local KV_MAJOR=$(get_major_version ${KV})
81 local KV_MINOR=$(get_version_component_range 2 ${KV})
82 local KV_MICRO=$(get_version_component_range 3 ${KV})
83
84 local min_micro=15 min_micro_reliable=19
85
86 local ok=0
87 if [[ ${KV_MAJOR} == 2 && ${KV_MINOR} == 6 ]]
88 then
89 if [[ ${KV_MICRO} -ge ${min_micro_reliable} ]]; then
90 ok=2
91 elif [[ ${KV_MICRO} -ge ${min_micro} ]]; then
92 ok=1
93 fi
94 fi
95
96 if [[ ${ok} -lt 1 ]]
97 then
98 ewarn
99 ewarn "${P} does not support Linux kernel before version 2.6.${min_micro}!"
100 fi
101 if [[ ${ok} -lt 2 ]]; then
102 ewarn "If you want to use udev reliable you should update"
103 ewarn "to at least kernel version 2.6.${min_micro_reliable}!"
104 ewarn
105 ebeep
106 fi
107 }
108
109 sed_helper_dir() {
110 sed -e "s#/lib/udev#${udev_helper_dir}#" -i "$@"
111 }
112
113 src_unpack() {
114 unpack ${A}
115
116 cd "${S}"
117
118 # patches go here...
119 epatch "${FILESDIR}/${P}-fix-capi.diff"
120 epatch "${FILESDIR}/${P}-rules-update.diff"
121 epatch "${FILESDIR}/${P}-fix-dri-perms.diff"
122 epatch "${FILESDIR}/${PN}-fix-udevinfo-in-doc.diff"
123
124 # Make sure there is no sudden changes to upstream rules file
125 # (more for my own needs than anything else ...)
126 MD5=$(md5sum < "${S}/rules/rules.d/50-udev-default.rules")
127 MD5=${MD5/ -/}
128 if [[ ${MD5} != b48b1e3ad3663f119ab3ccaf01bb657c ]]
129 then
130 echo
131 eerror "50-udev-default.rules has been updated, please validate!"
132 die "50-udev-default.rules has been updated, please validate!"
133 fi
134
135 sed_helper_dir \
136 rules/rules.d/50-udev-default.rules \
137 extras/rule_generator/write_*_rules \
138 udev/udev-util.c \
139 udev/udev-rules.c \
140 udev/udevd.c || die "sed failed"
141 }
142
143 src_compile() {
144 filter-flags -fprefetch-loop-arrays
145
146 econf \
147 --prefix=/usr \
148 --sysconfdir=/etc \
149 --exec-prefix= \
150 --with-libdir-name=$(get_libdir) \
151 --enable-logging \
152 $(use_with selinux)
153
154 emake || die "compiling udev failed"
155 }
156
157 src_install() {
158 into /
159 emake DESTDIR="${D}" install || die "make install failed"
160 if [[ "$(get_libdir)" != "lib" ]]; then
161 # we can not just rename /lib to /lib64, because
162 # make install creates /lib64 and /lib
163 mkdir -p "${D}/$(get_libdir)"
164 mv "${D}"/lib/* "${D}/$(get_libdir)/"
165 rmdir "${D}"/lib
166 fi
167
168 exeinto "${udev_helper_dir}"
169 newexe "${FILESDIR}"/net-130-r1.sh net.sh || die "net.sh not installed properly"
170 newexe "${FILESDIR}"/move_tmp_persistent_rules-112-r1.sh move_tmp_persistent_rules.sh \
171 || die "move_tmp_persistent_rules.sh not installed properly"
172 newexe "${FILESDIR}"/write_root_link_rule-125 write_root_link_rule \
173 || die "write_root_link_rule not installed properly"
174 newexe "${FILESDIR}"/shell-compat-118-r3.sh shell-compat.sh \
175 || die "shell-compat.sh not installed properly"
176
177 keepdir "${udev_helper_dir}"/state
178 keepdir "${udev_helper_dir}"/devices
179
180 # create symlinks for these utilities to /sbin
181 # where multipath-tools expect them to be (Bug #168588)
182 dosym "..${udev_helper_dir}/vol_id" /sbin/vol_id
183 dosym "..${udev_helper_dir}/scsi_id" /sbin/scsi_id
184
185 # Add gentoo stuff to udev.conf
186 echo "# If you need to change mount-options, do it in /etc/fstab" \
187 >> "${D}"/etc/udev/udev.conf
188
189 # let the dir exist at least
190 keepdir /etc/udev/rules.d
191
192 # Now installing rules
193 cd "${S}"/rules
194 insinto "${udev_helper_dir}"/rules.d/
195
196 # Our rules files
197 doins gentoo/??-*.rules
198 doins packages/40-alsa.rules
199 doins packages/40-isdn.rules
200
201 # Adding arch specific rules
202 if [[ -f packages/40-${ARCH}.rules ]]
203 then
204 doins "packages/40-${ARCH}.rules"
205 fi
206 cd "${S}"
207
208 # our udev hooks into the rc system
209 insinto /$(get_libdir)/rcscripts/addons
210 newins "${FILESDIR}"/udev-start-135-r3.sh udev-start.sh
211 newins "${FILESDIR}"/udev-stop-135-r2.sh udev-stop.sh
212
213 # The udev-post init-script
214 newinitd "${FILESDIR}"/udev-postmount-135-r2.initd udev-postmount
215
216 # init-scripts for >=openrc-0.3.1, Bug #240984
217 newinitd "${FILESDIR}/udev-135-r2.initd" udev
218 newinitd "${FILESDIR}/udev-mount-135-r3.initd" udev-mount
219 newinitd "${FILESDIR}/udev-dev-tarball-135-r2.initd" udev-dev-tarball
220
221 # config file for init-script and start-addon
222 newconfd "${FILESDIR}/udev-135-r3.confd" udev
223
224 insinto /etc/modprobe.d
225 newins "${FILESDIR}"/blacklist-110 blacklist
226 doins "${FILESDIR}"/pnp-aliases
227
228 # convert /lib/udev to real used dir
229 sed_helper_dir \
230 "${D}/$(get_libdir)"/rcscripts/addons/*.sh \
231 "${D}"/etc/init.d/udev* \
232 "${D}"/etc/modprobe.d/*
233
234 # documentation
235 dodoc ChangeLog README TODO || die "failed installing docs"
236
237 cd docs/writing_udev_rules
238 mv index.html writing_udev_rules.html
239 dohtml *.html
240
241 cd "${S}"
242
243 newdoc extras/volume_id/README README_volume_id
244
245 echo "CONFIG_PROTECT_MASK=\"/etc/udev/rules.d\"" > 20udev
246 doenvd 20udev
247 }
248
249 pkg_preinst() {
250 if [[ -d ${ROOT}/lib/udev-state ]]
251 then
252 mv -f "${ROOT}"/lib/udev-state/* "${D}"/lib/udev/state/
253 rm -r "${ROOT}"/lib/udev-state
254 fi
255
256 if [[ -f ${ROOT}/etc/udev/udev.config &&
257 ! -f ${ROOT}/etc/udev/udev.rules ]]
258 then
259 mv -f "${ROOT}"/etc/udev/udev.config "${ROOT}"/etc/udev/udev.rules
260 fi
261
262 # delete the old udev.hotplug symlink if it is present
263 if [[ -h ${ROOT}/etc/hotplug.d/default/udev.hotplug ]]
264 then
265 rm -f "${ROOT}"/etc/hotplug.d/default/udev.hotplug
266 fi
267
268 # delete the old wait_for_sysfs.hotplug symlink if it is present
269 if [[ -h ${ROOT}/etc/hotplug.d/default/05-wait_for_sysfs.hotplug ]]
270 then
271 rm -f "${ROOT}"/etc/hotplug.d/default/05-wait_for_sysfs.hotplug
272 fi
273
274 # delete the old wait_for_sysfs.hotplug symlink if it is present
275 if [[ -h ${ROOT}/etc/hotplug.d/default/10-udev.hotplug ]]
276 then
277 rm -f "${ROOT}"/etc/hotplug.d/default/10-udev.hotplug
278 fi
279
280 # is there a stale coldplug initscript? (CONFIG_PROTECT leaves it behind)
281 coldplug_stale=""
282 if [[ -f ${ROOT}/etc/init.d/coldplug ]]
283 then
284 coldplug_stale="1"
285 fi
286
287 has_version "=${CATEGORY}/${PN}-103-r3"
288 previous_equal_to_103_r3=$?
289
290 has_version "<${CATEGORY}/${PN}-104-r5"
291 previous_less_than_104_r5=$?
292
293 has_version "<${CATEGORY}/${PN}-106-r5"
294 previous_less_than_106_r5=$?
295
296 has_version "<${CATEGORY}/${PN}-113"
297 previous_less_than_113=$?
298 }
299
300 fix_old_persistent_net_rules() {
301 local rules=${ROOT}/etc/udev/rules.d/70-persistent-net.rules
302 [[ -f ${rules} ]] || return
303
304 elog
305 elog "Updating persistent-net rules file"
306
307 # Change ATTRS to ATTR matches, Bug #246927
308 sed -i -e 's/ATTRS{/ATTR{/g' "${rules}"
309
310 # Add KERNEL matches if missing, Bug #246849
311 sed -ri \
312 -e '/KERNEL/ ! { s/NAME="(eth|wlan|ath)([0-9]+)"/KERNEL=="\1*", NAME="\1\2"/}' \
313 "${rules}"
314 }
315
316 # See Bug #129204 for a discussion about restarting udevd
317 restart_udevd() {
318 # need to merge to our system
319 [[ ${ROOT} = / ]] || return
320
321 # check if root of init-process is identical to ours (not in chroot)
322 [[ -r /proc/1/root && /proc/1/root/ -ef /proc/self/root/ ]] || return
323
324 # abort if there is no udevd running
325 [[ -n $(pidof udevd) ]] || return
326
327 # abort if no /dev/.udev exists
328 [[ -e /dev/.udev ]] || return
329
330 elog
331 elog "restarting udevd now."
332
333 killall -15 udevd &>/dev/null
334 sleep 1
335 killall -9 udevd &>/dev/null
336
337 /sbin/udevd --daemon
338 }
339
340 pkg_postinst() {
341 fix_old_persistent_net_rules
342
343 restart_udevd
344
345 if [[ -e "${ROOT}"/etc/runlevels/sysinit && ! -e "${ROOT}"/etc/runlevels/sysinit/udev ]]
346 then
347 ewarn
348 ewarn "You need to add the udev init script to the runlevel sysinit,"
349 ewarn "else your system will not be able to boot"
350 ewarn "after updating to >=openrc-0.4.0"
351 ewarn "Run this to enable udev for >=openrc-0.4.0:"
352 ewarn "\trc-update add udev sysinit"
353 ewarn
354 fi
355
356 # people want reminders, I'll give them reminders. Odds are they will
357 # just ignore them anyway...
358
359 if [[ ${coldplug_stale} == 1 ]]
360 then
361 ewarn "A stale coldplug init script found. You should run:"
362 ewarn
363 ewarn " rc-update del coldplug"
364 ewarn " rm -f /etc/init.d/coldplug"
365 ewarn
366 ewarn "udev now provides its own coldplug functionality."
367 fi
368
369 # delete 40-scsi-hotplug.rules - all integrated in 50-udev.rules
370 if [[ $previous_equal_to_103_r3 = 0 ]] &&
371 [[ -e ${ROOT}/etc/udev/rules.d/40-scsi-hotplug.rules ]]
372 then
373 ewarn "Deleting stray 40-scsi-hotplug.rules"
374 ewarn "installed by sys-fs/udev-103-r3"
375 rm -f "${ROOT}"/etc/udev/rules.d/40-scsi-hotplug.rules
376 fi
377
378 # Removing some device-nodes we thought we need some time ago
379 if [[ -d ${ROOT}/lib/udev/devices ]]
380 then
381 rm -f "${ROOT}"/lib/udev/devices/{null,zero,console,urandom}
382 fi
383
384 # Removing some old file
385 if [[ $previous_less_than_104_r5 = 0 ]]
386 then
387 rm -f "${ROOT}"/etc/dev.d/net/hotplug.dev
388 rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/net 2>/dev/null
389 fi
390
391 if [[ $previous_less_than_106_r5 = 0 ]] &&
392 [[ -e ${ROOT}/etc/udev/rules.d/95-net.rules ]]
393 then
394 rm -f "${ROOT}"/etc/udev/rules.d/95-net.rules
395 fi
396
397 # Try to remove /etc/dev.d as that is obsolete
398 if [[ -d ${ROOT}/etc/dev.d ]]
399 then
400 rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/default "${ROOT}"/etc/dev.d 2>/dev/null
401 if [[ -d ${ROOT}/etc/dev.d ]]
402 then
403 ewarn "You still have the directory /etc/dev.d on your system."
404 ewarn "This is no longer used by udev and can be removed."
405 fi
406 fi
407
408 # 64-device-mapper.rules now gets installed by sys-fs/device-mapper
409 # remove it if user don't has sys-fs/device-mapper installed
410 if [[ $previous_less_than_113 = 0 ]] &&
411 [[ -f ${ROOT}/etc/udev/rules.d/64-device-mapper.rules ]] &&
412 ! has_version sys-fs/device-mapper
413 then
414 rm -f "${ROOT}"/etc/udev/rules.d/64-device-mapper.rules
415 einfo "Removed unneeded file 64-device-mapper.rules"
416 fi
417
418 # requested in Bug #225033:
419 elog
420 elog "persistent-net does assigning fixed names to network devices."
421 elog "If you have problems with the persistent-net rules,"
422 elog "just delete the rules file"
423 elog "\trm ${ROOT}etc/udev/rules.d/70-persistent-net.rules"
424 elog "and then reboot."
425 elog
426 elog "This may however number your devices in a different way than they are now."
427
428 ewarn
429 ewarn "If you build an initramfs including udev, then please"
430 ewarn "make sure that the /sbin/udevadm binary gets included,"
431 ewarn "and your scripts changed to use it,as it replaces the"
432 ewarn "old helper apps udevinfo, udevtrigger, ..."
433
434 ewarn
435 ewarn "mount options for directory /dev are no longer"
436 ewarn "set in /etc/udev/udev.conf, but in /etc/fstab"
437 ewarn "as for other directories."
438
439 elog
440 elog "For more information on udev on Gentoo, writing udev rules, and"
441 elog " fixing known issues visit:"
442 elog " http://www.gentoo.org/doc/en/udev-guide.xml"
443 }