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