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