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