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