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