1 |
zzam 10/08/24 18:41:29 |
2 |
|
3 |
Modified: ChangeLog |
4 |
Added: udev-161.ebuild |
5 |
Log: |
6 |
Version bumped. Fixed dir_writable check printing an error to console when test fails, bug #326825. |
7 |
(Portage version: 2.2_rc67/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.555 sys-fs/udev/ChangeLog |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/udev/ChangeLog?rev=1.555&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/udev/ChangeLog?rev=1.555&content-type=text/plain |
14 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/udev/ChangeLog?r1=1.554&r2=1.555 |
15 |
|
16 |
Index: ChangeLog |
17 |
=================================================================== |
18 |
RCS file: /var/cvsroot/gentoo-x86/sys-fs/udev/ChangeLog,v |
19 |
retrieving revision 1.554 |
20 |
retrieving revision 1.555 |
21 |
diff -u -r1.554 -r1.555 |
22 |
--- ChangeLog 24 Aug 2010 18:28:32 -0000 1.554 |
23 |
+++ ChangeLog 24 Aug 2010 18:41:29 -0000 1.555 |
24 |
@@ -1,6 +1,19 @@ |
25 |
# ChangeLog for sys-fs/udev |
26 |
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 |
27 |
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/ChangeLog,v 1.554 2010/08/24 18:28:32 zzam Exp $ |
28 |
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/ChangeLog,v 1.555 2010/08/24 18:41:29 zzam Exp $ |
29 |
+ |
30 |
+*udev-161 (24 Aug 2010) |
31 |
+ |
32 |
+ 24 Aug 2010; Matthias Schwarzott <zzam@g.o> |
33 |
+ +files/udev-161-cdrom_id_Drop_MEDIA_SESSION_NEXT_for_DVD-RW-RO.patch, |
34 |
+ +files/161/40-gentoo.rules, +files/161/90-network.rules, |
35 |
+ +files/161/shell-compat-KV.sh, +files/161/shell-compat-addon.sh, |
36 |
+ +files/161/udev.confd, +files/161/udev-dev-tarball.initd, |
37 |
+ +udev-161.ebuild, +files/161/udev.initd, +files/161/udev-mount.initd, |
38 |
+ +files/161/udev-postmount.initd, +files/161/udev-start.sh, |
39 |
+ +files/161/udev-stop.sh: |
40 |
+ Version bumped. Fixed dir_writable check printing an error to console when |
41 |
+ test fails, bug #326825. |
42 |
|
43 |
24 Aug 2010; Matthias Schwarzott <zzam@g.o> udev-149.ebuild, |
44 |
udev-150-r1.ebuild, udev-151-r1.ebuild, udev-151-r2.ebuild, |
45 |
|
46 |
|
47 |
|
48 |
1.1 sys-fs/udev/udev-161.ebuild |
49 |
|
50 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/udev/udev-161.ebuild?rev=1.1&view=markup |
51 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/udev/udev-161.ebuild?rev=1.1&content-type=text/plain |
52 |
|
53 |
Index: udev-161.ebuild |
54 |
=================================================================== |
55 |
# Copyright 1999-2010 Gentoo Foundation |
56 |
# Distributed under the terms of the GNU General Public License v2 |
57 |
# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-161.ebuild,v 1.1 2010/08/24 18:41:29 zzam Exp $ |
58 |
|
59 |
EAPI="1" |
60 |
|
61 |
inherit eutils flag-o-matic multilib toolchain-funcs linux-info |
62 |
|
63 |
#PATCHSET=${P}-gentoo-patchset-v1 |
64 |
scriptversion=161 |
65 |
|
66 |
if [[ ${PV} == "9999" ]]; then |
67 |
EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/hotplug/udev.git" |
68 |
EGIT_BRANCH="master" |
69 |
inherit git autotools |
70 |
else |
71 |
# please update testsys-tarball whenever udev-xxx/test/sys/ is changed |
72 |
SRC_URI="mirror://kernel/linux/utils/kernel/hotplug/${P}.tar.bz2 |
73 |
test? ( mirror://gentoo/${PN}-151-testsys.tar.bz2 )" |
74 |
[[ -n "${PATCHSET}" ]] && SRC_URI="${SRC_URI} mirror://gentoo/${PATCHSET}.tar.bz2" |
75 |
fi |
76 |
DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)" |
77 |
HOMEPAGE="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html" |
78 |
|
79 |
LICENSE="GPL-2" |
80 |
SLOT="0" |
81 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" |
82 |
IUSE="selinux extras test" |
83 |
|
84 |
COMMON_DEPEND="selinux? ( sys-libs/libselinux ) |
85 |
extras? ( |
86 |
sys-apps/acl |
87 |
>=sys-apps/usbutils-0.82 |
88 |
virtual/libusb:0 |
89 |
sys-apps/pciutils |
90 |
dev-libs/glib:2 |
91 |
) |
92 |
>=sys-apps/util-linux-2.16 |
93 |
>=sys-libs/glibc-2.9" |
94 |
|
95 |
DEPEND="${COMMON_DEPEND} |
96 |
extras? ( |
97 |
dev-util/gperf |
98 |
dev-util/pkgconfig |
99 |
) |
100 |
virtual/os-headers |
101 |
!<sys-kernel/linux-headers-2.6.29 |
102 |
test? ( app-text/tree )" |
103 |
|
104 |
RDEPEND="${COMMON_DEPEND} |
105 |
!sys-apps/coldplug |
106 |
!<sys-fs/lvm2-2.02.45 |
107 |
!sys-fs/device-mapper |
108 |
>=sys-apps/baselayout-1.12.5" |
109 |
|
110 |
if [[ ${PV} == "9999" ]]; then |
111 |
# for documentation processing with xsltproc |
112 |
DEPEND="${DEPEND} |
113 |
app-text/docbook-xsl-stylesheets |
114 |
app-text/docbook-xml-dtd |
115 |
dev-util/gtk-doc" |
116 |
fi |
117 |
|
118 |
# required kernel options |
119 |
CONFIG_CHECK="~INOTIFY_USER ~SIGNALFD ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2 |
120 |
~!IDE" |
121 |
|
122 |
# We need the lib/rcscripts/addon support |
123 |
PROVIDE="virtual/dev-manager" |
124 |
|
125 |
udev_check_KV() { |
126 |
local ok=0 |
127 |
if [[ ${KV_MAJOR} == 2 && ${KV_MINOR} == 6 ]] |
128 |
then |
129 |
if kernel_is -ge 2 6 ${KV_PATCH_reliable} ; then |
130 |
ok=2 |
131 |
elif kernel_is -ge 2 6 ${KV_PATCH_min} ; then |
132 |
ok=1 |
133 |
fi |
134 |
fi |
135 |
return $ok |
136 |
} |
137 |
|
138 |
pkg_setup() { |
139 |
linux-info_pkg_setup |
140 |
|
141 |
udev_libexec_dir="/$(get_libdir)/udev" |
142 |
|
143 |
# udev requires signalfd introduced in kernel 2.6.25, |
144 |
# but a glibc compiled against >=linux-headers-2.6.27 uses the |
145 |
# new signalfd syscall introduced in kernel 2.6.27 without falling back |
146 |
# to the old one. So we just depend on 2.6.27 here, see Bug #281312. |
147 |
KV_PATCH_min=25 |
148 |
KV_PATCH_reliable=27 |
149 |
KV_min=2.6.${KV_PATCH_min} |
150 |
KV_reliable=2.6.${KV_PATCH_reliable} |
151 |
|
152 |
# always print kernel version requirements |
153 |
ewarn |
154 |
ewarn "${P} does not support Linux kernel before version ${KV_min}!" |
155 |
if [[ ${KV_PATCH_min} != ${KV_PATCH_reliable} ]]; then |
156 |
ewarn "For a reliable udev, use at least kernel ${KV_reliable}" |
157 |
fi |
158 |
|
159 |
echo |
160 |
# We don't care about the secondary revision of the kernel. |
161 |
# 2.6.30.4 -> 2.6.30 is all we check |
162 |
udev_check_KV |
163 |
case "$?" in |
164 |
2) einfo "Your kernel version (${KV_FULL}) is new enough to run ${P} reliably." ;; |
165 |
1) ewarn "Your kernel version (${KV_FULL}) is new enough to run ${P}," |
166 |
ewarn "but it may be unreliable in some cases." |
167 |
ebeep ;; |
168 |
0) eerror "Your kernel version (${KV_FULL}) is too old to run ${P}" |
169 |
ebeep ;; |
170 |
esac |
171 |
echo |
172 |
|
173 |
KV_FULL_SRC=${KV_FULL} |
174 |
get_running_version |
175 |
udev_check_KV |
176 |
if [[ "$?" = "0" ]]; then |
177 |
eerror |
178 |
eerror "udev cannot be restarted after emerging," |
179 |
eerror "as your running kernel version (${KV_FULL}) is too old." |
180 |
eerror "You really need to use a newer kernel after a reboot!" |
181 |
NO_RESTART=1 |
182 |
ebeep |
183 |
fi |
184 |
} |
185 |
|
186 |
sed_libexec_dir() { |
187 |
sed -e "s#/lib/udev#${udev_libexec_dir}#" -i "$@" |
188 |
} |
189 |
|
190 |
src_unpack() { |
191 |
if [[ ${PV} == "9999" ]] ; then |
192 |
git_src_unpack |
193 |
else |
194 |
unpack ${A} |
195 |
|
196 |
if use test; then |
197 |
mv "${WORKDIR}"/test/sys "${S}"/test/ |
198 |
fi |
199 |
fi |
200 |
|
201 |
cd "${S}" |
202 |
|
203 |
# patches go here... |
204 |
epatch "${FILESDIR}/udev-161-cdrom_id_Drop_MEDIA_SESSION_NEXT_for_DVD-RW-RO.patch" |
205 |
|
206 |
# backport some patches |
207 |
if [[ -n "${PATCHSET}" ]]; then |
208 |
EPATCH_SOURCE="${WORKDIR}/${PATCHSET}" EPATCH_SUFFIX="patch" \ |
209 |
EPATCH_FORCE="yes" epatch |
210 |
fi |
211 |
|
212 |
# change rules back to group uucp instead of dialout for now |
213 |
sed -e 's/GROUP="dialout"/GROUP="uucp"/' \ |
214 |
-i rules/{rules.d,arch}/*.rules \ |
215 |
|| die "failed to change group dialout to uucp" |
216 |
|
217 |
if [[ ${PV} != 9999 ]]; then |
218 |
# Make sure there is no sudden changes to upstream rules file |
219 |
# (more for my own needs than anything else ...) |
220 |
MD5=$(md5sum < "${S}/rules/rules.d/50-udev-default.rules") |
221 |
MD5=${MD5/ -/} |
222 |
if [[ ${MD5} != 4c325a57c0624e240c2180744385fa3a ]] |
223 |
then |
224 |
echo |
225 |
eerror "50-udev-default.rules has been updated, please validate!" |
226 |
eerror "md5sum: ${MD5}" |
227 |
die "50-udev-default.rules has been updated, please validate!" |
228 |
fi |
229 |
fi |
230 |
|
231 |
sed_libexec_dir \ |
232 |
rules/rules.d/50-udev-default.rules \ |
233 |
rules/rules.d/78-sound-card.rules \ |
234 |
extras/rule_generator/write_*_rules \ |
235 |
|| die "sed failed" |
236 |
|
237 |
if [[ ${PV} == 9999 ]]; then |
238 |
gtkdocize --copy |
239 |
eautoreconf |
240 |
fi |
241 |
} |
242 |
|
243 |
src_compile() { |
244 |
filter-flags -fprefetch-loop-arrays |
245 |
|
246 |
econf \ |
247 |
--prefix=/usr \ |
248 |
--sysconfdir=/etc \ |
249 |
--sbindir=/sbin \ |
250 |
--libdir=/usr/$(get_libdir) \ |
251 |
--with-rootlibdir=/$(get_libdir) \ |
252 |
--libexecdir="${udev_libexec_dir}" \ |
253 |
--enable-logging \ |
254 |
--enable-static \ |
255 |
$(use_with selinux) \ |
256 |
$(use_enable extras) \ |
257 |
--disable-introspection |
258 |
# we don't have gobject-introspection in portage tree |
259 |
|
260 |
emake || die "compiling udev failed" |
261 |
} |
262 |
|
263 |
src_install() { |
264 |
local scriptdir="${FILESDIR}/${scriptversion}" |
265 |
|
266 |
into / |
267 |
emake DESTDIR="${D}" install || die "make install failed" |
268 |
|
269 |
exeinto "${udev_libexec_dir}" |
270 |
newexe "${FILESDIR}"/net-130-r1.sh net.sh || die "net.sh not installed properly" |
271 |
newexe "${FILESDIR}"/move_tmp_persistent_rules-112-r1.sh move_tmp_persistent_rules.sh \ |
272 |
|| die "move_tmp_persistent_rules.sh not installed properly" |
273 |
newexe "${FILESDIR}"/write_root_link_rule-125 write_root_link_rule \ |
274 |
|| die "write_root_link_rule not installed properly" |
275 |
|
276 |
doexe "${scriptdir}"/shell-compat-KV.sh \ |
277 |
|| die "shell-compat.sh not installed properly" |
278 |
doexe "${scriptdir}"/shell-compat-addon.sh \ |
279 |
|| die "shell-compat.sh not installed properly" |
280 |
|
281 |
keepdir "${udev_libexec_dir}"/state |
282 |
keepdir "${udev_libexec_dir}"/devices |
283 |
|
284 |
# create symlinks for these utilities to /sbin |
285 |
# where multipath-tools expect them to be (Bug #168588) |
286 |
dosym "..${udev_libexec_dir}/scsi_id" /sbin/scsi_id |
287 |
|
288 |
# Add gentoo stuff to udev.conf |
289 |
echo "# If you need to change mount-options, do it in /etc/fstab" \ |
290 |
>> "${D}"/etc/udev/udev.conf |
291 |
|
292 |
# let the dir exist at least |
293 |
keepdir /etc/udev/rules.d |
294 |
|
295 |
# Now installing rules |
296 |
cd "${S}"/rules |
297 |
insinto "${udev_libexec_dir}"/rules.d/ |
298 |
|
299 |
# Our rules files |
300 |
doins "${scriptdir}"/??-*.rules |
301 |
|
302 |
# support older kernels |
303 |
doins misc/30-kernel-compat.rules |
304 |
|
305 |
# Adding arch specific rules |
306 |
if [[ -f arch/40-${ARCH}.rules ]] |
307 |
then |
308 |
doins "arch/40-${ARCH}.rules" |
309 |
fi |
310 |
cd "${S}" |
311 |
|
312 |
# our udev hooks into the rc system |
313 |
insinto /$(get_libdir)/rcscripts/addons |
314 |
doins "${scriptdir}"/udev-start.sh \ |
315 |
|| die "udev-start.sh not installed properly" |
316 |
doins "${scriptdir}"/udev-stop.sh \ |
317 |
|| die "udev-stop.sh not installed properly" |
318 |
|
319 |
local init |
320 |
# udev-postmount and init-scripts for >=openrc-0.3.1, Bug #240984 |
321 |
for init in udev udev-mount udev-dev-tarball udev-postmount; do |
322 |
newinitd "${scriptdir}/${init}.initd" "${init}" \ |
323 |
|| die "initscript ${init} not installed properly" |
324 |
done |
325 |
|
326 |
# insert minimum kernel versions |
327 |
sed -e "s/%KV_MIN%/${KV_min}/" \ |
328 |
-e "s/%KV_MIN_RELIABLE%/${KV_reliable}/" \ |
329 |
-i "${D}"/etc/init.d/udev-mount |
330 |
|
331 |
# config file for init-script and start-addon |
332 |
newconfd "${scriptdir}/udev.confd" udev \ |
333 |
|| die "config file not installed properly" |
334 |
|
335 |
insinto /etc/modprobe.d |
336 |
newins "${FILESDIR}"/blacklist-146 blacklist.conf |
337 |
newins "${FILESDIR}"/pnp-aliases pnp-aliases.conf |
338 |
|
339 |
# convert /lib/udev to real used dir |
340 |
sed_libexec_dir \ |
341 |
"${D}/$(get_libdir)"/rcscripts/addons/*.sh \ |
342 |
"${D}/${udev_libexec_dir}"/write_root_link_rule \ |
343 |
"${D}"/etc/conf.d/udev \ |
344 |
"${D}"/etc/init.d/udev* \ |
345 |
"${D}"/etc/modprobe.d/* |
346 |
|
347 |
# documentation |
348 |
dodoc ChangeLog README TODO || die "failed installing docs" |
349 |
|
350 |
# keep doc in just one directory, Bug #281137 |
351 |
rm -rf "${D}/usr/share/doc/${PN}" |
352 |
if use extras; then |
353 |
dodoc extras/keymap/README.keymap.txt || die "failed installing docs" |
354 |
fi |
355 |
} |
356 |
|
357 |
pkg_preinst() { |
358 |
# moving old files to support newer modprobe, 12 May 2009 |
359 |
local f dir=${ROOT}/etc/modprobe.d/ |
360 |
for f in pnp-aliases blacklist; do |
361 |
if [[ -f $dir/$f && ! -f $dir/$f.conf ]] |
362 |
then |
363 |
elog "Moving $dir/$f to $f.conf" |
364 |
mv -f "$dir/$f" "$dir/$f.conf" |
365 |
fi |
366 |
done |
367 |
|
368 |
if [[ -d ${ROOT}/lib/udev-state ]] |
369 |
then |
370 |
mv -f "${ROOT}"/lib/udev-state/* "${D}"/lib/udev/state/ |
371 |
rm -r "${ROOT}"/lib/udev-state |
372 |
fi |
373 |
|
374 |
if [[ -f ${ROOT}/etc/udev/udev.config && |
375 |
! -f ${ROOT}/etc/udev/udev.rules ]] |
376 |
then |
377 |
mv -f "${ROOT}"/etc/udev/udev.config "${ROOT}"/etc/udev/udev.rules |
378 |
fi |
379 |
|
380 |
# delete the old udev.hotplug symlink if it is present |
381 |
if [[ -h ${ROOT}/etc/hotplug.d/default/udev.hotplug ]] |
382 |
then |
383 |
rm -f "${ROOT}"/etc/hotplug.d/default/udev.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/05-wait_for_sysfs.hotplug ]] |
388 |
then |
389 |
rm -f "${ROOT}"/etc/hotplug.d/default/05-wait_for_sysfs.hotplug |
390 |
fi |
391 |
|
392 |
# delete the old wait_for_sysfs.hotplug symlink if it is present |
393 |
if [[ -h ${ROOT}/etc/hotplug.d/default/10-udev.hotplug ]] |
394 |
then |
395 |
rm -f "${ROOT}"/etc/hotplug.d/default/10-udev.hotplug |
396 |
fi |
397 |
|
398 |
has_version "=${CATEGORY}/${PN}-103-r3" |
399 |
previous_equal_to_103_r3=$? |
400 |
|
401 |
has_version "<${CATEGORY}/${PN}-104-r5" |
402 |
previous_less_than_104_r5=$? |
403 |
|
404 |
has_version "<${CATEGORY}/${PN}-106-r5" |
405 |
previous_less_than_106_r5=$? |
406 |
|
407 |
has_version "<${CATEGORY}/${PN}-113" |
408 |
previous_less_than_113=$? |
409 |
} |
410 |
|
411 |
# 19 Nov 2008 |
412 |
fix_old_persistent_net_rules() { |
413 |
local rules=${ROOT}/etc/udev/rules.d/70-persistent-net.rules |
414 |
[[ -f ${rules} ]] || return |
415 |
|
416 |
elog |
417 |
elog "Updating persistent-net rules file" |
418 |
|
419 |
# Change ATTRS to ATTR matches, Bug #246927 |
420 |
sed -i -e 's/ATTRS{/ATTR{/g' "${rules}" |
421 |
|
422 |
# Add KERNEL matches if missing, Bug #246849 |
423 |
sed -ri \ |
424 |
-e '/KERNEL/ ! { s/NAME="(eth|wlan|ath)([0-9]+)"/KERNEL=="\1*", NAME="\1\2"/}' \ |
425 |
"${rules}" |
426 |
} |
427 |
|
428 |
# See Bug #129204 for a discussion about restarting udevd |
429 |
restart_udevd() { |
430 |
if [[ ${NO_RESTART} = "1" ]]; then |
431 |
ewarn "Not restarting udevd, as your kernel is too old!" |
432 |
return |
433 |
fi |
434 |
|
435 |
# need to merge to our system |
436 |
[[ ${ROOT} = / ]] || return |
437 |
|
438 |
# check if root of init-process is identical to ours (not in chroot) |
439 |
[[ -r /proc/1/root && /proc/1/root/ -ef /proc/self/root/ ]] || return |
440 |
|
441 |
# abort if there is no udevd running |
442 |
[[ -n $(pidof udevd) ]] || return |
443 |
|
444 |
# abort if no /dev/.udev exists |
445 |
[[ -e /dev/.udev ]] || return |
446 |
|
447 |
elog |
448 |
elog "restarting udevd now." |
449 |
|
450 |
killall -15 udevd &>/dev/null |
451 |
sleep 1 |
452 |
killall -9 udevd &>/dev/null |
453 |
|
454 |
/sbin/udevd --daemon |
455 |
sleep 3 |
456 |
if [[ ! -n $(pidof udevd) ]]; then |
457 |
eerror "FATAL: udev died, please check your kernel is" |
458 |
eerror "new enough and configured correctly for ${P}." |
459 |
eerror |
460 |
eerror "Please have a look at this before rebooting." |
461 |
eerror "If in doubt, please downgrade udev back to your old version" |
462 |
ebeep |
463 |
fi |
464 |
} |
465 |
|
466 |
postinst_init_scripts() { |
467 |
# FIXME: we may need some code that detects if this is a system bootstrap |
468 |
# and auto-enables udev then |
469 |
# |
470 |
# FIXME: inconsistent handling of init-scripts here |
471 |
# * udev is added to sysinit in openrc-ebuild |
472 |
# * we add udev-postmount to default in here |
473 |
# |
474 |
|
475 |
# migration to >=openrc-0.4 |
476 |
if [[ -e "${ROOT}"/etc/runlevels/sysinit && ! -e "${ROOT}"/etc/runlevels/sysinit/udev ]] |
477 |
then |
478 |
ewarn |
479 |
ewarn "You need to add the udev init script to the runlevel sysinit," |
480 |
ewarn "else your system will not be able to boot" |
481 |
ewarn "after updating to >=openrc-0.4.0" |
482 |
ewarn "Run this to enable udev for >=openrc-0.4.0:" |
483 |
ewarn "\trc-update add udev sysinit" |
484 |
ewarn |
485 |
fi |
486 |
|
487 |
# add udev-postmount to default runlevel instead of that ugly injecting |
488 |
# like a hotplug event, 2009/10/15 |
489 |
|
490 |
# already enabled? |
491 |
[[ -e "${ROOT}"/etc/runlevels/default/udev-postmount ]] && return |
492 |
|
493 |
local enable_postmount=0 |
494 |
[[ -e "${ROOT}"/etc/runlevels/sysinit/udev ]] && enable_postmount=1 |
495 |
[[ "${ROOT}" = "/" && -d /dev/.udev/ ]] && enable_postmount=1 |
496 |
|
497 |
if [[ ${enable_postmount} = 1 ]] |
498 |
then |
499 |
local initd=udev-postmount |
500 |
|
501 |
if [[ -e ${ROOT}/etc/init.d/${initd} ]] && \ |
502 |
[[ ! -e ${ROOT}/etc/runlevels/default/${initd} ]] |
503 |
then |
504 |
ln -snf /etc/init.d/${initd} "${ROOT}"/etc/runlevels/default/${initd} |
505 |
elog "Auto-adding '${initd}' service to your default runlevel" |
506 |
fi |
507 |
else |
508 |
elog "You should add the udev-postmount service to default runlevel." |
509 |
elog "Run this to add it:" |
510 |
elog "\trc-update add udev-postmount default" |
511 |
fi |
512 |
} |
513 |
|
514 |
pkg_postinst() { |
515 |
fix_old_persistent_net_rules |
516 |
|
517 |
restart_udevd |
518 |
|
519 |
postinst_init_scripts |
520 |
|
521 |
# people want reminders, I'll give them reminders. Odds are they will |
522 |
# just ignore them anyway... |
523 |
|
524 |
# delete 40-scsi-hotplug.rules, it is integrated in 50-udev.rules, 19 Jan 2007 |
525 |
if [[ $previous_equal_to_103_r3 = 0 ]] && |
526 |
[[ -e ${ROOT}/etc/udev/rules.d/40-scsi-hotplug.rules ]] |
527 |
then |
528 |
ewarn "Deleting stray 40-scsi-hotplug.rules" |
529 |
ewarn "installed by sys-fs/udev-103-r3" |
530 |
rm -f "${ROOT}"/etc/udev/rules.d/40-scsi-hotplug.rules |
531 |
fi |
532 |
|
533 |
# Removing some device-nodes we thought we need some time ago, 25 Jan 2007 |
534 |
if [[ -d ${ROOT}/lib/udev/devices ]] |
535 |
then |
536 |
rm -f "${ROOT}"/lib/udev/devices/{null,zero,console,urandom} |
537 |
fi |
538 |
|
539 |
# Removing some old file, 29 Jan 2007 |
540 |
if [[ $previous_less_than_104_r5 = 0 ]] |
541 |
then |
542 |
rm -f "${ROOT}"/etc/dev.d/net/hotplug.dev |
543 |
rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/net 2>/dev/null |
544 |
fi |
545 |
|
546 |
# 19 Mar 2007 |
547 |
if [[ $previous_less_than_106_r5 = 0 ]] && |
548 |
[[ -e ${ROOT}/etc/udev/rules.d/95-net.rules ]] |
549 |
then |
550 |
rm -f "${ROOT}"/etc/udev/rules.d/95-net.rules |
551 |
fi |
552 |
|
553 |
# Try to remove /etc/dev.d as that is obsolete, 23 Apr 2007 |
554 |
if [[ -d ${ROOT}/etc/dev.d ]] |
555 |
then |
556 |
rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/default "${ROOT}"/etc/dev.d 2>/dev/null |
557 |
if [[ -d ${ROOT}/etc/dev.d ]] |
558 |
then |
559 |
ewarn "You still have the directory /etc/dev.d on your system." |
560 |
ewarn "This is no longer used by udev and can be removed." |
561 |
fi |
562 |
fi |
563 |
|
564 |
# 64-device-mapper.rules now gets installed by sys-fs/device-mapper |
565 |
# remove it if user don't has sys-fs/device-mapper installed, 27 Jun 2007 |
566 |
if [[ $previous_less_than_113 = 0 ]] && |
567 |
[[ -f ${ROOT}/etc/udev/rules.d/64-device-mapper.rules ]] && |
568 |
! has_version sys-fs/device-mapper |
569 |
then |
570 |
rm -f "${ROOT}"/etc/udev/rules.d/64-device-mapper.rules |
571 |
einfo "Removed unneeded file 64-device-mapper.rules" |
572 |
fi |
573 |
|
574 |
# requested in bug #275974, added 2009/09/05 |
575 |
ewarn |
576 |
ewarn "If after the udev update removable devices or CD/DVD drives" |
577 |
ewarn "stop working, try re-emerging HAL before filling a bug report" |
578 |
|
579 |
# requested in Bug #225033: |
580 |
elog |
581 |
elog "persistent-net does assigning fixed names to network devices." |
582 |
elog "If you have problems with the persistent-net rules," |
583 |
elog "just delete the rules file" |
584 |
elog "\trm ${ROOT}etc/udev/rules.d/70-persistent-net.rules" |
585 |
elog "and then reboot." |
586 |
elog |
587 |
elog "This may however number your devices in a different way than they are now." |
588 |
|
589 |
ewarn |
590 |
ewarn "If you build an initramfs including udev, then please" |
591 |
ewarn "make sure that the /sbin/udevadm binary gets included," |
592 |
ewarn "and your scripts changed to use it,as it replaces the" |
593 |
ewarn "old helper apps udevinfo, udevtrigger, ..." |
594 |
|
595 |
ewarn |
596 |
ewarn "mount options for directory /dev are no longer" |
597 |
ewarn "set in /etc/udev/udev.conf, but in /etc/fstab" |
598 |
ewarn "as for other directories." |
599 |
|
600 |
ewarn |
601 |
ewarn "If you use /dev/md/*, /dev/loop/* or /dev/rd/*," |
602 |
ewarn "then please migrate over to using the device names" |
603 |
ewarn "/dev/md*, /dev/loop* and /dev/ram*." |
604 |
ewarn "The devfs-compat rules have been removed." |
605 |
ewarn "For reference see Bug #269359." |
606 |
|
607 |
ewarn |
608 |
ewarn "Rules for /dev/hd* devices have been removed" |
609 |
ewarn "Please migrate to libata." |
610 |
|
611 |
elog |
612 |
elog "For more information on udev on Gentoo, writing udev rules, and" |
613 |
elog " fixing known issues visit:" |
614 |
elog " http://www.gentoo.org/doc/en/udev-guide.xml" |
615 |
} |