1 |
zzam 10/02/01 20:54:00 |
2 |
|
3 |
Modified: ChangeLog |
4 |
Added: udev-151-r1.ebuild udev-150-r1.ebuild |
5 |
Removed: udev-151.ebuild udev-150.ebuild |
6 |
Log: |
7 |
Fix missing firmware timeout, to stop modprobe from waiting 60s for no file stretching boot very long, Bug #301667. |
8 |
(Portage version: 2.1.7.17/cvs/Linux x86_64) |
9 |
|
10 |
Revision Changes Path |
11 |
1.525 sys-fs/udev/ChangeLog |
12 |
|
13 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udev/ChangeLog?rev=1.525&view=markup |
14 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udev/ChangeLog?rev=1.525&content-type=text/plain |
15 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udev/ChangeLog?r1=1.524&r2=1.525 |
16 |
|
17 |
Index: ChangeLog |
18 |
=================================================================== |
19 |
RCS file: /var/cvsroot/gentoo-x86/sys-fs/udev/ChangeLog,v |
20 |
retrieving revision 1.524 |
21 |
retrieving revision 1.525 |
22 |
diff -u -r1.524 -r1.525 |
23 |
--- ChangeLog 31 Jan 2010 21:38:17 -0000 1.524 |
24 |
+++ ChangeLog 1 Feb 2010 20:53:59 -0000 1.525 |
25 |
@@ -1,6 +1,15 @@ |
26 |
# ChangeLog for sys-fs/udev |
27 |
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 |
28 |
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/ChangeLog,v 1.524 2010/01/31 21:38:17 zzam Exp $ |
29 |
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/ChangeLog,v 1.525 2010/02/01 20:53:59 zzam Exp $ |
30 |
+ |
31 |
+*udev-151-r1 (01 Feb 2010) |
32 |
+*udev-150-r1 (01 Feb 2010) |
33 |
+ |
34 |
+ 01 Feb 2010; Matthias Schwarzott <zzam@g.o> -udev-150.ebuild, |
35 |
+ +udev-150-r1.ebuild, +files/udev-150-fix-missing-firmware-timeout.diff, |
36 |
+ -udev-151.ebuild, +udev-151-r1.ebuild: |
37 |
+ Fix missing firmware timeout, to stop modprobe from waiting 60s for no |
38 |
+ file stretching boot very long, Bug #301667. |
39 |
|
40 |
31 Jan 2010; Matthias Schwarzott <zzam@g.o> udev-151.ebuild: |
41 |
Fix install error, bug #302903. Removed old code for multilib-installs. |
42 |
|
43 |
|
44 |
|
45 |
1.1 sys-fs/udev/udev-151-r1.ebuild |
46 |
|
47 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udev/udev-151-r1.ebuild?rev=1.1&view=markup |
48 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udev/udev-151-r1.ebuild?rev=1.1&content-type=text/plain |
49 |
|
50 |
Index: udev-151-r1.ebuild |
51 |
=================================================================== |
52 |
# Copyright 1999-2010 Gentoo Foundation |
53 |
# Distributed under the terms of the GNU General Public License v2 |
54 |
# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-151-r1.ebuild,v 1.1 2010/02/01 20:53:59 zzam Exp $ |
55 |
|
56 |
EAPI="1" |
57 |
|
58 |
inherit eutils flag-o-matic multilib toolchain-funcs linux-info |
59 |
|
60 |
#PATCHSET=${P}-gentoo-patchset-v1 |
61 |
|
62 |
if [[ ${PV} == "9999" ]]; then |
63 |
EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/hotplug/udev.git" |
64 |
EGIT_BRANCH="master" |
65 |
inherit git autotools |
66 |
else |
67 |
SRC_URI="mirror://kernel/linux/utils/kernel/hotplug/${P}.tar.bz2" |
68 |
[[ -n "${PATCHSET}" ]] && SRC_URI="${SRC_URI} mirror://gentoo/${PATCHSET}.tar.bz2" |
69 |
fi |
70 |
DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)" |
71 |
HOMEPAGE="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html" |
72 |
|
73 |
LICENSE="GPL-2" |
74 |
SLOT="0" |
75 |
KEYWORDS="-alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 -sh ~sparc ~x86" |
76 |
IUSE="selinux +devfs-compat +old-hd-rules -extras test" |
77 |
|
78 |
COMMON_DEPEND="selinux? ( sys-libs/libselinux ) |
79 |
extras? ( |
80 |
sys-apps/acl |
81 |
>=sys-apps/usbutils-0.82 |
82 |
virtual/libusb:0 |
83 |
sys-apps/pciutils |
84 |
dev-libs/glib:2 |
85 |
) |
86 |
>=sys-apps/util-linux-2.16 |
87 |
>=sys-libs/glibc-2.9" |
88 |
|
89 |
DEPEND="${COMMON_DEPEND} |
90 |
extras? ( dev-util/gperf ) |
91 |
>=sys-kernel/linux-headers-2.6.29 |
92 |
test? ( app-text/tree )" |
93 |
|
94 |
RDEPEND="${COMMON_DEPEND} |
95 |
!sys-apps/coldplug |
96 |
!<sys-fs/lvm2-2.02.45 |
97 |
!sys-fs/device-mapper |
98 |
>=sys-apps/baselayout-1.12.5" |
99 |
|
100 |
if [[ ${PV} == "9999" ]]; then |
101 |
# for documentation processing with xsltproc |
102 |
DEPEND="${DEPEND} |
103 |
app-text/docbook-xsl-stylesheets |
104 |
app-text/docbook-xml-dtd |
105 |
dev-util/gtk-doc" |
106 |
fi |
107 |
|
108 |
# required kernel options |
109 |
CONFIG_CHECK="~INOTIFY_USER ~SIGNALFD ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2 |
110 |
~!IDE" |
111 |
|
112 |
# We need the lib/rcscripts/addon support |
113 |
PROVIDE="virtual/dev-manager" |
114 |
|
115 |
udev_check_KV() { |
116 |
local ok=0 |
117 |
if [[ ${KV_MAJOR} == 2 && ${KV_MINOR} == 6 ]] |
118 |
then |
119 |
if kernel_is -ge 2 6 ${KV_PATCH_reliable} ; then |
120 |
ok=2 |
121 |
elif kernel_is -ge 2 6 ${KV_PATCH_min} ; then |
122 |
ok=1 |
123 |
fi |
124 |
fi |
125 |
return $ok |
126 |
} |
127 |
|
128 |
pkg_setup() { |
129 |
linux-info_pkg_setup |
130 |
|
131 |
udev_libexec_dir="/$(get_libdir)/udev" |
132 |
|
133 |
# udev requires signalfd introduced in kernel 2.6.25, |
134 |
# but a glibc compiled against >=linux-headers-2.6.27 uses the |
135 |
# new signalfd syscall introduced in kernel 2.6.27 without falling back |
136 |
# to the old one. So we just depend on 2.6.27 here, see Bug #281312. |
137 |
KV_PATCH_min=25 |
138 |
KV_PATCH_reliable=27 |
139 |
KV_min=2.6.${KV_PATCH_min} |
140 |
KV_reliable=2.6.${KV_PATCH_reliable} |
141 |
|
142 |
# always print kernel version requirements |
143 |
ewarn |
144 |
ewarn "${P} does not support Linux kernel before version ${KV_min}!" |
145 |
if [[ ${KV_PATCH_min} != ${KV_PATCH_reliable} ]]; then |
146 |
ewarn "For a reliable udev, use at least kernel ${KV_reliable}" |
147 |
fi |
148 |
|
149 |
echo |
150 |
# We don't care about the secondary revision of the kernel. |
151 |
# 2.6.30.4 -> 2.6.30 is all we check |
152 |
udev_check_KV |
153 |
case "$?" in |
154 |
2) einfo "Your kernel version (${KV_FULL}) is new enough to run ${P} reliably." ;; |
155 |
1) ewarn "Your kernel version (${KV_FULL}) is new enough to run ${P}," |
156 |
ewarn "but it may be unreliable in some cases." |
157 |
ebeep ;; |
158 |
0) eerror "Your kernel version (${KV_FULL}) is too old to run ${P}" |
159 |
ebeep ;; |
160 |
esac |
161 |
echo |
162 |
|
163 |
KV_FULL_SRC=${KV_FULL} |
164 |
get_running_version |
165 |
udev_check_KV |
166 |
if [[ "$?" = "0" ]]; then |
167 |
eerror |
168 |
eerror "udev cannot be restarted after emerging," |
169 |
eerror "as your running kernel version (${KV_FULL}) is too old." |
170 |
eerror "You really need to use a newer kernel after a reboot!" |
171 |
NO_RESTART=1 |
172 |
ebeep |
173 |
fi |
174 |
} |
175 |
|
176 |
sed_libexec_dir() { |
177 |
sed -e "s#/lib/udev#${udev_libexec_dir}#" -i "$@" |
178 |
} |
179 |
|
180 |
src_unpack() { |
181 |
if [[ ${PV} == "9999" ]] ; then |
182 |
git_src_unpack |
183 |
else |
184 |
unpack ${A} |
185 |
fi |
186 |
|
187 |
cd "${S}" |
188 |
|
189 |
# patches go here... |
190 |
|
191 |
# backport some patches |
192 |
if [[ -n "${PATCHSET}" ]]; then |
193 |
EPATCH_SOURCE="${WORKDIR}/${PATCHSET}" EPATCH_SUFFIX="patch" \ |
194 |
EPATCH_FORCE="yes" epatch |
195 |
fi |
196 |
|
197 |
# Bug 301667 |
198 |
epatch "${FILESDIR}"/udev-150-fix-missing-firmware-timeout.diff |
199 |
|
200 |
if ! use devfs-compat; then |
201 |
# see Bug #269359 |
202 |
epatch "${FILESDIR}"/udev-141-remove-devfs-names.diff |
203 |
fi |
204 |
|
205 |
# change rules back to group uucp instead of dialout for now |
206 |
sed -e 's/GROUP="dialout"/GROUP="uucp"/' \ |
207 |
-i rules/{rules.d,packages,gentoo}/*.rules \ |
208 |
|| die "failed to change group dialout to uucp" |
209 |
|
210 |
if [[ ${PV} != 9999 ]]; then |
211 |
# Make sure there is no sudden changes to upstream rules file |
212 |
# (more for my own needs than anything else ...) |
213 |
MD5=$(md5sum < "${S}/rules/rules.d/50-udev-default.rules") |
214 |
MD5=${MD5/ -/} |
215 |
if [[ ${MD5} != 5685cc3878df54845dda5e08d712447a ]] |
216 |
then |
217 |
echo |
218 |
eerror "50-udev-default.rules has been updated, please validate!" |
219 |
eerror "md5sum: ${MD5}" |
220 |
die "50-udev-default.rules has been updated, please validate!" |
221 |
fi |
222 |
fi |
223 |
|
224 |
if use old-hd-rules; then |
225 |
epatch "${FILESDIR}"/udev-151-readd-hd-rules.diff |
226 |
fi |
227 |
|
228 |
sed_libexec_dir \ |
229 |
rules/rules.d/50-udev-default.rules \ |
230 |
rules/rules.d/78-sound-card.rules \ |
231 |
extras/rule_generator/write_*_rules \ |
232 |
|| die "sed failed" |
233 |
|
234 |
if [[ ${PV} == 9999 ]]; then |
235 |
gtkdocize --copy |
236 |
eautoreconf |
237 |
fi |
238 |
} |
239 |
|
240 |
src_compile() { |
241 |
filter-flags -fprefetch-loop-arrays |
242 |
|
243 |
econf \ |
244 |
--prefix=/usr \ |
245 |
--sysconfdir=/etc \ |
246 |
--sbindir=/sbin \ |
247 |
--libdir=/usr/$(get_libdir) \ |
248 |
--with-rootlibdir=/$(get_libdir) \ |
249 |
--libexecdir="${udev_libexec_dir}" \ |
250 |
--enable-logging \ |
251 |
$(use_with selinux) \ |
252 |
$(use_enable extras) \ |
253 |
--disable-introspection |
254 |
# we don't have gobject-introspection in portage tree |
255 |
|
256 |
emake || die "compiling udev failed" |
257 |
} |
258 |
|
259 |
src_install() { |
260 |
local scriptdir="${FILESDIR}/151" |
261 |
|
262 |
into / |
263 |
emake DESTDIR="${D}" install || die "make install failed" |
264 |
|
265 |
exeinto "${udev_libexec_dir}" |
266 |
newexe "${FILESDIR}"/net-130-r1.sh net.sh || die "net.sh not installed properly" |
267 |
newexe "${FILESDIR}"/move_tmp_persistent_rules-112-r1.sh move_tmp_persistent_rules.sh \ |
268 |
|| die "move_tmp_persistent_rules.sh not installed properly" |
269 |
newexe "${FILESDIR}"/write_root_link_rule-125 write_root_link_rule \ |
270 |
|| die "write_root_link_rule not installed properly" |
271 |
|
272 |
doexe "${scriptdir}"/shell-compat-KV.sh \ |
273 |
|| die "shell-compat.sh not installed properly" |
274 |
doexe "${scriptdir}"/shell-compat-addon.sh \ |
275 |
|| die "shell-compat.sh not installed properly" |
276 |
|
277 |
keepdir "${udev_libexec_dir}"/state |
278 |
keepdir "${udev_libexec_dir}"/devices |
279 |
|
280 |
# create symlinks for these utilities to /sbin |
281 |
# where multipath-tools expect them to be (Bug #168588) |
282 |
dosym "..${udev_libexec_dir}/scsi_id" /sbin/scsi_id |
283 |
|
284 |
# Add gentoo stuff to udev.conf |
285 |
echo "# If you need to change mount-options, do it in /etc/fstab" \ |
286 |
>> "${D}"/etc/udev/udev.conf |
287 |
|
288 |
# let the dir exist at least |
289 |
keepdir /etc/udev/rules.d |
290 |
|
291 |
# Now installing rules |
292 |
cd "${S}"/rules |
293 |
insinto "${udev_libexec_dir}"/rules.d/ |
294 |
|
295 |
# Our rules files |
296 |
doins gentoo/??-*.rules |
297 |
doins packages/40-isdn.rules |
298 |
|
299 |
# Adding arch specific rules |
300 |
if [[ -f packages/40-${ARCH}.rules ]] |
301 |
then |
302 |
doins "packages/40-${ARCH}.rules" |
303 |
fi |
304 |
cd "${S}" |
305 |
|
306 |
# our udev hooks into the rc system |
307 |
insinto /$(get_libdir)/rcscripts/addons |
308 |
doins "${scriptdir}"/udev-start.sh \ |
309 |
|| die "udev-start.sh not installed properly" |
310 |
doins "${scriptdir}"/udev-stop.sh \ |
311 |
|| die "udev-stop.sh not installed properly" |
312 |
|
313 |
local init |
314 |
# udev-postmount and init-scripts for >=openrc-0.3.1, Bug #240984 |
315 |
for init in udev udev-mount udev-dev-tarball udev-postmount; do |
316 |
newinitd "${scriptdir}/${init}.initd" "${init}" \ |
317 |
|| die "initscript ${init} not installed properly" |
318 |
done |
319 |
|
320 |
# insert minimum kernel versions |
321 |
sed -e "s/%KV_MIN%/${KV_min}/" \ |
322 |
-e "s/%KV_MIN_RELIABLE%/${KV_reliable}/" \ |
323 |
-i "${D}"/etc/init.d/udev-mount |
324 |
|
325 |
# config file for init-script and start-addon |
326 |
newconfd "${scriptdir}/udev.confd" udev \ |
327 |
|| die "config file not installed properly" |
328 |
|
329 |
insinto /etc/modprobe.d |
330 |
newins "${FILESDIR}"/blacklist-146 blacklist.conf |
331 |
newins "${FILESDIR}"/pnp-aliases pnp-aliases.conf |
332 |
|
333 |
# convert /lib/udev to real used dir |
334 |
sed_libexec_dir \ |
335 |
"${D}/$(get_libdir)"/rcscripts/addons/*.sh \ |
336 |
"${D}/${udev_libexec_dir}"/write_root_link_rule \ |
337 |
"${D}"/etc/conf.d/udev \ |
338 |
"${D}"/etc/init.d/udev* \ |
339 |
"${D}"/etc/modprobe.d/* |
340 |
|
341 |
# documentation |
342 |
dodoc ChangeLog README TODO || die "failed installing docs" |
343 |
|
344 |
# keep doc in just one directory, Bug #281137 |
345 |
rm -rf "${D}/usr/share/doc/${PN}" |
346 |
if use extras; then |
347 |
dodoc extras/keymap/README.keymap.txt || die "failed installing docs" |
348 |
fi |
349 |
} |
350 |
|
351 |
pkg_preinst() { |
352 |
# moving old files to support newer modprobe, 12 May 2009 |
353 |
local f dir=${ROOT}/etc/modprobe.d/ |
354 |
for f in pnp-aliases blacklist; do |
355 |
if [[ -f $dir/$f && ! -f $dir/$f.conf ]] |
356 |
then |
357 |
elog "Moving $dir/$f to $f.conf" |
358 |
mv -f "$dir/$f" "$dir/$f.conf" |
359 |
fi |
360 |
done |
361 |
|
362 |
if [[ -d ${ROOT}/lib/udev-state ]] |
363 |
then |
364 |
mv -f "${ROOT}"/lib/udev-state/* "${D}"/lib/udev/state/ |
365 |
rm -r "${ROOT}"/lib/udev-state |
366 |
fi |
367 |
|
368 |
if [[ -f ${ROOT}/etc/udev/udev.config && |
369 |
! -f ${ROOT}/etc/udev/udev.rules ]] |
370 |
then |
371 |
mv -f "${ROOT}"/etc/udev/udev.config "${ROOT}"/etc/udev/udev.rules |
372 |
fi |
373 |
|
374 |
# delete the old udev.hotplug symlink if it is present |
375 |
if [[ -h ${ROOT}/etc/hotplug.d/default/udev.hotplug ]] |
376 |
then |
377 |
rm -f "${ROOT}"/etc/hotplug.d/default/udev.hotplug |
378 |
fi |
379 |
|
380 |
# delete the old wait_for_sysfs.hotplug symlink if it is present |
381 |
if [[ -h ${ROOT}/etc/hotplug.d/default/05-wait_for_sysfs.hotplug ]] |
382 |
then |
383 |
rm -f "${ROOT}"/etc/hotplug.d/default/05-wait_for_sysfs.hotplug |
384 |
fi |
385 |
|
386 |
# delete the old wait_for_sysfs.hotplug symlink if it is present |
387 |
if [[ -h ${ROOT}/etc/hotplug.d/default/10-udev.hotplug ]] |
388 |
then |
389 |
rm -f "${ROOT}"/etc/hotplug.d/default/10-udev.hotplug |
390 |
fi |
391 |
|
392 |
has_version "=${CATEGORY}/${PN}-103-r3" |
393 |
previous_equal_to_103_r3=$? |
394 |
|
395 |
has_version "<${CATEGORY}/${PN}-104-r5" |
396 |
previous_less_than_104_r5=$? |
397 |
|
398 |
has_version "<${CATEGORY}/${PN}-106-r5" |
399 |
previous_less_than_106_r5=$? |
400 |
|
401 |
has_version "<${CATEGORY}/${PN}-113" |
402 |
previous_less_than_113=$? |
403 |
} |
404 |
|
405 |
# 19 Nov 2008 |
406 |
fix_old_persistent_net_rules() { |
407 |
local rules=${ROOT}/etc/udev/rules.d/70-persistent-net.rules |
408 |
[[ -f ${rules} ]] || return |
409 |
|
410 |
elog |
411 |
elog "Updating persistent-net rules file" |
412 |
|
413 |
# Change ATTRS to ATTR matches, Bug #246927 |
414 |
sed -i -e 's/ATTRS{/ATTR{/g' "${rules}" |
415 |
|
416 |
# Add KERNEL matches if missing, Bug #246849 |
417 |
sed -ri \ |
418 |
-e '/KERNEL/ ! { s/NAME="(eth|wlan|ath)([0-9]+)"/KERNEL=="\1*", NAME="\1\2"/}' \ |
419 |
"${rules}" |
420 |
} |
421 |
|
422 |
# See Bug #129204 for a discussion about restarting udevd |
423 |
restart_udevd() { |
424 |
if [[ ${NO_RESTART} = "1" ]]; then |
425 |
ewarn "Not restarting udevd, as your kernel is too old!" |
426 |
return |
427 |
fi |
428 |
|
429 |
# need to merge to our system |
430 |
[[ ${ROOT} = / ]] || return |
431 |
|
432 |
# check if root of init-process is identical to ours (not in chroot) |
433 |
[[ -r /proc/1/root && /proc/1/root/ -ef /proc/self/root/ ]] || return |
434 |
|
435 |
# abort if there is no udevd running |
436 |
[[ -n $(pidof udevd) ]] || return |
437 |
|
438 |
# abort if no /dev/.udev exists |
439 |
[[ -e /dev/.udev ]] || return |
440 |
|
441 |
elog |
442 |
elog "restarting udevd now." |
443 |
|
444 |
killall -15 udevd &>/dev/null |
445 |
sleep 1 |
446 |
killall -9 udevd &>/dev/null |
447 |
|
448 |
/sbin/udevd --daemon |
449 |
sleep 3 |
450 |
if [[ ! -n $(pidof udevd) ]]; then |
451 |
eerror "FATAL: udev died, please check your kernel is" |
452 |
eerror "new enough and configured correctly for ${P}." |
453 |
eerror |
454 |
eerror "Please have a look at this before rebooting." |
455 |
eerror "If in doubt, please downgrade udev back to your old version" |
456 |
ebeep |
457 |
fi |
458 |
} |
459 |
|
460 |
postinst_init_scripts() { |
461 |
# FIXME: we may need some code that detects if this is a system bootstrap |
462 |
# and auto-enables udev then |
463 |
# |
464 |
# FIXME: inconsistent handling of init-scripts here |
465 |
# * udev is added to sysinit in openrc-ebuild |
466 |
# * we add udev-postmount to default in here |
467 |
# |
468 |
|
469 |
# migration to >=openrc-0.4 |
470 |
if [[ -e "${ROOT}"/etc/runlevels/sysinit && ! -e "${ROOT}"/etc/runlevels/sysinit/udev ]] |
471 |
then |
472 |
ewarn |
473 |
ewarn "You need to add the udev init script to the runlevel sysinit," |
474 |
ewarn "else your system will not be able to boot" |
475 |
ewarn "after updating to >=openrc-0.4.0" |
476 |
ewarn "Run this to enable udev for >=openrc-0.4.0:" |
477 |
ewarn "\trc-update add udev sysinit" |
478 |
ewarn |
479 |
fi |
480 |
|
481 |
# add udev-postmount to default runlevel instead of that ugly injecting |
482 |
# like a hotplug event, 2009/10/15 |
483 |
|
484 |
# already enabled? |
485 |
[[ -e "${ROOT}"/etc/runlevels/default/udev-postmount ]] && return |
486 |
|
487 |
local enable_postmount=0 |
488 |
[[ -e "${ROOT}"/etc/runlevels/sysinit/udev ]] && enable_postmount=1 |
489 |
[[ "${ROOT}" = "/" && -d /dev/.udev/ ]] && enable_postmount=1 |
490 |
|
491 |
if [[ ${enable_postmount} = 1 ]] |
492 |
then |
493 |
local initd=udev-postmount |
494 |
|
495 |
if [[ -e ${ROOT}/etc/init.d/${initd} ]] && \ |
496 |
[[ ! -e ${ROOT}/etc/runlevels/default/${initd} ]] |
497 |
then |
498 |
ln -snf /etc/init.d/${initd} "${ROOT}"/etc/runlevels/default/${initd} |
499 |
elog "Auto-adding '${initd}' service to your default runlevel" |
500 |
fi |
501 |
else |
502 |
elog "You should add the udev-postmount service to default runlevel." |
503 |
elog "Run this to add it:" |
504 |
elog "\trc-update add udev-postmount default" |
505 |
fi |
506 |
} |
507 |
|
508 |
pkg_postinst() { |
509 |
fix_old_persistent_net_rules |
510 |
|
511 |
restart_udevd |
512 |
|
513 |
postinst_init_scripts |
514 |
|
515 |
# people want reminders, I'll give them reminders. Odds are they will |
516 |
# just ignore them anyway... |
517 |
|
518 |
# delete 40-scsi-hotplug.rules, it is integrated in 50-udev.rules, 19 Jan 2007 |
519 |
if [[ $previous_equal_to_103_r3 = 0 ]] && |
520 |
[[ -e ${ROOT}/etc/udev/rules.d/40-scsi-hotplug.rules ]] |
521 |
then |
522 |
ewarn "Deleting stray 40-scsi-hotplug.rules" |
523 |
ewarn "installed by sys-fs/udev-103-r3" |
524 |
rm -f "${ROOT}"/etc/udev/rules.d/40-scsi-hotplug.rules |
525 |
fi |
526 |
|
527 |
# Removing some device-nodes we thought we need some time ago, 25 Jan 2007 |
528 |
if [[ -d ${ROOT}/lib/udev/devices ]] |
529 |
then |
530 |
rm -f "${ROOT}"/lib/udev/devices/{null,zero,console,urandom} |
531 |
fi |
532 |
|
533 |
# Removing some old file, 29 Jan 2007 |
534 |
if [[ $previous_less_than_104_r5 = 0 ]] |
535 |
then |
536 |
rm -f "${ROOT}"/etc/dev.d/net/hotplug.dev |
537 |
rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/net 2>/dev/null |
538 |
fi |
539 |
|
540 |
# 19 Mar 2007 |
541 |
if [[ $previous_less_than_106_r5 = 0 ]] && |
542 |
[[ -e ${ROOT}/etc/udev/rules.d/95-net.rules ]] |
543 |
then |
544 |
rm -f "${ROOT}"/etc/udev/rules.d/95-net.rules |
545 |
fi |
546 |
|
547 |
# Try to remove /etc/dev.d as that is obsolete, 23 Apr 2007 |
548 |
if [[ -d ${ROOT}/etc/dev.d ]] |
549 |
then |
550 |
rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/default "${ROOT}"/etc/dev.d 2>/dev/null |
551 |
if [[ -d ${ROOT}/etc/dev.d ]] |
552 |
then |
553 |
ewarn "You still have the directory /etc/dev.d on your system." |
554 |
ewarn "This is no longer used by udev and can be removed." |
555 |
fi |
556 |
fi |
557 |
|
558 |
# 64-device-mapper.rules now gets installed by sys-fs/device-mapper |
559 |
# remove it if user don't has sys-fs/device-mapper installed, 27 Jun 2007 |
560 |
if [[ $previous_less_than_113 = 0 ]] && |
561 |
[[ -f ${ROOT}/etc/udev/rules.d/64-device-mapper.rules ]] && |
562 |
! has_version sys-fs/device-mapper |
563 |
then |
564 |
rm -f "${ROOT}"/etc/udev/rules.d/64-device-mapper.rules |
565 |
einfo "Removed unneeded file 64-device-mapper.rules" |
566 |
fi |
567 |
|
568 |
# requested in bug #275974, added 2009/09/05 |
569 |
ewarn |
570 |
ewarn "If after the udev update removable devices or CD/DVD drives" |
571 |
ewarn "stop working, try re-emerging HAL before filling a bug report" |
572 |
|
573 |
# requested in Bug #225033: |
574 |
elog |
575 |
elog "persistent-net does assigning fixed names to network devices." |
576 |
elog "If you have problems with the persistent-net rules," |
577 |
elog "just delete the rules file" |
578 |
elog "\trm ${ROOT}etc/udev/rules.d/70-persistent-net.rules" |
579 |
elog "and then reboot." |
580 |
elog |
581 |
elog "This may however number your devices in a different way than they are now." |
582 |
|
583 |
ewarn |
584 |
ewarn "If you build an initramfs including udev, then please" |
585 |
ewarn "make sure that the /sbin/udevadm binary gets included," |
586 |
ewarn "and your scripts changed to use it,as it replaces the" |
587 |
ewarn "old helper apps udevinfo, udevtrigger, ..." |
588 |
|
589 |
ewarn |
590 |
ewarn "mount options for directory /dev are no longer" |
591 |
ewarn "set in /etc/udev/udev.conf, but in /etc/fstab" |
592 |
ewarn "as for other directories." |
593 |
|
594 |
if use devfs-compat; then |
595 |
ewarn |
596 |
ewarn "devfs-compat use flag is enabled." |
597 |
ewarn "This enables devfs compatible device names." |
598 |
ewarn "If you use /dev/md/*, /dev/loop/* or /dev/rd/*," |
599 |
ewarn "then please migrate over to using the device names" |
600 |
ewarn "/dev/md*, /dev/loop* and /dev/ram*." |
601 |
ewarn "The devfs-compat rules will be removed in the future." |
602 |
ewarn "For reference see Bug #269359." |
603 |
fi |
604 |
|
605 |
if use old-hd-rules; then |
606 |
ewarn |
607 |
ewarn "old-hd-rules use flag is enabled." |
608 |
ewarn "This adds the removed rules for /dev/hd* devices" |
609 |
ewarn "Please migrate to the new libata." |
610 |
ewarn "These rules will be removed in the future" |
611 |
fi |
612 |
|
613 |
elog |
614 |
elog "For more information on udev on Gentoo, writing udev rules, and" |
615 |
elog " fixing known issues visit:" |
616 |
elog " http://www.gentoo.org/doc/en/udev-guide.xml" |
617 |
} |
618 |
|
619 |
|
620 |
|
621 |
1.1 sys-fs/udev/udev-150-r1.ebuild |
622 |
|
623 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udev/udev-150-r1.ebuild?rev=1.1&view=markup |
624 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udev/udev-150-r1.ebuild?rev=1.1&content-type=text/plain |
625 |
|
626 |
Index: udev-150-r1.ebuild |
627 |
=================================================================== |
628 |
# Copyright 1999-2010 Gentoo Foundation |
629 |
# Distributed under the terms of the GNU General Public License v2 |
630 |
# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-150-r1.ebuild,v 1.1 2010/02/01 20:53:59 zzam Exp $ |
631 |
|
632 |
EAPI="1" |
633 |
|
634 |
inherit eutils flag-o-matic multilib toolchain-funcs linux-info |
635 |
|
636 |
PATCHSET=${P}-gentoo-patchset-v1 |
637 |
|
638 |
if [[ ${PV} == "9999" ]]; then |
639 |
EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/hotplug/udev.git" |
640 |
EGIT_BRANCH="master" |
641 |
inherit git autotools |
642 |
else |
643 |
SRC_URI="mirror://kernel/linux/utils/kernel/hotplug/${P}.tar.bz2 |
644 |
mirror://gentoo/${PATCHSET}.tar.bz2" |
645 |
fi |
646 |
DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)" |
647 |
HOMEPAGE="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html" |
648 |
|
649 |
LICENSE="GPL-2" |
650 |
SLOT="0" |
651 |
KEYWORDS="-alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 -sh ~sparc ~x86" |
652 |
IUSE="selinux +devfs-compat -extras test" |
653 |
|
654 |
COMMON_DEPEND="selinux? ( sys-libs/libselinux ) |
655 |
extras? ( |
656 |
sys-apps/acl |
657 |
>=sys-apps/usbutils-0.82 |
658 |
virtual/libusb:0 |
659 |
sys-apps/pciutils |
660 |
dev-libs/glib:2 |
661 |
) |
662 |
>=sys-apps/util-linux-2.16 |
663 |
>=sys-libs/glibc-2.9" |
664 |
|
665 |
DEPEND="${COMMON_DEPEND} |
666 |
extras? ( dev-util/gperf ) |
667 |
>=sys-kernel/linux-headers-2.6.29 |
668 |
test? ( app-text/tree )" |
669 |
|
670 |
RDEPEND="${COMMON_DEPEND} |
671 |
!sys-apps/coldplug |
672 |
!<sys-fs/lvm2-2.02.45 |
673 |
!sys-fs/device-mapper |
674 |
>=sys-apps/baselayout-1.12.5" |
675 |
|
676 |
if [[ ${PV} == "9999" ]]; then |
677 |
# for documentation processing with xsltproc |
678 |
DEPEND="${DEPEND} |
679 |
app-text/docbook-xsl-stylesheets |
680 |
app-text/docbook-xml-dtd |
681 |
dev-util/gtk-doc" |
682 |
fi |
683 |
|
684 |
# required kernel options |
685 |
CONFIG_CHECK="~INOTIFY_USER ~SIGNALFD ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2" |
686 |
|
687 |
# We need the lib/rcscripts/addon support |
688 |
PROVIDE="virtual/dev-manager" |
689 |
|
690 |
udev_check_KV() { |
691 |
local ok=0 |
692 |
if [[ ${KV_MAJOR} == 2 && ${KV_MINOR} == 6 ]] |
693 |
then |
694 |
if kernel_is -ge 2 6 ${KV_PATCH_reliable} ; then |
695 |
ok=2 |
696 |
elif kernel_is -ge 2 6 ${KV_PATCH_min} ; then |
697 |
ok=1 |
698 |
fi |
699 |
fi |
700 |
return $ok |
701 |
} |
702 |
|
703 |
pkg_setup() { |
704 |
linux-info_pkg_setup |
705 |
|
706 |
udev_libexec_dir="/$(get_libdir)/udev" |
707 |
|
708 |
# udev requires signalfd introduced in kernel 2.6.25, |
709 |
# but a glibc compiled against >=linux-headers-2.6.27 uses the |
710 |
# new signalfd syscall introduced in kernel 2.6.27 without falling back |
711 |
# to the old one. So we just depend on 2.6.27 here, see Bug #281312. |
712 |
KV_PATCH_min=25 |
713 |
KV_PATCH_reliable=27 |
714 |
KV_min=2.6.${KV_PATCH_min} |
715 |
KV_reliable=2.6.${KV_PATCH_reliable} |
716 |
|
717 |
# always print kernel version requirements |
718 |
ewarn |
719 |
ewarn "${P} does not support Linux kernel before version ${KV_min}!" |
720 |
if [[ ${KV_PATCH_min} != ${KV_PATCH_reliable} ]]; then |
721 |
ewarn "For a reliable udev, use at least kernel ${KV_reliable}" |
722 |
fi |
723 |
|
724 |
echo |
725 |
# We don't care about the secondary revision of the kernel. |
726 |
# 2.6.30.4 -> 2.6.30 is all we check |
727 |
udev_check_KV |
728 |
case "$?" in |
729 |
2) einfo "Your kernel version (${KV_FULL}) is new enough to run ${P} reliably." ;; |
730 |
1) ewarn "Your kernel version (${KV_FULL}) is new enough to run ${P}," |
731 |
ewarn "but it may be unreliable in some cases." |
732 |
ebeep ;; |
733 |
0) eerror "Your kernel version (${KV_FULL}) is too old to run ${P}" |
734 |
ebeep ;; |
735 |
esac |
736 |
echo |
737 |
|
738 |
KV_FULL_SRC=${KV_FULL} |
739 |
get_running_version |
740 |
udev_check_KV |
741 |
if [[ "$?" = "0" ]]; then |
742 |
eerror |
743 |
eerror "udev cannot be restarted after emerging," |
744 |
eerror "as your running kernel version (${KV_FULL}) is too old." |
745 |
eerror "You really need to use a newer kernel after a reboot!" |
746 |
NO_RESTART=1 |
747 |
ebeep |
748 |
fi |
749 |
} |
750 |
|
751 |
sed_libexec_dir() { |
752 |
sed -e "s#/lib/udev#${udev_libexec_dir}#" -i "$@" |
753 |
} |
754 |
|
755 |
src_unpack() { |
756 |
if [[ ${PV} == "9999" ]] ; then |
757 |
git_src_unpack |
758 |
else |
759 |
unpack ${A} |
760 |
fi |
761 |
|
762 |
cd "${S}" |
763 |
|
764 |
# patches go here... |
765 |
|
766 |
# backport some patches |
767 |
EPATCH_SOURCE="${WORKDIR}/${PATCHSET}" EPATCH_SUFFIX="patch" \ |
768 |
EPATCH_FORCE="yes" epatch |
769 |
|
770 |
# Bug 301667 |
771 |
epatch "${FILESDIR}"/udev-150-fix-missing-firmware-timeout.diff |
772 |
|
773 |
if ! use devfs-compat; then |
774 |
# see Bug #269359 |
775 |
epatch "${FILESDIR}"/udev-141-remove-devfs-names.diff |
776 |
fi |
777 |
|
778 |
# change rules back to group uucp instead of dialout for now |
779 |
sed -e 's/GROUP="dialout"/GROUP="uucp"/' \ |
780 |
-i rules/{rules.d,packages,gentoo}/*.rules \ |
781 |
|| die "failed to change group dialout to uucp" |
782 |
|
783 |
if [[ ${PV} != 9999 ]]; then |
784 |
# Make sure there is no sudden changes to upstream rules file |
785 |
# (more for my own needs than anything else ...) |
786 |
MD5=$(md5sum < "${S}/rules/rules.d/50-udev-default.rules") |
787 |
MD5=${MD5/ -/} |
788 |
if [[ ${MD5} != f9b06078926d497a25be996be9d79fcc ]] |
789 |
then |
790 |
echo |
791 |
eerror "50-udev-default.rules has been updated, please validate!" |
792 |
eerror "md5sum: ${MD5}" |
793 |
die "50-udev-default.rules has been updated, please validate!" |
794 |
fi |
795 |
fi |
796 |
|
797 |
sed_libexec_dir \ |
798 |
rules/rules.d/50-udev-default.rules \ |
799 |
rules/rules.d/78-sound-card.rules \ |
800 |
extras/rule_generator/write_*_rules \ |
801 |
|| die "sed failed" |
802 |
|
803 |
if [[ ${PV} == 9999 ]]; then |
804 |
gtkdocize --copy |
805 |
eautoreconf |
806 |
fi |
807 |
} |
808 |
|
809 |
src_compile() { |
810 |
filter-flags -fprefetch-loop-arrays |
811 |
|
812 |
econf \ |
813 |
--prefix=/usr \ |
814 |
--sysconfdir=/etc \ |
815 |
--sbindir=/sbin \ |
816 |
--libdir=/usr/$(get_libdir) \ |
817 |
--with-rootlibdir=/$(get_libdir) \ |
818 |
--libexecdir="${udev_libexec_dir}" \ |
819 |
--enable-logging \ |
820 |
$(use_with selinux) \ |
821 |
$(use_enable extras) \ |
822 |
--disable-introspection |
823 |
# we don't have gobject-introspection in portage tree |
824 |
|
825 |
emake || die "compiling udev failed" |
826 |
} |
827 |
|
828 |
src_install() { |
829 |
local scriptdir="${FILESDIR}/147" |
830 |
|
831 |
into / |
832 |
emake DESTDIR="${D}" install || die "make install failed" |
833 |
# without this code, multilib-strict is angry |
834 |
if [[ "$(get_libdir)" != "lib" ]]; then |
835 |
# check if this code is needed, bug #281338 |
836 |
if [[ -d "${D}/lib" ]]; then |
837 |
# we can not just rename /lib to /lib64, because |
838 |
# make install creates /lib64 and /lib |
839 |
einfo "Moving lib to $(get_libdir)" |
840 |
mkdir -p "${D}/$(get_libdir)" |
841 |
mv "${D}"/lib/* "${D}/$(get_libdir)/" |
842 |
rmdir "${D}"/lib |
843 |
else |
844 |
einfo "There is no ${D}/lib, move code can be deleted." |
845 |
fi |
846 |
fi |
847 |
|
848 |
exeinto "${udev_libexec_dir}" |
849 |
newexe "${FILESDIR}"/net-130-r1.sh net.sh || die "net.sh not installed properly" |
850 |
newexe "${FILESDIR}"/move_tmp_persistent_rules-112-r1.sh move_tmp_persistent_rules.sh \ |
851 |
|| die "move_tmp_persistent_rules.sh not installed properly" |
852 |
newexe "${FILESDIR}"/write_root_link_rule-125 write_root_link_rule \ |
853 |
|| die "write_root_link_rule not installed properly" |
854 |
|
855 |
doexe "${scriptdir}"/shell-compat-KV.sh \ |
856 |
|| die "shell-compat.sh not installed properly" |
857 |
doexe "${scriptdir}"/shell-compat-addon.sh \ |
858 |
|| die "shell-compat.sh not installed properly" |
859 |
|
860 |
keepdir "${udev_libexec_dir}"/state |
861 |
keepdir "${udev_libexec_dir}"/devices |
862 |
|
863 |
# create symlinks for these utilities to /sbin |
864 |
# where multipath-tools expect them to be (Bug #168588) |
865 |
dosym "..${udev_libexec_dir}/scsi_id" /sbin/scsi_id |
866 |
|
867 |
# Add gentoo stuff to udev.conf |
868 |
echo "# If you need to change mount-options, do it in /etc/fstab" \ |
869 |
>> "${D}"/etc/udev/udev.conf |
870 |
|
871 |
# let the dir exist at least |
872 |
keepdir /etc/udev/rules.d |
873 |
|
874 |
# Now installing rules |
875 |
cd "${S}"/rules |
876 |
insinto "${udev_libexec_dir}"/rules.d/ |
877 |
|
878 |
# Our rules files |
879 |
doins gentoo/??-*.rules |
880 |
doins packages/40-isdn.rules |
881 |
|
882 |
# Adding arch specific rules |
883 |
if [[ -f packages/40-${ARCH}.rules ]] |
884 |
then |
885 |
doins "packages/40-${ARCH}.rules" |
886 |
fi |
887 |
cd "${S}" |
888 |
|
889 |
# our udev hooks into the rc system |
890 |
insinto /$(get_libdir)/rcscripts/addons |
891 |
doins "${scriptdir}"/udev-start.sh \ |
892 |
|| die "udev-start.sh not installed properly" |
893 |
doins "${scriptdir}"/udev-stop.sh \ |
894 |
|| die "udev-stop.sh not installed properly" |
895 |
|
896 |
local init |
897 |
# udev-postmount and init-scripts for >=openrc-0.3.1, Bug #240984 |
898 |
for init in udev udev-mount udev-dev-tarball udev-postmount; do |
899 |
newinitd "${scriptdir}/${init}.initd" "${init}" \ |
900 |
|| die "initscript ${init} not installed properly" |
901 |
done |
902 |
|
903 |
# insert minimum kernel versions |
904 |
sed -e "s/%KV_MIN%/${KV_min}/" \ |
905 |
-e "s/%KV_MIN_RELIABLE%/${KV_reliable}/" \ |
906 |
-i "${D}"/etc/init.d/udev-mount |
907 |
|
908 |
# config file for init-script and start-addon |
909 |
newconfd "${scriptdir}/udev.confd" udev \ |
910 |
|| die "config file not installed properly" |
911 |
|
912 |
insinto /etc/modprobe.d |
913 |
newins "${FILESDIR}"/blacklist-146 blacklist.conf |
914 |
newins "${FILESDIR}"/pnp-aliases pnp-aliases.conf |
915 |
|
916 |
# convert /lib/udev to real used dir |
917 |
sed_libexec_dir \ |
918 |
"${D}/$(get_libdir)"/rcscripts/addons/*.sh \ |
919 |
"${D}/${udev_libexec_dir}"/write_root_link_rule \ |
920 |
"${D}"/etc/conf.d/udev \ |
921 |
"${D}"/etc/init.d/udev* \ |
922 |
"${D}"/etc/modprobe.d/* |
923 |
|
924 |
# documentation |
925 |
dodoc ChangeLog README TODO || die "failed installing docs" |
926 |
|
927 |
# keep doc in just one directory, Bug #281137 |
928 |
rm -rf "${D}/usr/share/doc/${PN}" |
929 |
if use extras; then |
930 |
dodoc extras/keymap/README.keymap.txt || die "failed installing docs" |
931 |
fi |
932 |
|
933 |
cd docs/writing_udev_rules |
934 |
mv index.html writing_udev_rules.html |
935 |
dohtml *.html |
936 |
} |
937 |
|
938 |
pkg_preinst() { |
939 |
# moving old files to support newer modprobe, 12 May 2009 |
940 |
local f dir=${ROOT}/etc/modprobe.d/ |
941 |
for f in pnp-aliases blacklist; do |
942 |
if [[ -f $dir/$f && ! -f $dir/$f.conf ]] |
943 |
then |
944 |
elog "Moving $dir/$f to $f.conf" |
945 |
mv -f "$dir/$f" "$dir/$f.conf" |
946 |
fi |
947 |
done |
948 |
|
949 |
if [[ -d ${ROOT}/lib/udev-state ]] |
950 |
then |
951 |
mv -f "${ROOT}"/lib/udev-state/* "${D}"/lib/udev/state/ |
952 |
rm -r "${ROOT}"/lib/udev-state |
953 |
fi |
954 |
|
955 |
if [[ -f ${ROOT}/etc/udev/udev.config && |
956 |
! -f ${ROOT}/etc/udev/udev.rules ]] |
957 |
then |
958 |
mv -f "${ROOT}"/etc/udev/udev.config "${ROOT}"/etc/udev/udev.rules |
959 |
fi |
960 |
|
961 |
# delete the old udev.hotplug symlink if it is present |
962 |
if [[ -h ${ROOT}/etc/hotplug.d/default/udev.hotplug ]] |
963 |
then |
964 |
rm -f "${ROOT}"/etc/hotplug.d/default/udev.hotplug |
965 |
fi |
966 |
|
967 |
# delete the old wait_for_sysfs.hotplug symlink if it is present |
968 |
if [[ -h ${ROOT}/etc/hotplug.d/default/05-wait_for_sysfs.hotplug ]] |
969 |
then |
970 |
rm -f "${ROOT}"/etc/hotplug.d/default/05-wait_for_sysfs.hotplug |
971 |
fi |
972 |
|
973 |
# delete the old wait_for_sysfs.hotplug symlink if it is present |
974 |
if [[ -h ${ROOT}/etc/hotplug.d/default/10-udev.hotplug ]] |
975 |
then |
976 |
rm -f "${ROOT}"/etc/hotplug.d/default/10-udev.hotplug |
977 |
fi |
978 |
|
979 |
has_version "=${CATEGORY}/${PN}-103-r3" |
980 |
previous_equal_to_103_r3=$? |
981 |
|
982 |
has_version "<${CATEGORY}/${PN}-104-r5" |
983 |
previous_less_than_104_r5=$? |
984 |
|
985 |
has_version "<${CATEGORY}/${PN}-106-r5" |
986 |
previous_less_than_106_r5=$? |
987 |
|
988 |
has_version "<${CATEGORY}/${PN}-113" |
989 |
previous_less_than_113=$? |
990 |
} |
991 |
|
992 |
# 19 Nov 2008 |
993 |
fix_old_persistent_net_rules() { |
994 |
local rules=${ROOT}/etc/udev/rules.d/70-persistent-net.rules |
995 |
[[ -f ${rules} ]] || return |
996 |
|
997 |
elog |
998 |
elog "Updating persistent-net rules file" |
999 |
|
1000 |
# Change ATTRS to ATTR matches, Bug #246927 |
1001 |
sed -i -e 's/ATTRS{/ATTR{/g' "${rules}" |
1002 |
|
1003 |
# Add KERNEL matches if missing, Bug #246849 |
1004 |
sed -ri \ |
1005 |
-e '/KERNEL/ ! { s/NAME="(eth|wlan|ath)([0-9]+)"/KERNEL=="\1*", NAME="\1\2"/}' \ |
1006 |
"${rules}" |
1007 |
} |
1008 |
|
1009 |
# See Bug #129204 for a discussion about restarting udevd |
1010 |
restart_udevd() { |
1011 |
if [[ ${NO_RESTART} = "1" ]]; then |
1012 |
ewarn "Not restarting udevd, as your kernel is too old!" |
1013 |
return |
1014 |
fi |
1015 |
|
1016 |
# need to merge to our system |
1017 |
[[ ${ROOT} = / ]] || return |
1018 |
|
1019 |
# check if root of init-process is identical to ours (not in chroot) |
1020 |
[[ -r /proc/1/root && /proc/1/root/ -ef /proc/self/root/ ]] || return |
1021 |
|
1022 |
# abort if there is no udevd running |
1023 |
[[ -n $(pidof udevd) ]] || return |
1024 |
|
1025 |
# abort if no /dev/.udev exists |
1026 |
[[ -e /dev/.udev ]] || return |
1027 |
|
1028 |
elog |
1029 |
elog "restarting udevd now." |
1030 |
|
1031 |
killall -15 udevd &>/dev/null |
1032 |
sleep 1 |
1033 |
killall -9 udevd &>/dev/null |
1034 |
|
1035 |
/sbin/udevd --daemon |
1036 |
sleep 3 |
1037 |
if [[ ! -n $(pidof udevd) ]]; then |
1038 |
eerror "FATAL: udev died, please check your kernel is" |
1039 |
eerror "new enough and configured correctly for ${P}." |
1040 |
eerror |
1041 |
eerror "Please have a look at this before rebooting." |
1042 |
eerror "If in doubt, please downgrade udev back to your old version" |
1043 |
ebeep |
1044 |
fi |
1045 |
} |
1046 |
|
1047 |
postinst_init_scripts() { |
1048 |
# FIXME: we may need some code that detects if this is a system bootstrap |
1049 |
# and auto-enables udev then |
1050 |
# |
1051 |
# FIXME: inconsistent handling of init-scripts here |
1052 |
# * udev is added to sysinit in openrc-ebuild |
1053 |
# * we add udev-postmount to default in here |
1054 |
# |
1055 |
|
1056 |
# migration to >=openrc-0.4 |
1057 |
if [[ -e "${ROOT}"/etc/runlevels/sysinit && ! -e "${ROOT}"/etc/runlevels/sysinit/udev ]] |
1058 |
then |
1059 |
ewarn |
1060 |
ewarn "You need to add the udev init script to the runlevel sysinit," |
1061 |
ewarn "else your system will not be able to boot" |
1062 |
ewarn "after updating to >=openrc-0.4.0" |
1063 |
ewarn "Run this to enable udev for >=openrc-0.4.0:" |
1064 |
ewarn "\trc-update add udev sysinit" |
1065 |
ewarn |
1066 |
fi |
1067 |
|
1068 |
# add udev-postmount to default runlevel instead of that ugly injecting |
1069 |
# like a hotplug event, 2009/10/15 |
1070 |
|
1071 |
# already enabled? |
1072 |
[[ -e "${ROOT}"/etc/runlevels/default/udev-postmount ]] && return |
1073 |
|
1074 |
local enable_postmount=0 |
1075 |
[[ -e "${ROOT}"/etc/runlevels/sysinit/udev ]] && enable_postmount=1 |
1076 |
[[ "${ROOT}" = "/" && -d /dev/.udev/ ]] && enable_postmount=1 |
1077 |
|
1078 |
if [[ ${enable_postmount} = 1 ]] |
1079 |
then |
1080 |
local initd=udev-postmount |
1081 |
|
1082 |
if [[ -e ${ROOT}/etc/init.d/${initd} ]] && \ |
1083 |
[[ ! -e ${ROOT}/etc/runlevels/default/${initd} ]] |
1084 |
then |
1085 |
ln -snf /etc/init.d/${initd} "${ROOT}"/etc/runlevels/default/${initd} |
1086 |
elog "Auto-adding '${initd}' service to your default runlevel" |
1087 |
fi |
1088 |
else |
1089 |
elog "You should add the udev-postmount service to default runlevel." |
1090 |
elog "Run this to add it:" |
1091 |
elog "\trc-update add udev-postmount default" |
1092 |
fi |
1093 |
} |
1094 |
|
1095 |
pkg_postinst() { |
1096 |
fix_old_persistent_net_rules |
1097 |
|
1098 |
restart_udevd |
1099 |
|
1100 |
postinst_init_scripts |
1101 |
|
1102 |
# people want reminders, I'll give them reminders. Odds are they will |
1103 |
# just ignore them anyway... |
1104 |
|
1105 |
# delete 40-scsi-hotplug.rules, it is integrated in 50-udev.rules, 19 Jan 2007 |
1106 |
if [[ $previous_equal_to_103_r3 = 0 ]] && |
1107 |
[[ -e ${ROOT}/etc/udev/rules.d/40-scsi-hotplug.rules ]] |
1108 |
then |
1109 |
ewarn "Deleting stray 40-scsi-hotplug.rules" |
1110 |
ewarn "installed by sys-fs/udev-103-r3" |
1111 |
rm -f "${ROOT}"/etc/udev/rules.d/40-scsi-hotplug.rules |
1112 |
fi |
1113 |
|
1114 |
# Removing some device-nodes we thought we need some time ago, 25 Jan 2007 |
1115 |
if [[ -d ${ROOT}/lib/udev/devices ]] |
1116 |
then |
1117 |
rm -f "${ROOT}"/lib/udev/devices/{null,zero,console,urandom} |
1118 |
fi |
1119 |
|
1120 |
# Removing some old file, 29 Jan 2007 |
1121 |
if [[ $previous_less_than_104_r5 = 0 ]] |
1122 |
then |
1123 |
rm -f "${ROOT}"/etc/dev.d/net/hotplug.dev |
1124 |
rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/net 2>/dev/null |
1125 |
fi |
1126 |
|
1127 |
# 19 Mar 2007 |
1128 |
if [[ $previous_less_than_106_r5 = 0 ]] && |
1129 |
[[ -e ${ROOT}/etc/udev/rules.d/95-net.rules ]] |
1130 |
then |
1131 |
rm -f "${ROOT}"/etc/udev/rules.d/95-net.rules |
1132 |
fi |
1133 |
|
1134 |
# Try to remove /etc/dev.d as that is obsolete, 23 Apr 2007 |
1135 |
if [[ -d ${ROOT}/etc/dev.d ]] |
1136 |
then |
1137 |
rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/default "${ROOT}"/etc/dev.d 2>/dev/null |
1138 |
if [[ -d ${ROOT}/etc/dev.d ]] |
1139 |
then |
1140 |
ewarn "You still have the directory /etc/dev.d on your system." |
1141 |
ewarn "This is no longer used by udev and can be removed." |
1142 |
fi |
1143 |
fi |
1144 |
|
1145 |
# 64-device-mapper.rules now gets installed by sys-fs/device-mapper |
1146 |
# remove it if user don't has sys-fs/device-mapper installed, 27 Jun 2007 |
1147 |
if [[ $previous_less_than_113 = 0 ]] && |
1148 |
[[ -f ${ROOT}/etc/udev/rules.d/64-device-mapper.rules ]] && |
1149 |
! has_version sys-fs/device-mapper |
1150 |
then |
1151 |
rm -f "${ROOT}"/etc/udev/rules.d/64-device-mapper.rules |
1152 |
einfo "Removed unneeded file 64-device-mapper.rules" |
1153 |
fi |
1154 |
|
1155 |
# requested in bug #275974, added 2009/09/05 |
1156 |
ewarn |
1157 |
ewarn "If after the udev update removable devices or CD/DVD drives" |
1158 |
ewarn "stop working, try re-emerging HAL before filling a bug report" |
1159 |
|
1160 |
# requested in Bug #225033: |
1161 |
elog |
1162 |
elog "persistent-net does assigning fixed names to network devices." |
1163 |
elog "If you have problems with the persistent-net rules," |
1164 |
elog "just delete the rules file" |
1165 |
elog "\trm ${ROOT}etc/udev/rules.d/70-persistent-net.rules" |
1166 |
elog "and then reboot." |
1167 |
elog |
1168 |
elog "This may however number your devices in a different way than they are now." |
1169 |
|
1170 |
ewarn |
1171 |
ewarn "If you build an initramfs including udev, then please" |
1172 |
ewarn "make sure that the /sbin/udevadm binary gets included," |
1173 |
ewarn "and your scripts changed to use it,as it replaces the" |
1174 |
ewarn "old helper apps udevinfo, udevtrigger, ..." |
1175 |
|
1176 |
ewarn |
1177 |
ewarn "mount options for directory /dev are no longer" |
1178 |
ewarn "set in /etc/udev/udev.conf, but in /etc/fstab" |
1179 |
ewarn "as for other directories." |
1180 |
|
1181 |
if use devfs-compat; then |
1182 |
ewarn |
1183 |
ewarn "You have devfs-compat use flag enabled." |
1184 |
ewarn "This enables devfs compatible device names." |
1185 |
ewarn "If you use /dev/md/*, /dev/loop/* or /dev/rd/*," |
1186 |
ewarn "then please migrate over to using the device names" |
1187 |
ewarn "/dev/md*, /dev/loop* and /dev/ram*." |
1188 |
ewarn "The devfs-compat rules will be removed in the future." |
1189 |
ewarn "For reference see Bug #269359." |
1190 |
fi |
1191 |
|
1192 |
elog |
1193 |
elog "For more information on udev on Gentoo, writing udev rules, and" |
1194 |
elog " fixing known issues visit:" |
1195 |
elog " http://www.gentoo.org/doc/en/udev-guide.xml" |
1196 |
} |