1 |
zzam 08/08/03 11:45:45 |
2 |
|
3 |
Modified: ChangeLog |
4 |
Added: udev-125-r2.ebuild udev-124-r1.ebuild |
5 |
Log: |
6 |
Backported fix for cdrom autoclosing when ejecting the media. Cleaned up udev-125 rules update patch. |
7 |
(Portage version: 2.2_rc6/cvs/Linux 2.6.25-tuxonice-r6 i686) |
8 |
|
9 |
Revision Changes Path |
10 |
1.394 sys-fs/udev/ChangeLog |
11 |
|
12 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udev/ChangeLog?rev=1.394&view=markup |
13 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udev/ChangeLog?rev=1.394&content-type=text/plain |
14 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udev/ChangeLog?r1=1.393&r2=1.394 |
15 |
|
16 |
Index: ChangeLog |
17 |
=================================================================== |
18 |
RCS file: /var/cvsroot/gentoo-x86/sys-fs/udev/ChangeLog,v |
19 |
retrieving revision 1.393 |
20 |
retrieving revision 1.394 |
21 |
diff -u -r1.393 -r1.394 |
22 |
--- ChangeLog 26 Jul 2008 08:43:19 -0000 1.393 |
23 |
+++ ChangeLog 3 Aug 2008 11:45:45 -0000 1.394 |
24 |
@@ -1,6 +1,17 @@ |
25 |
# ChangeLog for sys-fs/udev |
26 |
# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 |
27 |
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/ChangeLog,v 1.393 2008/07/26 08:43:19 zzam Exp $ |
28 |
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/ChangeLog,v 1.394 2008/08/03 11:45:45 zzam Exp $ |
29 |
+ |
30 |
+*udev-125-r2 (03 Aug 2008) |
31 |
+*udev-124-r1 (03 Aug 2008) |
32 |
+ |
33 |
+ 03 Aug 2008; Matthias Schwarzott <zzam@g.o> |
34 |
+ +files/udev-124-cdrom-autoclose-bug.diff, |
35 |
+ +files/udev-125-cdrom-autoclose-bug.diff, |
36 |
+ +files/udev-125-rules-update.diff, +udev-124-r1.ebuild, |
37 |
+ +udev-125-r2.ebuild: |
38 |
+ Backported fix for cdrom autoclosing when ejecting the media. Cleaned up |
39 |
+ udev-125 rules update patch. |
40 |
|
41 |
26 Jul 2008; Matthias Schwarzott <zzam@g.o> -udev-125.ebuild, |
42 |
udev-125-r1.ebuild: |
43 |
|
44 |
|
45 |
|
46 |
1.1 sys-fs/udev/udev-125-r2.ebuild |
47 |
|
48 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udev/udev-125-r2.ebuild?rev=1.1&view=markup |
49 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udev/udev-125-r2.ebuild?rev=1.1&content-type=text/plain |
50 |
|
51 |
Index: udev-125-r2.ebuild |
52 |
=================================================================== |
53 |
# Copyright 1999-2008 Gentoo Foundation |
54 |
# Distributed under the terms of the GNU General Public License v2 |
55 |
# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-125-r2.ebuild,v 1.1 2008/08/03 11:45:45 zzam Exp $ |
56 |
|
57 |
inherit eutils flag-o-matic multilib toolchain-funcs versionator |
58 |
|
59 |
DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)" |
60 |
HOMEPAGE="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html" |
61 |
SRC_URI="mirror://kernel/linux/utils/kernel/hotplug/${P}.tar.bz2" |
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 |
DEPEND="selinux? ( sys-libs/libselinux )" |
69 |
RDEPEND="!sys-apps/coldplug |
70 |
!<sys-fs/device-mapper-1.02.19-r1" |
71 |
RDEPEND="${DEPEND} ${RDEPEND} |
72 |
>=sys-apps/baselayout-1.12.5" |
73 |
# We need the lib/rcscripts/addon support |
74 |
PROVIDE="virtual/dev-manager" |
75 |
|
76 |
pkg_setup() { |
77 |
udev_helper_dir="/$(get_libdir)/udev" |
78 |
|
79 |
myconf= |
80 |
extras="extras/ata_id \ |
81 |
extras/cdrom_id \ |
82 |
extras/edd_id \ |
83 |
extras/firmware \ |
84 |
extras/floppy \ |
85 |
extras/path_id \ |
86 |
extras/scsi_id \ |
87 |
extras/usb_id \ |
88 |
extras/volume_id \ |
89 |
extras/collect \ |
90 |
extras/rule_generator" |
91 |
|
92 |
use selinux && myconf="${myconf} USE_SELINUX=true" |
93 |
|
94 |
# comparing kernel version without linux-info.eclass to not pull |
95 |
# virtual/linux-sources |
96 |
|
97 |
local KV=$(uname -r) |
98 |
local KV_MAJOR=$(get_major_version ${KV}) |
99 |
local KV_MINOR=$(get_version_component_range 2 ${KV}) |
100 |
local KV_MICRO=$(get_version_component_range 3 ${KV}) |
101 |
|
102 |
local ok=0 |
103 |
if [[ ${KV_MAJOR} == 2 && ${KV_MINOR} == 6 && ${KV_MICRO} -ge 18 ]] |
104 |
then |
105 |
ok=1 |
106 |
fi |
107 |
|
108 |
if [[ ${ok} == 0 ]] |
109 |
then |
110 |
ewarn |
111 |
ewarn "${P} does not support Linux kernel before version 2.6.15!" |
112 |
ewarn "If you want to use udev reliable you should update" |
113 |
ewarn "to at least kernel version 2.6.18!" |
114 |
ewarn |
115 |
ebeep |
116 |
fi |
117 |
} |
118 |
|
119 |
sed_helper_dir() { |
120 |
sed -e "s#/lib/udev#${udev_helper_dir}#" -i "$@" |
121 |
} |
122 |
|
123 |
src_unpack() { |
124 |
unpack ${A} |
125 |
|
126 |
cd "${S}" |
127 |
|
128 |
# patches go here... |
129 |
# Bug #223757, Bug #208578 |
130 |
epatch "${FILESDIR}/${PN}-125-rules-update.diff" |
131 |
epatch "${FILESDIR}/${P}-cdrom-autoclose-bug.diff" |
132 |
|
133 |
# No need to clutter the logs ... |
134 |
sed -ie '/^DEBUG/ c\DEBUG = false' Makefile |
135 |
# Do not use optimization flags from the package |
136 |
sed -ie 's|$(OPTIMIZATION)||g' Makefile |
137 |
# Do not require xmlto to refresh manpages |
138 |
sed -ie 's|$(MAN_PAGES)||g' Makefile |
139 |
|
140 |
# Make sure there is no sudden changes to upstream rules file |
141 |
# (more for my own needs than anything else ...) |
142 |
MD5=$(md5sum < "${S}/rules/rules.d/50-udev-default.rules") |
143 |
MD5=${MD5/ -/} |
144 |
if [[ ${MD5} != 325338763c8d6a522cd26401d96b767f ]] |
145 |
then |
146 |
echo |
147 |
eerror "50-udev-default.rules has been updated, please validate!" |
148 |
die "50-udev-default.rules has been updated, please validate!" |
149 |
fi |
150 |
|
151 |
sed_helper_dir \ |
152 |
rules/rules.d/50-udev-default.rules \ |
153 |
extras/rule_generator/write_*_rules \ |
154 |
udev_rules_parse.c \ |
155 |
udev_rules.c |
156 |
|
157 |
# Use correct multilib dir |
158 |
sed -i extras/volume_id/lib/Makefile \ |
159 |
-e "/ =/s-/lib-/$(get_libdir)-" |
160 |
} |
161 |
|
162 |
src_compile() { |
163 |
filter-flags -fprefetch-loop-arrays |
164 |
|
165 |
if [[ -z ${extras} ]]; then |
166 |
eerror "Variable extras is unset!" |
167 |
eerror "It seems you suffer from Bug #190994" |
168 |
die "Variable extras is unset!" |
169 |
fi |
170 |
|
171 |
# Not everyone has full $CHOST-{ld,ar,etc...} yet |
172 |
local mycross="" |
173 |
type -p ${CHOST}-ar && mycross=${CHOST}- |
174 |
|
175 |
emake \ |
176 |
EXTRAS="${extras}" \ |
177 |
libudevdir=${udev_helper_dir} \ |
178 |
CROSS_COMPILE=${mycross} \ |
179 |
OPTFLAGS="" \ |
180 |
${myconf} || die "compiling udev failed" |
181 |
} |
182 |
|
183 |
src_install() { |
184 |
into / |
185 |
emake \ |
186 |
DESTDIR="${D}" \ |
187 |
libudevdir=${udev_helper_dir} \ |
188 |
EXTRAS="${extras}" \ |
189 |
${myconf} \ |
190 |
install || die "make install failed" |
191 |
|
192 |
exeinto "${udev_helper_dir}" |
193 |
newexe "${FILESDIR}"/net-118-r1.sh net.sh || die "net.sh not installed properly" |
194 |
newexe "${FILESDIR}"/move_tmp_persistent_rules-112-r1.sh move_tmp_persistent_rules.sh \ |
195 |
|| die "move_tmp_persistent_rules.sh not installed properly" |
196 |
newexe "${FILESDIR}"/write_root_link_rule-125 write_root_link_rule \ |
197 |
|| die "write_root_link_rule not installed properly" |
198 |
newexe "${FILESDIR}"/shell-compat-118-r3.sh shell-compat.sh \ |
199 |
|| die "shell-compat.sh not installed properly" |
200 |
|
201 |
keepdir "${udev_helper_dir}"/state |
202 |
keepdir "${udev_helper_dir}"/devices |
203 |
|
204 |
# create symlinks for these utilities to /sbin |
205 |
# where multipath-tools expect them to be (Bug #168588) |
206 |
dosym "..${udev_helper_dir}/vol_id" /sbin/vol_id |
207 |
dosym "..${udev_helper_dir}/scsi_id" /sbin/scsi_id |
208 |
|
209 |
# vol_id library (needed by mount and HAL) |
210 |
into / |
211 |
rm "${D}/$(get_libdir)"/libvolume_id.so* 2>/dev/null |
212 |
dolib extras/volume_id/lib/*.so* || die "Failed installing libvolume_id.so" |
213 |
into /usr |
214 |
dolib extras/volume_id/lib/*.a || die "Failed installing libvolume_id.a" |
215 |
|
216 |
# handle static linking bug #4411 |
217 |
rm -f "${D}/usr/$(get_libdir)/libvolume_id.so" |
218 |
gen_usr_ldscript libvolume_id.so |
219 |
|
220 |
# Add gentoo stuff to udev.conf |
221 |
echo "# If you need to change mount-options, do it in /etc/fstab" \ |
222 |
>> "${D}"/etc/udev/udev.conf |
223 |
|
224 |
# Now installing rules |
225 |
cd "${S}"/rules |
226 |
insinto /etc/udev/rules.d/ |
227 |
|
228 |
# Our rules files |
229 |
doins gentoo/??-*.rules |
230 |
doins packages/40-alsa.rules |
231 |
|
232 |
# Adding arch specific rules |
233 |
if [[ -f packages/40-${ARCH}.rules ]] |
234 |
then |
235 |
doins "packages/40-${ARCH}.rules" |
236 |
fi |
237 |
cd "${S}" |
238 |
|
239 |
# our udev hooks into the rc system |
240 |
insinto /$(get_libdir)/rcscripts/addons |
241 |
newins "${FILESDIR}"/udev-start-122-r1.sh udev-start.sh |
242 |
newins "${FILESDIR}"/udev-stop-118-r2.sh udev-stop.sh |
243 |
|
244 |
# The udev-post init-script |
245 |
newinitd "${FILESDIR}"/udev-postmount-initd-111-r2 udev-postmount |
246 |
|
247 |
insinto /etc/modprobe.d |
248 |
newins "${FILESDIR}"/blacklist-110 blacklist |
249 |
doins "${FILESDIR}"/pnp-aliases |
250 |
|
251 |
# convert /lib/udev to real used dir |
252 |
sed_helper_dir \ |
253 |
"${D}/$(get_libdir)"/rcscripts/addons/*.sh \ |
254 |
"${D}"/etc/init.d/udev* \ |
255 |
"${D}"/etc/modprobe.d/* |
256 |
|
257 |
# documentation |
258 |
dodoc ChangeLog FAQ README TODO RELEASE-NOTES |
259 |
|
260 |
cd docs/writing_udev_rules |
261 |
mv index.html writing_udev_rules.html |
262 |
dohtml *.html |
263 |
|
264 |
cd "${S}" |
265 |
|
266 |
newdoc extras/volume_id/README README_volume_id |
267 |
|
268 |
echo "CONFIG_PROTECT_MASK=\"/etc/udev/rules.d\"" > 20udev |
269 |
doenvd 20udev |
270 |
} |
271 |
|
272 |
pkg_preinst() { |
273 |
if [[ -d ${ROOT}/lib/udev-state ]] |
274 |
then |
275 |
mv -f "${ROOT}"/lib/udev-state/* "${D}"/lib/udev/state/ |
276 |
rm -r "${ROOT}"/lib/udev-state |
277 |
fi |
278 |
|
279 |
if [[ -f ${ROOT}/etc/udev/udev.config && |
280 |
! -f ${ROOT}/etc/udev/udev.rules ]] |
281 |
then |
282 |
mv -f "${ROOT}"/etc/udev/udev.config "${ROOT}"/etc/udev/udev.rules |
283 |
fi |
284 |
|
285 |
# delete the old udev.hotplug symlink if it is present |
286 |
if [[ -h ${ROOT}/etc/hotplug.d/default/udev.hotplug ]] |
287 |
then |
288 |
rm -f "${ROOT}"/etc/hotplug.d/default/udev.hotplug |
289 |
fi |
290 |
|
291 |
# delete the old wait_for_sysfs.hotplug symlink if it is present |
292 |
if [[ -h ${ROOT}/etc/hotplug.d/default/05-wait_for_sysfs.hotplug ]] |
293 |
then |
294 |
rm -f "${ROOT}"/etc/hotplug.d/default/05-wait_for_sysfs.hotplug |
295 |
fi |
296 |
|
297 |
# delete the old wait_for_sysfs.hotplug symlink if it is present |
298 |
if [[ -h ${ROOT}/etc/hotplug.d/default/10-udev.hotplug ]] |
299 |
then |
300 |
rm -f "${ROOT}"/etc/hotplug.d/default/10-udev.hotplug |
301 |
fi |
302 |
|
303 |
# is there a stale coldplug initscript? (CONFIG_PROTECT leaves it behind) |
304 |
coldplug_stale="" |
305 |
if [[ -f ${ROOT}/etc/init.d/coldplug ]] |
306 |
then |
307 |
coldplug_stale="1" |
308 |
fi |
309 |
|
310 |
has_version "=${CATEGORY}/${PN}-103-r3" |
311 |
previous_equal_to_103_r3=$? |
312 |
|
313 |
has_version "<${CATEGORY}/${PN}-104-r5" |
314 |
previous_less_than_104_r5=$? |
315 |
|
316 |
has_version "<${CATEGORY}/${PN}-106-r5" |
317 |
previous_less_than_106_r5=$? |
318 |
|
319 |
has_version "<${CATEGORY}/${PN}-113" |
320 |
previous_less_than_113=$? |
321 |
} |
322 |
|
323 |
pkg_postinst() { |
324 |
# people want reminders, I'll give them reminders. Odds are they will |
325 |
# just ignore them anyway... |
326 |
|
327 |
if [[ ${coldplug_stale} == 1 ]] |
328 |
then |
329 |
ewarn "A stale coldplug init script found. You should run:" |
330 |
ewarn |
331 |
ewarn " rc-update del coldplug" |
332 |
ewarn " rm -f /etc/init.d/coldplug" |
333 |
ewarn |
334 |
ewarn "udev now provides its own coldplug functionality." |
335 |
fi |
336 |
|
337 |
# delete 40-scsi-hotplug.rules - all integrated in 50-udev.rules |
338 |
if [[ $previous_equal_to_103_r3 = 0 ]] && |
339 |
[[ -e ${ROOT}/etc/udev/rules.d/40-scsi-hotplug.rules ]] |
340 |
then |
341 |
ewarn "Deleting stray 40-scsi-hotplug.rules" |
342 |
ewarn "installed by sys-fs/udev-103-r3" |
343 |
rm -f "${ROOT}"/etc/udev/rules.d/40-scsi-hotplug.rules |
344 |
fi |
345 |
|
346 |
# Removing some device-nodes we thought we need some time ago |
347 |
if [[ -d ${ROOT}/lib/udev/devices ]] |
348 |
then |
349 |
rm -f "${ROOT}"/lib/udev/devices/{null,zero,console,urandom} |
350 |
fi |
351 |
|
352 |
# Removing some old file |
353 |
if [[ $previous_less_than_104_r5 = 0 ]] |
354 |
then |
355 |
rm -f "${ROOT}"/etc/dev.d/net/hotplug.dev |
356 |
rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/net 2>/dev/null |
357 |
fi |
358 |
|
359 |
if [[ $previous_less_than_106_r5 = 0 ]] && |
360 |
[[ -e ${ROOT}/etc/udev/rules.d/95-net.rules ]] |
361 |
then |
362 |
rm -f "${ROOT}"/etc/udev/rules.d/95-net.rules |
363 |
fi |
364 |
|
365 |
# Try to remove /etc/dev.d as that is obsolete |
366 |
if [[ -d ${ROOT}/etc/dev.d ]] |
367 |
then |
368 |
rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/default "${ROOT}"/etc/dev.d 2>/dev/null |
369 |
if [[ -d ${ROOT}/etc/dev.d ]] |
370 |
then |
371 |
ewarn "You still have the directory /etc/dev.d on your system." |
372 |
ewarn "This is no longer used by udev and can be removed." |
373 |
fi |
374 |
fi |
375 |
|
376 |
# 64-device-mapper.rules now gets installed by sys-fs/device-mapper |
377 |
# remove it if user don't has sys-fs/device-mapper installed |
378 |
if [[ $previous_less_than_113 = 0 ]] && |
379 |
[[ -f ${ROOT}/etc/udev/rules.d/64-device-mapper.rules ]] && |
380 |
! has_version sys-fs/device-mapper |
381 |
then |
382 |
rm -f "${ROOT}"/etc/udev/rules.d/64-device-mapper.rules |
383 |
einfo "Removed unneeded file 64-device-mapper.rules" |
384 |
fi |
385 |
|
386 |
# requested in Bug #225033: |
387 |
elog |
388 |
elog "persistent-net does assigning fixed names to network devices." |
389 |
elog "If you have problems with persistent-net rules," |
390 |
elog "just delete the rules file" |
391 |
elog "\trm ${ROOT}etc/udev/rules.d/70-persistent-net.rules" |
392 |
elog "and then trigger udev by either running" |
393 |
elog "\tudevadm trigger --subsystem-match=net" |
394 |
elog "or by rebooting." |
395 |
elog |
396 |
elog "This may number your devices in a different way than it is now." |
397 |
|
398 |
if [[ ${ROOT} == / ]] |
399 |
then |
400 |
# check if root of init-process is identical to ours |
401 |
if [[ -r /proc/1/root && /proc/1/root/ -ef /proc/self/root/ ]] |
402 |
then |
403 |
einfo "restarting udevd now." |
404 |
if [[ -n $(pidof udevd) ]] |
405 |
then |
406 |
killall -15 udevd &>/dev/null |
407 |
sleep 1 |
408 |
killall -9 udevd &>/dev/null |
409 |
fi |
410 |
/sbin/udevd --daemon |
411 |
fi |
412 |
fi |
413 |
|
414 |
ewarn "If you build an initramfs including udev, then please" |
415 |
ewarn "make sure that the /sbin/udevadm binary gets included," |
416 |
ewarn "as the helper apps udevinfo, udevtrigger, ... are now" |
417 |
ewarn "only symlinks to udevadm." |
418 |
|
419 |
ewarn |
420 |
ewarn "mount options for directory /dev are no longer" |
421 |
ewarn "set in /etc/udev/udev.conf, but in /etc/fstab" |
422 |
ewarn "as for other directories." |
423 |
|
424 |
elog |
425 |
elog "For more information on udev on Gentoo, writing udev rules, and" |
426 |
elog " fixing known issues visit:" |
427 |
elog " http://www.gentoo.org/doc/en/udev-guide.xml" |
428 |
} |
429 |
|
430 |
|
431 |
|
432 |
1.1 sys-fs/udev/udev-124-r1.ebuild |
433 |
|
434 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udev/udev-124-r1.ebuild?rev=1.1&view=markup |
435 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udev/udev-124-r1.ebuild?rev=1.1&content-type=text/plain |
436 |
|
437 |
Index: udev-124-r1.ebuild |
438 |
=================================================================== |
439 |
# Copyright 1999-2008 Gentoo Foundation |
440 |
# Distributed under the terms of the GNU General Public License v2 |
441 |
# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-124-r1.ebuild,v 1.1 2008/08/03 11:45:45 zzam Exp $ |
442 |
|
443 |
inherit eutils flag-o-matic multilib toolchain-funcs versionator |
444 |
|
445 |
DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)" |
446 |
HOMEPAGE="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html" |
447 |
SRC_URI="mirror://kernel/linux/utils/kernel/hotplug/${P}.tar.bz2" |
448 |
|
449 |
LICENSE="GPL-2" |
450 |
SLOT="0" |
451 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" |
452 |
IUSE="selinux" |
453 |
|
454 |
DEPEND="selinux? ( sys-libs/libselinux )" |
455 |
RDEPEND="!sys-apps/coldplug |
456 |
!<sys-fs/device-mapper-1.02.19-r1" |
457 |
RDEPEND="${DEPEND} ${RDEPEND} |
458 |
>=sys-apps/baselayout-1.12.5" |
459 |
# We need the lib/rcscripts/addon support |
460 |
PROVIDE="virtual/dev-manager" |
461 |
|
462 |
pkg_setup() { |
463 |
udev_helper_dir="/$(get_libdir)/udev" |
464 |
|
465 |
myconf= |
466 |
extras="extras/ata_id \ |
467 |
extras/cdrom_id \ |
468 |
extras/edd_id \ |
469 |
extras/firmware \ |
470 |
extras/floppy \ |
471 |
extras/path_id \ |
472 |
extras/scsi_id \ |
473 |
extras/usb_id \ |
474 |
extras/volume_id \ |
475 |
extras/collect \ |
476 |
extras/rule_generator" |
477 |
|
478 |
use selinux && myconf="${myconf} USE_SELINUX=true" |
479 |
|
480 |
# comparing kernel version without linux-info.eclass to not pull |
481 |
# virtual/linux-sources |
482 |
|
483 |
local KV=$(uname -r) |
484 |
local KV_MAJOR=$(get_major_version ${KV}) |
485 |
local KV_MINOR=$(get_version_component_range 2 ${KV}) |
486 |
local KV_MICRO=$(get_version_component_range 3 ${KV}) |
487 |
|
488 |
local ok=0 |
489 |
if [[ ${KV_MAJOR} == 2 && ${KV_MINOR} == 6 && ${KV_MICRO} -ge 18 ]] |
490 |
then |
491 |
ok=1 |
492 |
fi |
493 |
|
494 |
if [[ ${ok} == 0 ]] |
495 |
then |
496 |
ewarn |
497 |
ewarn "${P} does not support Linux kernel before version 2.6.15!" |
498 |
ewarn "If you want to use udev reliable you should update" |
499 |
ewarn "to at least kernel version 2.6.18!" |
500 |
ewarn |
501 |
ebeep |
502 |
fi |
503 |
} |
504 |
|
505 |
sed_helper_dir() { |
506 |
sed -e "s#/lib/udev#${udev_helper_dir}#" -i "$@" |
507 |
} |
508 |
|
509 |
src_unpack() { |
510 |
unpack ${A} |
511 |
|
512 |
cd "${S}" |
513 |
|
514 |
# patches go here... |
515 |
# Bug #223757, Bug #208578 |
516 |
epatch "${FILESDIR}/${PN}-122-rules-update.diff" |
517 |
epatch "${FILESDIR}/${P}-cdrom-autoclose-bug.diff" |
518 |
|
519 |
# No need to clutter the logs ... |
520 |
sed -ie '/^DEBUG/ c\DEBUG = false' Makefile |
521 |
# Do not use optimization flags from the package |
522 |
sed -ie 's|$(OPTIMIZATION)||g' Makefile |
523 |
# Do not require xmlto to refresh manpages |
524 |
sed -ie 's|$(MAN_PAGES)||g' Makefile |
525 |
|
526 |
# Make sure there is no sudden changes to upstream rules file |
527 |
# (more for my own needs than anything else ...) |
528 |
MD5=$(md5sum < "${S}/etc/udev/rules.d/50-udev-default.rules") |
529 |
MD5=${MD5/ -/} |
530 |
if [[ ${MD5} != db44f7e02100f57a555d48e2192c3f8d ]] |
531 |
then |
532 |
echo |
533 |
eerror "50-udev-default.rules has been updated, please validate!" |
534 |
die "50-udev-default.rules has been updated, please validate!" |
535 |
fi |
536 |
|
537 |
sed_helper_dir \ |
538 |
etc/udev/rules.d/50-udev-default.rules \ |
539 |
extras/rule_generator/write_*_rules \ |
540 |
udev_rules_parse.c \ |
541 |
udev_rules.c |
542 |
|
543 |
# Use correct multilib dir |
544 |
sed -i extras/volume_id/lib/Makefile \ |
545 |
-e "/ =/s-/lib-/$(get_libdir)-" |
546 |
} |
547 |
|
548 |
src_compile() { |
549 |
filter-flags -fprefetch-loop-arrays |
550 |
|
551 |
if [[ -z ${extras} ]]; then |
552 |
eerror "Variable extras is unset!" |
553 |
eerror "It seems you suffer from Bug #190994" |
554 |
die "Variable extras is unset!" |
555 |
fi |
556 |
|
557 |
# Not everyone has full $CHOST-{ld,ar,etc...} yet |
558 |
local mycross="" |
559 |
type -p ${CHOST}-ar && mycross=${CHOST}- |
560 |
|
561 |
emake \ |
562 |
EXTRAS="${extras}" \ |
563 |
libudevdir=${udev_helper_dir} \ |
564 |
CROSS_COMPILE=${mycross} \ |
565 |
OPTFLAGS="" \ |
566 |
${myconf} || die "compiling udev failed" |
567 |
} |
568 |
|
569 |
src_install() { |
570 |
into / |
571 |
emake \ |
572 |
DESTDIR="${D}" \ |
573 |
libudevdir=${udev_helper_dir} \ |
574 |
EXTRAS="${extras}" \ |
575 |
${myconf} \ |
576 |
install || die "make install failed" |
577 |
|
578 |
exeinto "${udev_helper_dir}" |
579 |
newexe "${FILESDIR}"/net-118-r1.sh net.sh || die "net.sh not installed properly" |
580 |
newexe "${FILESDIR}"/move_tmp_persistent_rules-112-r1.sh move_tmp_persistent_rules.sh \ |
581 |
|| die "move_tmp_persistent_rules.sh not installed properly" |
582 |
doexe "${FILESDIR}"/write_root_link_rule \ |
583 |
|| die "write_root_link_rule not installed properly" |
584 |
newexe "${FILESDIR}"/shell-compat-118-r3.sh shell-compat.sh \ |
585 |
|| die "shell-compat.sh not installed properly" |
586 |
|
587 |
keepdir "${udev_helper_dir}"/state |
588 |
keepdir "${udev_helper_dir}"/devices |
589 |
|
590 |
# create symlinks for these utilities to /sbin |
591 |
# where multipath-tools expect them to be (Bug #168588) |
592 |
dosym "..${udev_helper_dir}/vol_id" /sbin/vol_id |
593 |
dosym "..${udev_helper_dir}/scsi_id" /sbin/scsi_id |
594 |
|
595 |
# vol_id library (needed by mount and HAL) |
596 |
into / |
597 |
rm "${D}/$(get_libdir)"/libvolume_id.so* 2>/dev/null |
598 |
dolib extras/volume_id/lib/*.so* || die "Failed installing libvolume_id.so" |
599 |
into /usr |
600 |
dolib extras/volume_id/lib/*.a || die "Failed installing libvolume_id.a" |
601 |
|
602 |
# handle static linking bug #4411 |
603 |
rm -f "${D}/usr/$(get_libdir)/libvolume_id.so" |
604 |
gen_usr_ldscript libvolume_id.so |
605 |
|
606 |
# Add gentoo stuff to udev.conf |
607 |
echo "# If you need to change mount-options, do it in /etc/fstab" \ |
608 |
>> "${D}"/etc/udev/udev.conf |
609 |
|
610 |
# Now installing rules |
611 |
cd etc/udev |
612 |
insinto /etc/udev/rules.d/ |
613 |
|
614 |
# Our rules files |
615 |
doins gentoo/??-*.rules |
616 |
doins packages/40-alsa.rules |
617 |
|
618 |
# Adding arch specific rules |
619 |
if [[ -f packages/40-${ARCH}.rules ]] |
620 |
then |
621 |
doins "packages/40-${ARCH}.rules" |
622 |
fi |
623 |
cd "${S}" |
624 |
|
625 |
# our udev hooks into the rc system |
626 |
insinto /$(get_libdir)/rcscripts/addons |
627 |
newins "${FILESDIR}"/udev-start-122-r1.sh udev-start.sh |
628 |
newins "${FILESDIR}"/udev-stop-118-r2.sh udev-stop.sh |
629 |
|
630 |
# The udev-post init-script |
631 |
newinitd "${FILESDIR}"/udev-postmount-initd-111-r2 udev-postmount |
632 |
|
633 |
insinto /etc/modprobe.d |
634 |
newins "${FILESDIR}"/blacklist-110 blacklist |
635 |
doins "${FILESDIR}"/pnp-aliases |
636 |
|
637 |
# convert /lib/udev to real used dir |
638 |
sed_helper_dir \ |
639 |
"${D}/$(get_libdir)"/rcscripts/addons/*.sh \ |
640 |
"${D}"/etc/init.d/udev* \ |
641 |
"${D}"/etc/modprobe.d/* |
642 |
|
643 |
# documentation |
644 |
dodoc ChangeLog FAQ README TODO RELEASE-NOTES |
645 |
dodoc docs/{overview,udev_vs_devfs} |
646 |
|
647 |
cd docs/writing_udev_rules |
648 |
mv index.html writing_udev_rules.html |
649 |
dohtml *.html |
650 |
|
651 |
cd "${S}" |
652 |
|
653 |
newdoc extras/volume_id/README README_volume_id |
654 |
|
655 |
echo "CONFIG_PROTECT_MASK=\"/etc/udev/rules.d\"" > 20udev |
656 |
doenvd 20udev |
657 |
} |
658 |
|
659 |
pkg_preinst() { |
660 |
if [[ -d ${ROOT}/lib/udev-state ]] |
661 |
then |
662 |
mv -f "${ROOT}"/lib/udev-state/* "${D}"/lib/udev/state/ |
663 |
rm -r "${ROOT}"/lib/udev-state |
664 |
fi |
665 |
|
666 |
if [[ -f ${ROOT}/etc/udev/udev.config && |
667 |
! -f ${ROOT}/etc/udev/udev.rules ]] |
668 |
then |
669 |
mv -f "${ROOT}"/etc/udev/udev.config "${ROOT}"/etc/udev/udev.rules |
670 |
fi |
671 |
|
672 |
# delete the old udev.hotplug symlink if it is present |
673 |
if [[ -h ${ROOT}/etc/hotplug.d/default/udev.hotplug ]] |
674 |
then |
675 |
rm -f "${ROOT}"/etc/hotplug.d/default/udev.hotplug |
676 |
fi |
677 |
|
678 |
# delete the old wait_for_sysfs.hotplug symlink if it is present |
679 |
if [[ -h ${ROOT}/etc/hotplug.d/default/05-wait_for_sysfs.hotplug ]] |
680 |
then |
681 |
rm -f "${ROOT}"/etc/hotplug.d/default/05-wait_for_sysfs.hotplug |
682 |
fi |
683 |
|
684 |
# delete the old wait_for_sysfs.hotplug symlink if it is present |
685 |
if [[ -h ${ROOT}/etc/hotplug.d/default/10-udev.hotplug ]] |
686 |
then |
687 |
rm -f "${ROOT}"/etc/hotplug.d/default/10-udev.hotplug |
688 |
fi |
689 |
|
690 |
# is there a stale coldplug initscript? (CONFIG_PROTECT leaves it behind) |
691 |
coldplug_stale="" |
692 |
if [[ -f ${ROOT}/etc/init.d/coldplug ]] |
693 |
then |
694 |
coldplug_stale="1" |
695 |
fi |
696 |
|
697 |
has_version "=${CATEGORY}/${PN}-103-r3" |
698 |
previous_equal_to_103_r3=$? |
699 |
|
700 |
has_version "<${CATEGORY}/${PN}-104-r5" |
701 |
previous_less_than_104_r5=$? |
702 |
|
703 |
has_version "<${CATEGORY}/${PN}-106-r5" |
704 |
previous_less_than_106_r5=$? |
705 |
|
706 |
has_version "<${CATEGORY}/${PN}-113" |
707 |
previous_less_than_113=$? |
708 |
} |
709 |
|
710 |
pkg_postinst() { |
711 |
# people want reminders, I'll give them reminders. Odds are they will |
712 |
# just ignore them anyway... |
713 |
|
714 |
if [[ ${coldplug_stale} == 1 ]] |
715 |
then |
716 |
ewarn "A stale coldplug init script found. You should run:" |
717 |
ewarn |
718 |
ewarn " rc-update del coldplug" |
719 |
ewarn " rm -f /etc/init.d/coldplug" |
720 |
ewarn |
721 |
ewarn "udev now provides its own coldplug functionality." |
722 |
fi |
723 |
|
724 |
# delete 40-scsi-hotplug.rules - all integrated in 50-udev.rules |
725 |
if [[ $previous_equal_to_103_r3 = 0 ]] && |
726 |
[[ -e ${ROOT}/etc/udev/rules.d/40-scsi-hotplug.rules ]] |
727 |
then |
728 |
ewarn "Deleting stray 40-scsi-hotplug.rules" |
729 |
ewarn "installed by sys-fs/udev-103-r3" |
730 |
rm -f "${ROOT}"/etc/udev/rules.d/40-scsi-hotplug.rules |
731 |
fi |
732 |
|
733 |
# Removing some device-nodes we thought we need some time ago |
734 |
if [[ -d ${ROOT}/lib/udev/devices ]] |
735 |
then |
736 |
rm -f "${ROOT}"/lib/udev/devices/{null,zero,console,urandom} |
737 |
fi |
738 |
|
739 |
# Removing some old file |
740 |
if [[ $previous_less_than_104_r5 = 0 ]] |
741 |
then |
742 |
rm -f "${ROOT}"/etc/dev.d/net/hotplug.dev |
743 |
rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/net 2>/dev/null |
744 |
fi |
745 |
|
746 |
if [[ $previous_less_than_106_r5 = 0 ]] && |
747 |
[[ -e ${ROOT}/etc/udev/rules.d/95-net.rules ]] |
748 |
then |
749 |
rm -f "${ROOT}"/etc/udev/rules.d/95-net.rules |
750 |
fi |
751 |
|
752 |
# Try to remove /etc/dev.d as that is obsolete |
753 |
if [[ -d ${ROOT}/etc/dev.d ]] |
754 |
then |
755 |
rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/default "${ROOT}"/etc/dev.d 2>/dev/null |
756 |
if [[ -d ${ROOT}/etc/dev.d ]] |
757 |
then |
758 |
ewarn "You still have the directory /etc/dev.d on your system." |
759 |
ewarn "This is no longer used by udev and can be removed." |
760 |
fi |
761 |
fi |
762 |
|
763 |
# 64-device-mapper.rules now gets installed by sys-fs/device-mapper |
764 |
# remove it if user don't has sys-fs/device-mapper installed |
765 |
if [[ $previous_less_than_113 = 0 ]] && |
766 |
[[ -f ${ROOT}/etc/udev/rules.d/64-device-mapper.rules ]] && |
767 |
! has_version sys-fs/device-mapper |
768 |
then |
769 |
rm -f "${ROOT}"/etc/udev/rules.d/64-device-mapper.rules |
770 |
einfo "Removed unneeded file 64-device-mapper.rules" |
771 |
fi |
772 |
|
773 |
# requested in Bug #225033: |
774 |
elog |
775 |
elog "persistent-net does assigning fixed names to network devices." |
776 |
elog "If you have problems with persistent-net rules," |
777 |
elog "just delete the rules file" |
778 |
elog "\trm ${ROOT}etc/udev/rules.d/70-persistent-net.rules" |
779 |
elog "and then trigger udev by either running" |
780 |
elog "\tudevadm trigger --subsystem-match=net" |
781 |
elog "or by rebooting." |
782 |
elog |
783 |
elog "This may number your devices in a different way than it is now." |
784 |
|
785 |
if [[ ${ROOT} == / ]] |
786 |
then |
787 |
# check if root of init-process is identical to ours |
788 |
if [[ -r /proc/1/root && /proc/1/root/ -ef /proc/self/root/ ]] |
789 |
then |
790 |
einfo "restarting udevd now." |
791 |
if [[ -n $(pidof udevd) ]] |
792 |
then |
793 |
killall -15 udevd &>/dev/null |
794 |
sleep 1 |
795 |
killall -9 udevd &>/dev/null |
796 |
fi |
797 |
/sbin/udevd --daemon |
798 |
fi |
799 |
fi |
800 |
|
801 |
ewarn "If you build an initramfs including udev, then please" |
802 |
ewarn "make sure that the /sbin/udevadm binary gets included," |
803 |
ewarn "as the helper apps udevinfo, udevtrigger, ... are now" |
804 |
ewarn "only symlinks to udevadm." |
805 |
|
806 |
ewarn |
807 |
ewarn "mount options for directory /dev are no longer" |
808 |
ewarn "set in /etc/udev/udev.conf, but in /etc/fstab" |
809 |
ewarn "as for other directories." |
810 |
|
811 |
elog |
812 |
elog "For more information on udev on Gentoo, writing udev rules, and" |
813 |
elog " fixing known issues visit:" |
814 |
elog " http://www.gentoo.org/doc/en/udev-guide.xml" |
815 |
} |