Gentoo Archives: gentoo-commits

From: "Samuli Suominen (ssuominen)" <ssuominen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-fs/udev: udev-212-r1.ebuild udev-9999.ebuild ChangeLog
Date: Fri, 28 Mar 2014 04:03:49
Message-Id: 20140328040346.CC9B120051@flycatcher.gentoo.org
1 ssuominen 14/03/28 04:03:46
2
3 Modified: udev-9999.ebuild ChangeLog
4 Added: udev-212-r1.ebuild
5 Log:
6 Support building libgudev-1.0.so with ABI_X86 for the new virtual/libgudev.
7
8 (Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key 4868F14D)
9
10 Revision Changes Path
11 1.290 sys-fs/udev/udev-9999.ebuild
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/udev/udev-9999.ebuild?rev=1.290&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/udev/udev-9999.ebuild?rev=1.290&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/udev/udev-9999.ebuild?r1=1.289&r2=1.290
16
17 Index: udev-9999.ebuild
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-9999.ebuild,v
20 retrieving revision 1.289
21 retrieving revision 1.290
22 diff -u -r1.289 -r1.290
23 --- udev-9999.ebuild 26 Mar 2014 06:13:06 -0000 1.289
24 +++ udev-9999.ebuild 28 Mar 2014 04:03:46 -0000 1.290
25 @@ -1,6 +1,6 @@
26 # Copyright 1999-2014 Gentoo Foundation
27 # Distributed under the terms of the GNU General Public License v2
28 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-9999.ebuild,v 1.289 2014/03/26 06:13:06 ssuominen Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-9999.ebuild,v 1.290 2014/03/28 04:03:46 ssuominen Exp $
30
31 EAPI=5
32
33 @@ -31,7 +31,7 @@
34
35 COMMON_DEPEND=">=sys-apps/util-linux-2.20
36 acl? ( sys-apps/acl )
37 - gudev? ( >=dev-libs/glib-2.22 )
38 + gudev? ( >=dev-libs/glib-2.22[${MULTILIB_USEDEP}] )
39 introspection? ( >=dev-libs/gobject-introspection-1.31.1 )
40 kmod? ( >=sys-apps/kmod-16 )
41 selinux? ( >=sys-libs/libselinux-2.1.9 )
42 @@ -198,6 +198,7 @@
43 --disable-logind
44 --disable-polkit
45 --disable-myhostname
46 + $(use_enable gudev)
47 --enable-split-usr
48 --with-html-dir=/usr/share/doc/${PF}/html
49 --without-python
50 @@ -218,7 +219,6 @@
51 $(use_enable acl)
52 $(use_enable kmod)
53 $(use_enable selinux)
54 - $(use_enable gudev)
55 --with-rootlibdir=/$(get_libdir)
56 )
57 else
58 @@ -229,7 +229,6 @@
59 --disable-acl
60 --disable-kmod
61 --disable-selinux
62 - --disable-gudev
63 --disable-manpages
64 --with-rootlibdir=/usr/$(get_libdir)
65 )
66 @@ -285,6 +284,7 @@
67 fi
68 else
69 local lib_targets=( libudev.la )
70 + use gudev && lib_targets+=( libgudev-1.0.la )
71 emake "${lib_targets[@]}"
72 fi
73 }
74 @@ -354,6 +354,11 @@
75 install-pkgconfiglibDATA
76 )
77
78 + if use gudev; then
79 + lib_LTLIBRARIES+=" libgudev-1.0.la"
80 + pkgconfiglib_DATA+=" src/gudev/gudev-1.0.pc"
81 + fi
82 +
83 targets+=(
84 lib_LTLIBRARIES="${lib_LTLIBRARIES}"
85 pkgconfiglib_DATA="${pkgconfiglib_DATA}"
86
87
88
89 1.1016 sys-fs/udev/ChangeLog
90
91 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/udev/ChangeLog?rev=1.1016&view=markup
92 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/udev/ChangeLog?rev=1.1016&content-type=text/plain
93 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/udev/ChangeLog?r1=1.1015&r2=1.1016
94
95 Index: ChangeLog
96 ===================================================================
97 RCS file: /var/cvsroot/gentoo-x86/sys-fs/udev/ChangeLog,v
98 retrieving revision 1.1015
99 retrieving revision 1.1016
100 diff -u -r1.1015 -r1.1016
101 --- ChangeLog 26 Mar 2014 06:14:10 -0000 1.1015
102 +++ ChangeLog 28 Mar 2014 04:03:46 -0000 1.1016
103 @@ -1,6 +1,12 @@
104 # ChangeLog for sys-fs/udev
105 # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
106 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/ChangeLog,v 1.1015 2014/03/26 06:14:10 ssuominen Exp $
107 +# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/ChangeLog,v 1.1016 2014/03/28 04:03:46 ssuominen Exp $
108 +
109 +*udev-212-r1 (28 Mar 2014)
110 +
111 + 28 Mar 2014; Samuli Suominen <ssuominen@g.o> +udev-212-r1.ebuild,
112 + udev-9999.ebuild:
113 + Support building libgudev-1.0.so with ABI_X86 for the new virtual/libgudev.
114
115 26 Mar 2014; Samuli Suominen <ssuominen@g.o> -udev-211.ebuild:
116 old
117
118
119
120 1.1 sys-fs/udev/udev-212-r1.ebuild
121
122 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/udev/udev-212-r1.ebuild?rev=1.1&view=markup
123 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/udev/udev-212-r1.ebuild?rev=1.1&content-type=text/plain
124
125 Index: udev-212-r1.ebuild
126 ===================================================================
127 # Copyright 1999-2014 Gentoo Foundation
128 # Distributed under the terms of the GNU General Public License v2
129 # $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-212-r1.ebuild,v 1.1 2014/03/28 04:03:46 ssuominen Exp $
130
131 EAPI=5
132
133 inherit autotools bash-completion-r1 eutils linux-info multilib toolchain-funcs versionator multilib-minimal
134
135 if [[ ${PV} = 9999* ]]; then
136 EGIT_REPO_URI="git://anongit.freedesktop.org/systemd/systemd"
137 inherit git-2
138 else
139 patchset=
140 SRC_URI="http://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz"
141 if [[ -n "${patchset}" ]]; then
142 SRC_URI="${SRC_URI}
143 http://dev.gentoo.org/~ssuominen/${P}-patches-${patchset}.tar.xz
144 http://dev.gentoo.org/~williamh/dist/${P}-patches-${patchset}.tar.xz"
145 fi
146 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
147 fi
148
149 DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)"
150 HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
151
152 LICENSE="LGPL-2.1 MIT GPL-2"
153 SLOT="0"
154 IUSE="acl doc +firmware-loader gudev introspection +kmod +openrc selinux static-libs"
155
156 RESTRICT="test"
157
158 COMMON_DEPEND=">=sys-apps/util-linux-2.20
159 acl? ( sys-apps/acl )
160 gudev? ( >=dev-libs/glib-2.22[${MULTILIB_USEDEP}] )
161 introspection? ( >=dev-libs/gobject-introspection-1.31.1 )
162 kmod? ( >=sys-apps/kmod-16 )
163 selinux? ( >=sys-libs/libselinux-2.1.9 )
164 !<sys-libs/glibc-2.11
165 !sys-apps/gentoo-systemd-integration
166 !sys-apps/systemd
167 abi_x86_32? (
168 !<=app-emulation/emul-linux-x86-baselibs-20130224-r7
169 !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
170 )"
171 DEPEND="${COMMON_DEPEND}
172 dev-util/gperf
173 sys-libs/libcap
174 virtual/os-headers
175 virtual/pkgconfig
176 !<sys-devel/make-3.82-r4
177 !<sys-kernel/linux-headers-2.6.32
178 doc? ( >=dev-util/gtk-doc-1.18 )"
179 # Try with `emerge -C docbook-xml-dtd` to see the build failure without DTDs
180 if [[ ${PV} = 9999* ]]; then
181 DEPEND="${DEPEND}
182 app-text/docbook-xml-dtd:4.2
183 app-text/docbook-xml-dtd:4.5
184 app-text/docbook-xsl-stylesheets
185 dev-libs/libxslt
186 >=dev-util/intltool-0.50"
187 fi
188 RDEPEND="${COMMON_DEPEND}
189 !<sys-fs/lvm2-2.02.103
190 !<sec-policy/selinux-base-2.20120725-r10"
191 PDEPEND=">=virtual/udev-208
192 >=sys-apps/hwids-20140304[udev]
193 openrc? ( >=sys-fs/udev-init-scripts-26 )"
194
195 S=${WORKDIR}/systemd-${PV}
196
197 # The multilib-build.eclass doesn't handle situation where the installed headers
198 # are different in ABIs. In this case, we install libgudev headers in native
199 # ABI but not for non-native ABI.
200 multilib_check_headers() { :; }
201
202 check_default_rules() {
203 # Make sure there are no sudden changes to upstream rules file
204 # (more for my own needs than anything else ...)
205 local udev_rules_md5=6bd3d421b9b6acd0e2d87ad720d6a389
206 MD5=$(md5sum < "${S}"/rules/50-udev-default.rules)
207 MD5=${MD5/ -/}
208 if [[ ${MD5} != ${udev_rules_md5} ]]; then
209 eerror "50-udev-default.rules has been updated, please validate!"
210 eerror "md5sum: ${MD5}"
211 die "50-udev-default.rules has been updated, please validate!"
212 fi
213 }
214
215 pkg_setup() {
216 CONFIG_CHECK="~BLK_DEV_BSG ~DEVTMPFS ~!IDE ~INOTIFY_USER ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2 ~SIGNALFD ~EPOLL ~FHANDLE ~NET"
217 linux-info_pkg_setup
218
219 # Based on README from tarball:
220 local MINKV=3.0
221 # These arch's have the mandatory accept4() function support in Linux 2.6.32*, see:
222 # $ grep -r define.*accept4 linux-2.6.32*/*
223 if use amd64 || use ia64 || use mips || use sparc || use x86; then
224 MINKV=2.6.32
225 fi
226
227 if kernel_is -lt ${MINKV//./ }; then
228 eerror "Your running kernel is too old to run this version of ${P}"
229 eerror "You need to upgrade kernel at least to ${MINKV}"
230 fi
231 }
232
233 src_prepare() {
234 if ! [[ ${PV} = 9999* ]]; then
235 # secure_getenv() disable for non-glibc systems wrt bug #443030
236 if ! [[ $(grep -r secure_getenv * | wc -l) -eq 22 ]]; then
237 eerror "The line count for secure_getenv() failed, see bug #443030"
238 die
239 fi
240 fi
241
242 # backport some patches
243 if [[ -n "${patchset}" ]]; then
244 EPATCH_SUFFIX=patch EPATCH_FORCE=yes epatch
245 fi
246
247 cat <<-EOF > "${T}"/40-gentoo.rules
248 # Gentoo specific usb group
249 SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="usb"
250 # Keep this for Linux 2.6.32 kernels with incomplete devtmpfs support because
251 # accept4() function is supported for some arch's wrt #457868
252 SUBSYSTEM=="mem", KERNEL=="null|zero|full|random|urandom", MODE="0666"
253 EOF
254
255 # Remove requirements for gettext and intltool wrt bug #443028
256 if ! has_version dev-util/intltool && ! [[ ${PV} = 9999* ]]; then
257 sed -i \
258 -e '/INTLTOOL_APPLIED_VERSION=/s:=.*:=0.40.0:' \
259 -e '/XML::Parser perl module is required for intltool/s|^|:|' \
260 configure || die
261 eval export INTLTOOL_{EXTRACT,MERGE,UPDATE}=/bin/true
262 eval export {MSG{FMT,MERGE},XGETTEXT}=/bin/true
263 fi
264
265 # compile with older versions of gcc #451110
266 version_is_at_least 4.6 $(gcc-version) || \
267 sed -i 's:static_assert:alsdjflkasjdfa:' src/shared/macro.h
268
269 # change rules back to group uucp instead of dialout for now wrt #454556
270 sed -i -e 's/GROUP="dialout"/GROUP="uucp"/' rules/*.rules || die
271
272 # apply user patches
273 epatch_user
274
275 if [[ ! -e configure ]]; then
276 if use doc; then
277 gtkdocize --docdir docs || die "gtkdocize failed"
278 else
279 echo 'EXTRA_DIST =' > docs/gtk-doc.make
280 fi
281 eautoreconf
282 else
283 check_default_rules
284 elibtoolize
285 fi
286
287 # Restore possibility of running --enable-static wrt #472608
288 sed -i \
289 -e '/--enable-static is not supported by systemd/s:as_fn_error:echo:' \
290 configure || die
291
292 if ! use elibc_glibc; then #443030
293 echo '#define secure_getenv(x) NULL' >> config.h.in
294 sed -i -e '/error.*secure_getenv/s:.*:#define secure_getenv(x) NULL:' src/shared/missing.h || die
295 fi
296 }
297
298 multilib_src_configure() {
299 tc-export CC #463846
300 export cc_cv_CFLAGS__flto=no #502950
301
302 # Keep sorted by ./configure --help and only pass --disable flags
303 # when *required* to avoid external deps or unnecessary compile
304 local econf_args
305 econf_args=(
306 ac_cv_search_cap_init=
307 --libdir=/usr/$(get_libdir)
308 --docdir=/usr/share/doc/${PF}
309 --disable-nls
310 --disable-python-devel
311 --disable-dbus
312 --disable-seccomp
313 --disable-xz
314 --disable-pam
315 --disable-xattr
316 --disable-gcrypt
317 --disable-audit
318 --disable-libcryptsetup
319 --disable-qrencode
320 --disable-microhttpd
321 --disable-gnutls
322 --disable-readahead
323 --disable-quotacheck
324 --disable-logind
325 --disable-polkit
326 --disable-myhostname
327 $(use_enable gudev)
328 --enable-split-usr
329 --with-html-dir=/usr/share/doc/${PF}/html
330 --without-python
331 --with-bashcompletiondir="$(get_bashcompdir)"
332 --with-rootprefix=
333 )
334 # Use pregenerated copies when possible wrt #480924
335 if ! [[ ${PV} = 9999* ]]; then
336 econf_args+=(
337 --disable-manpages
338 )
339 fi
340 if multilib_build_binaries; then
341 econf_args+=(
342 $(use_enable static-libs static)
343 $(use_enable doc gtk-doc)
344 $(use_enable introspection)
345 $(use_enable acl)
346 $(use_enable kmod)
347 $(use_enable selinux)
348 --with-rootlibdir=/$(get_libdir)
349 )
350 else
351 econf_args+=(
352 --disable-static
353 --disable-gtk-doc
354 --disable-introspection
355 --disable-acl
356 --disable-kmod
357 --disable-selinux
358 --disable-manpages
359 --with-rootlibdir=/usr/$(get_libdir)
360 )
361 fi
362 use firmware-loader && econf_args+=( --with-firmware-path="/lib/firmware/updates:/lib/firmware" )
363
364 ECONF_SOURCE=${S} econf "${econf_args[@]}"
365 }
366
367 multilib_src_compile() {
368 echo 'BUILT_SOURCES: $(BUILT_SOURCES)' > "${T}"/Makefile.extra
369 emake -f Makefile -f "${T}"/Makefile.extra BUILT_SOURCES
370
371 # Most of the parallel build problems were solved by >=sys-devel/make-3.82-r4,
372 # but not everything -- separate building of the binaries as a workaround,
373 # which will force internal libraries required for the helpers to be built
374 # early enough, like eg. libsystemd-shared.la
375 if multilib_build_binaries; then
376 local lib_targets=( libudev.la )
377 use gudev && lib_targets+=( libgudev-1.0.la )
378 emake "${lib_targets[@]}"
379
380 local exec_targets=(
381 systemd-udevd
382 udevadm
383 )
384 emake "${exec_targets[@]}"
385
386 local helper_targets=(
387 ata_id
388 cdrom_id
389 collect
390 scsi_id
391 v4l_id
392 accelerometer
393 mtd_probe
394 )
395 emake "${helper_targets[@]}"
396
397 if [[ ${PV} = 9999* ]]; then
398 local man_targets=(
399 man/systemd.link.5
400 man/udev.7
401 man/udevadm.8
402 man/systemd-udevd.service.8
403 )
404 emake "${man_targets[@]}"
405 fi
406
407 if use doc; then
408 emake -C docs/libudev
409 use gudev && emake -C docs/gudev
410 fi
411 else
412 local lib_targets=( libudev.la )
413 use gudev && lib_targets+=( libgudev-1.0.la )
414 emake "${lib_targets[@]}"
415 fi
416 }
417
418 multilib_src_install() {
419 if multilib_build_binaries; then
420 local lib_LTLIBRARIES="libudev.la" \
421 pkgconfiglib_DATA="src/libudev/libudev.pc"
422
423 local targets=(
424 install-libLTLIBRARIES
425 install-includeHEADERS
426 install-libgudev_includeHEADERS
427 install-rootbinPROGRAMS
428 install-rootlibexecPROGRAMS
429 install-udevlibexecPROGRAMS
430 install-dist_udevconfDATA
431 install-dist_udevrulesDATA
432 install-girDATA
433 install-pkgconfiglibDATA
434 install-sharepkgconfigDATA
435 install-typelibsDATA
436 install-dist_docDATA
437 libudev-install-hook
438 install-directories-hook
439 install-dist_bashcompletionDATA
440 install-dist_networkDATA
441 )
442
443 if use gudev; then
444 lib_LTLIBRARIES+=" libgudev-1.0.la"
445 pkgconfiglib_DATA+=" src/gudev/gudev-1.0.pc"
446 fi
447
448 # add final values of variables:
449 targets+=(
450 rootlibexec_PROGRAMS=systemd-udevd
451 rootbin_PROGRAMS=udevadm
452 lib_LTLIBRARIES="${lib_LTLIBRARIES}"
453 pkgconfiglib_DATA="${pkgconfiglib_DATA}"
454 INSTALL_DIRS='$(sysconfdir)/udev/rules.d \
455 $(sysconfdir)/udev/hwdb.d \
456 $(sysconfdir)/systemd/network'
457 dist_bashcompletion_DATA="shell-completion/bash/udevadm"
458 dist_network_DATA="network/99-default.link"
459 )
460 emake -j1 DESTDIR="${D}" "${targets[@]}"
461
462 if use doc; then
463 emake -C docs/libudev DESTDIR="${D}" install
464 use gudev && emake -C docs/gudev DESTDIR="${D}" install
465 fi
466
467 if [[ ${PV} = 9999* ]]; then
468 doman man/{systemd.link.5,udev.7,udevadm.8,systemd-udevd.service.8}
469 else
470 doman "${S}"/man/{systemd.link.5,udev.7,udevadm.8,systemd-udevd.service.8}
471 fi
472 else
473 local lib_LTLIBRARIES="libudev.la" \
474 pkgconfiglib_DATA="src/libudev/libudev.pc" \
475 include_HEADERS="src/libudev/libudev.h"
476
477 local targets=(
478 install-libLTLIBRARIES
479 install-includeHEADERS
480 install-pkgconfiglibDATA
481 )
482
483 if use gudev; then
484 lib_LTLIBRARIES+=" libgudev-1.0.la"
485 pkgconfiglib_DATA+=" src/gudev/gudev-1.0.pc"
486 fi
487
488 targets+=(
489 lib_LTLIBRARIES="${lib_LTLIBRARIES}"
490 pkgconfiglib_DATA="${pkgconfiglib_DATA}"
491 include_HEADERS="${include_HEADERS}"
492 )
493 emake -j1 DESTDIR="${D}" "${targets[@]}"
494 fi
495 }
496
497 multilib_src_install_all() {
498 dodoc TODO
499
500 prune_libtool_files --all
501 rm -f \
502 "${D}"/lib/udev/rules.d/99-systemd.rules \
503 "${D}"/usr/share/doc/${PF}/{LICENSE.*,GVARIANT-SERIALIZATION,DIFFERENCES,PORTING-DBUS1,sd-shutdown.h}
504
505 # see src_prepare() for content of 40-gentoo.rules
506 insinto /lib/udev/rules.d
507 doins "${T}"/40-gentoo.rules
508
509 # maintainer note: by not letting the upstream build-sys create the .so
510 # link, you also avoid a parallel make problem
511 mv "${D}"/usr/share/man/man8/systemd-udevd{.service,}.8
512 }
513
514 pkg_preinst() {
515 local htmldir
516 for htmldir in gudev libudev; do
517 if [[ -d ${ROOT%/}/usr/share/gtk-doc/html/${htmldir} ]]; then
518 rm -rf "${ROOT%/}"/usr/share/gtk-doc/html/${htmldir}
519 fi
520 if [[ -d ${D}/usr/share/doc/${PF}/html/${htmldir} ]]; then
521 dosym ../../doc/${PF}/html/${htmldir} \
522 /usr/share/gtk-doc/html/${htmldir}
523 fi
524 done
525 }
526
527 pkg_postinst() {
528 mkdir -p "${ROOT%/}"/run
529
530 # "losetup -f" is confused if there is an empty /dev/loop/, Bug #338766
531 # So try to remove it here (will only work if empty).
532 rmdir "${ROOT%/}"/dev/loop 2>/dev/null
533 if [[ -d ${ROOT%/}/dev/loop ]]; then
534 ewarn "Please make sure your remove /dev/loop,"
535 ewarn "else losetup may be confused when looking for unused devices."
536 fi
537
538 local fstab="${ROOT%/}"/etc/fstab dev path fstype rest
539 while read -r dev path fstype rest; do
540 if [[ ${path} == /dev && ${fstype} != devtmpfs ]]; then
541 ewarn "You need to edit your /dev line in ${fstab} to have devtmpfs"
542 ewarn "filesystem. Otherwise udev won't be able to boot."
543 ewarn "See, http://bugs.gentoo.org/453186"
544 fi
545 done < "${fstab}"
546
547 if [[ -d ${ROOT%/}/usr/lib/udev ]]; then
548 ewarn
549 ewarn "Please re-emerge all packages on your system which install"
550 ewarn "rules and helpers in /usr/lib/udev. They should now be in"
551 ewarn "/lib/udev."
552 ewarn
553 ewarn "One way to do this is to run the following command:"
554 ewarn "emerge -av1 \$(qfile -q -S -C /usr/lib/udev)"
555 ewarn "Note that qfile can be found in app-portage/portage-utils"
556 fi
557
558 local old_cd_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-cd.rules
559 local old_net_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-net.rules
560 for old_rules in "${old_cd_rules}" "${old_net_rules}"; do
561 if [[ -f ${old_rules} ]]; then
562 ewarn
563 ewarn "File ${old_rules} is from old udev installation but if you still use it,"
564 ewarn "rename it to something else starting with 70- to silence this deprecation"
565 ewarn "warning."
566 fi
567 done
568
569 elog
570 elog "Starting from version >= 197 the new predictable network interface names are"
571 elog "used by default, see:"
572 elog "http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames"
573 elog "http://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builtin-net_id.c"
574 elog
575 elog "Example command to get the information for the new interface name before booting"
576 elog "(replace <ifname> with, for example, eth0):"
577 elog "# udevadm test-builtin net_id /sys/class/net/<ifname> 2> /dev/null"
578 elog
579 elog "You can use either kernel parameter \"net.ifnames=0\", create empty"
580 elog "file /etc/systemd/network/99-default.link, or symlink it to /dev/null"
581 elog "to disable the feature."
582
583 if has_version 'sys-apps/biosdevname'; then
584 ewarn
585 ewarn "You can replace the functionality of sys-apps/biosdevname which has been"
586 ewarn "detected to be installed with the new predictable network interface names."
587 fi
588
589 ewarn
590 ewarn "You need to restart udev as soon as possible to make the upgrade go"
591 ewarn "into effect."
592 ewarn "The method you use to do this depends on your init system."
593 if has_version 'sys-apps/openrc'; then
594 ewarn "For sys-apps/openrc users it is:"
595 ewarn "# /etc/init.d/udev --nodeps restart"
596 fi
597
598 elog
599 elog "For more information on udev on Gentoo, upgrading, writing udev rules, and"
600 elog "fixing known issues visit:"
601 elog "http://wiki.gentoo.org/wiki/Udev"
602 elog "http://wiki.gentoo.org/wiki/Udev/upgrade"
603
604 # If user has disabled 80-net-name-slot.rules using a empty file or a symlink to /dev/null,
605 # do the same for 80-net-setup-link.rules to keep the old behavior
606 local net_move=no
607 local net_name_slot_sym=no
608 local net_rules_path="${ROOT%/}"/etc/udev/rules.d
609 local net_name_slot="${net_rules_path}"/80-net-name-slot.rules
610 local net_setup_link="${net_rules_path}"/80-net-setup-link.rules
611 if [[ -e ${net_setup_link} ]]; then
612 net_move=no
613 else
614 [[ -f ${net_name_slot} && $(sed -e "/^#/d" -e "/^\W*$/d" ${net_name_slot} | wc -l) == 0 ]] && net_move=yes
615 if [[ -L ${net_name_slot} && $(readlink ${net_name_slot}) == /dev/null ]]; then
616 net_move=yes
617 net_name_slot_sym=yes
618 fi
619 fi
620 if [[ ${net_move} == yes ]]; then
621 ebegin "Copying ${net_name_slot} to ${net_setup_link}"
622
623 if [[ ${net_name_slot_sym} == yes ]]; then
624 ln -nfs /dev/null "${net_setup_link}"
625 else
626 cp "${net_name_slot}" "${net_setup_link}"
627 fi
628 eend $?
629 fi
630
631 # Update hwdb database in case the format is changed by udev version.
632 if has_version 'sys-apps/hwids[udev]'; then
633 udevadm hwdb --update --root="${ROOT%/}"
634 # Only reload when we are not upgrading to avoid potential race w/ incompatible hwdb.bin and the running udevd
635 if [[ -z ${REPLACING_VERSIONS} ]]; then
636 # http://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
637 if [[ ${ROOT} != "" ]] && [[ ${ROOT} != "/" ]]; then
638 return 0
639 fi
640 udevadm control --reload
641 fi
642 fi
643 }