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