Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 461940 | Differences between
and this patch

Collapse All | Expand All

(-)udev-200.ebuild (-63 / +37 lines)
Lines 11-23 Link Here
11
	KV_min=2.6.32
11
	KV_min=2.6.32
12
fi
12
fi
13
13
14
inherit autotools eutils linux-info multilib systemd toolchain-funcs versionator flag-o-matic
14
inherit autotools eutils linux-info multilib toolchain-funcs versionator flag-o-matic
15
15
16
if [[ ${PV} = 9999* ]]; then
16
if [[ ${PV} = 9999* ]]; then
17
	EGIT_REPO_URI="git://anongit.freedesktop.org/systemd/systemd"
17
	EGIT_REPO_URI="git://anongit.freedesktop.org/systemd/systemd"
18
	inherit git-2
18
	inherit git-2
19
else
19
else
20
	patchset= #3
20
	patchset= #1
21
	SRC_URI="http://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz"
21
	SRC_URI="http://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz"
22
	if [[ -n "${patchset}" ]]; then
22
	if [[ -n "${patchset}" ]]; then
23
				SRC_URI="${SRC_URI}
23
				SRC_URI="${SRC_URI}
Lines 32-38 Link Here
32
32
33
LICENSE="LGPL-2.1 MIT GPL-2"
33
LICENSE="LGPL-2.1 MIT GPL-2"
34
SLOT="0"
34
SLOT="0"
35
IUSE="acl doc firmware-loader gudev hwdb introspection keymap +kmod +openrc selinux static-libs logind"
35
IUSE="acl doc +firmware-loader gudev hwdb introspection keymap +kmod +openrc selinux static-libs logind"
36
36
37
RESTRICT="test"
37
RESTRICT="test"
38
38
Lines 40-51 Link Here
40
	acl? ( sys-apps/acl )
40
	acl? ( sys-apps/acl )
41
	gudev? ( >=dev-libs/glib-2 )
41
	gudev? ( >=dev-libs/glib-2 )
42
	introspection? ( >=dev-libs/gobject-introspection-1.31.1 )
42
	introspection? ( >=dev-libs/gobject-introspection-1.31.1 )
43
	kmod? ( >=sys-apps/kmod-12 )
43
	kmod? ( >=sys-apps/kmod-13 )
44
	selinux? ( >=sys-libs/libselinux-2.1.9 )
44
	selinux? ( >=sys-libs/libselinux-2.1.9 )
45
	!<sys-libs/glibc-2.11
45
	!<sys-libs/glibc-2.11
46
	!<sys-apps/systemd-${PV}"
46
	!sys-apps/systemd"
47
47
48
DEPEND="${COMMON_DEPEND}
48
DEPEND="${COMMON_DEPEND}
49
	app-text/docbook-xsl-stylesheets
50
	dev-libs/libxslt
51
	>=sys-devel/make-3.82-r4
49
	virtual/os-headers
52
	virtual/os-headers
50
	virtual/pkgconfig
53
	virtual/pkgconfig
51
	!<sys-kernel/linux-headers-${KV_min}
54
	!<sys-kernel/linux-headers-${KV_min}
Lines 54-61 Link Here
54
57
55
if [[ ${PV} = 9999* ]]; then
58
if [[ ${PV} = 9999* ]]; then
56
	DEPEND="${DEPEND}
59
	DEPEND="${DEPEND}
57
		app-text/docbook-xsl-stylesheets
58
		dev-libs/libxslt
59
		dev-util/gperf
60
		dev-util/gperf
60
		>=dev-util/intltool-0.50"
61
		>=dev-util/intltool-0.50"
61
fi
62
fi
Lines 119-131 Link Here
119
src_prepare() {
120
src_prepare() {
120
	if ! [[ ${PV} = 9999* ]]; then
121
	if ! [[ ${PV} = 9999* ]]; then
121
		# secure_getenv() disable for non-glibc systems wrt bug #443030
122
		# secure_getenv() disable for non-glibc systems wrt bug #443030
122
		if ! [[ $(grep -r secure_getenv * | wc -l) -eq 16 ]]; then
123
		if ! [[ $(grep -r secure_getenv * | wc -l) -eq 19 ]]; then
123
			eerror "The line count for secure_getenv() failed, see bug #443030"
124
			eerror "The line count for secure_getenv() failed, see bug #443030"
124
			die
125
			die
125
		fi
126
		fi
126
127
127
		# gperf disable if keymaps are not requested wrt bug #452760
128
		# gperf disable if keymaps are not requested wrt bug #452760
128
	if ! [[ $(grep -i gperf Makefile.am | wc -l) -eq 27 ]]; then
129
		if ! [[ $(grep -i gperf Makefile.am | wc -l) -eq 27 ]]; then
129
			eerror "The line count for gperf references failed, see bug 452760"
130
			eerror "The line count for gperf references failed, see bug 452760"
130
			die
131
			die
131
		fi
132
		fi
Lines 138-144 Link Here
138
139
139
	# These are missing from upstream 50-udev-default.rules
140
	# These are missing from upstream 50-udev-default.rules
140
	cat <<-EOF > "${T}"/40-gentoo.rules
141
	cat <<-EOF > "${T}"/40-gentoo.rules
141
	# see src_prepare() for content of these files
142
	# Gentoo specific usb group
142
	SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="usb"
143
	SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="usb"
143
	# Keep this for Linux 2.6.32 kernels with accept4() support like .60 wrt #457868
144
	# Keep this for Linux 2.6.32 kernels with accept4() support like .60 wrt #457868
144
	SUBSYSTEM=="mem", KERNEL=="null|zero|full|random|urandom", MODE="0666"
145
	SUBSYSTEM=="mem", KERNEL=="null|zero|full|random|urandom", MODE="0666"
Lines 169-186 Link Here
169
	#epatch "${FILESDIR}/${P}"-run-to-var.patch || die
170
	#epatch "${FILESDIR}/${P}"-run-to-var.patch || die
170
171
171
	epatch "${FILESDIR}/${PN}"-198-logind.patch || die
172
	epatch "${FILESDIR}/${PN}"-198-logind.patch || die
172
	epatch "${FILESDIR}/${PN}"-198-nosystemd-daemon-makefile.patch || die
173
	# :g/^Ilibsystemd-daemon.la \\/d
174
	# :%s/ \\\n^Ilibsystemd-daemon.la//
175
	sed -i '/\slibsystemd-daemon.la \\/d' Makefile.am
176
	sed -e :a -i -e '/\\$/N; s/\\\n\slibsystemd-daemon.la//; ta' Makefile.am
177
	#epatch "${FILESDIR}/${PN}"-202-nosystemd-daemon-makefile.patch || die
173
178
174
	# change rules back to group uucp instead of dialout for now wrt #454556
179
	# change rules back to group uucp instead of dialout for now wrt #454556
175
	sed -e 's/GROUP="dialout"/GROUP="uucp"/' \
180
	sed -e 's/GROUP="dialout"/GROUP="uucp"/' \
176
		-i rules/*.rules \
181
		-i rules/*.rules \
177
	|| die "failed to change group dialout to uucp"
182
	|| die "failed to change group dialout to uucp"
178
183
179
	if ! use elibc_glibc; then #443030
180
		echo '#define secure_getenv(x) NULL' >> config.h.in
181
		sed -i -e '/error.*secure_getenv/s:.*:#define secure_getenv(x) NULL:' src/shared/missing.h || die
182
	fi
183
184
	if [ ! -e configure ]; then
184
	if [ ! -e configure ]; then
185
		if use doc; then
185
		if use doc; then
186
			gtkdocize --docdir docs || die "gtkdocize failed"
186
			gtkdocize --docdir docs || die "gtkdocize failed"
Lines 194-205 Link Here
194
		eautomake
194
		eautomake
195
	fi
195
	fi
196
196
197
	if ! use elibc_glibc; then #443030
198
		echo '#define secure_getenv(x) NULL' >> config.h.in
199
		sed -i -e '/error.*secure_getenv/s:.*:#define secure_getenv(x) NULL:' src/shared/missing.h || die
200
	fi
201
197
	# link udevd(8) to systemd-udevd.service(8) manpage
202
	# link udevd(8) to systemd-udevd.service(8) manpage
198
	#echo '.so systemd-udevd.service.8' > "${T}"/udevd.8
203
	#echo '.so systemd-udevd.service.8' > "${T}"/udevd.8
199
}
204
}
200
205
201
src_configure() {
206
src_configure() {
202
	use keymap || export ac_cv_path_GPERF=true #452760
207
	tc-export CC #463846
208
	use keymap || export ac_cv_prog_ac_ct_GPERF=true #452760
203
209
204
	# alternative: systemd daemon NOPs when -DDISABLE_SYSTEMD is set
210
	# alternative: systemd daemon NOPs when -DDISABLE_SYSTEMD is set
205
	# also not for logind, but does not harm.
211
	# also not for logind, but does not harm.
Lines 263-269 Link Here
263
		$(use_enable selinux)
269
		$(use_enable selinux)
264
		$(use_enable static-libs static)
270
		$(use_enable static-libs static)
265
	)
271
	)
266
267
	if use introspection; then
272
	if use introspection; then
268
		econf_args+=(
273
		econf_args+=(
269
			--enable-introspection=$(usex introspection)
274
			--enable-introspection=$(usex introspection)
Lines 272-278 Link Here
272
277
273
	if use firmware-loader; then
278
	if use firmware-loader; then
274
		econf_args+=(
279
		econf_args+=(
275
			--with-firmware-path=/lib/firmware/updates:/lib/firmware
280
			--with-firmware-path="/lib/firmware/updates:/lib/firmware"
276
		)
281
		)
277
	fi
282
	fi
278
283
Lines 292-300 Link Here
292
	emake -f Makefile -f "${T}"/Makefile.extra BUILT_SOURCES
297
	emake -f Makefile -f "${T}"/Makefile.extra BUILT_SOURCES
293
	local targets=(
298
	local targets=(
294
		libudev-private.la
299
		libudev-private.la
300
		libudev.la
295
		systemd-udevd
301
		systemd-udevd
296
		udevadm
302
		udevadm
297
		libudev.la
298
		ata_id
303
		ata_id
299
		cdrom_id
304
		cdrom_id
300
		collect
305
		collect
Lines 393-399 Link Here
393
		INSTALL_DIRS='$(sysconfdir)/udev/rules.d \
398
		INSTALL_DIRS='$(sysconfdir)/udev/rules.d \
394
				$(sysconfdir)/udev/hwdb.d'
399
				$(sysconfdir)/udev/hwdb.d'
395
		dist_bashcompletion_DATA="shell-completion/bash/udevadm"
400
		dist_bashcompletion_DATA="shell-completion/bash/udevadm"
396
397
	)
401
	)
398
	if use logind; then
402
	if use logind; then
399
		targets+=(
403
		targets+=(
Lines 404-410 Link Here
404
		)
408
		)
405
	fi
409
	fi
406
	emake -j1 DESTDIR="${D}" "${targets[@]}"
410
	emake -j1 DESTDIR="${D}" "${targets[@]}"
407
408
	if use doc; then
411
	if use doc; then
409
		emake -C docs/libudev DESTDIR="${D}" install
412
		emake -C docs/libudev DESTDIR="${D}" install
410
		use gudev && emake -C docs/gudev DESTDIR="${D}" install
413
		use gudev && emake -C docs/gudev DESTDIR="${D}" install
Lines 416-424 Link Here
416
		"${D}"/lib/udev/rules.d/99-systemd.rules \
419
		"${D}"/lib/udev/rules.d/99-systemd.rules \
417
		"${D}"/usr/share/doc/${PF}/LICENSE.*
420
		"${D}"/usr/share/doc/${PF}/LICENSE.*
418
421
419
	# install gentoo-specific rules
422
	# see src_prepare() for content of these files
420
	insinto /lib/udev/rules.d
423
	insinto /lib/udev/rules.d
421
	doins "${T}"/40-gentoo.rules
424
	doins "${T}"/40-gentoo.rules
425
#	doman "${T}"/udevd.8
422
426
423
	dodir /usr/$(get_libdir)
427
	dodir /usr/$(get_libdir)
424
	mv ${D:-:}/$(get_libdir)/pkgconfig ${D}/usr/$(get_libdir)
428
	mv ${D:-:}/$(get_libdir)/pkgconfig ${D}/usr/$(get_libdir)
Lines 438-444 Link Here
438
	# move udevd where it should be and remove unlogical /lib/systemd
442
	# move udevd where it should be and remove unlogical /lib/systemd
439
	mv "${ED}"/lib/systemd/systemd-udevd "${ED}"/sbin/udevd || die
443
	mv "${ED}"/lib/systemd/systemd-udevd "${ED}"/sbin/udevd || die
440
	rm -r "${ED}"/lib/systemd
444
	rm -r "${ED}"/lib/systemd
441
	rm -r "${ED}"/usr/lib/systemd
442
445
443
	# create symlinks for these utilities to /sbin
446
	# create symlinks for these utilities to /sbin
444
	# where multipath-tools expect them to be (Bug #168588)
447
	# where multipath-tools expect them to be (Bug #168588)
Lines 455-472 Link Here
455
	fi
458
	fi
456
459
457
	local man
460
	local man
458
	for man in man7/udevd.7 man8/udevd.8 man8/udevadm.8 ${manuals}; do
461
	for man in man7/udev.7 man8/udevd.8 man8/udevadm.8 ${manuals}; do
459
		sed -i 's:\\fBsystem.*\\fR(1),::' ${D}/usr/share/man/${man}
462
		sed -i 's:\\fBsystem.*\\fR(1),::' ${D}/usr/share/man/${man}
460
		sed -i 's:systemd-\([^\.]*\)\.service:\1:g' ${D}/usr/share/man/${man}
463
		sed -i 's:systemd-\([^\.]*\)\.service:\1:g' ${D}/usr/share/man/${man}
464
		sed -i 's:systemd-\([^\.]*\.socket\):\1:g' ${D}/usr/share/man/${man}
461
		sed -i 's:systemd\\-::g' ${D}/usr/share/man/${man}
465
		sed -i 's:systemd\\-::g' ${D}/usr/share/man/${man}
462
		sed -i '/^\.TH/s:systemd:version:' ${D}/usr/share/man/${man}
466
		sed -i '/^\.TH/s:systemd:version:' ${D}/usr/share/man/${man}
467
		sed -i '/^\.TH/s:SYSTEMD\\-::' ${D}/usr/share/man/${man}
463
	done
468
	done
464
469
465
	# see src_prepare() where this is created
466
	#doman "${T}"/udevd.8
467
468
	if use logind; then
470
	if use logind; then
469
#		rm -f "${D}"/usr/dbus-1/system.d/org.freedesktop.systemd1.conf
470
		exeinto /$(get_libdir)/udev
471
		exeinto /$(get_libdir)/udev
471
		doexe  ./.libs/systemd-logind
472
		doexe  ./.libs/systemd-logind
472
		mv ${D}/$(get_libdir)/udev/systemd-logind ${D}/sbin/logind
473
		mv ${D}/$(get_libdir)/udev/systemd-logind ${D}/sbin/logind
Lines 478-485 Link Here
478
pkg_preinst() {
479
pkg_preinst() {
479
	local htmldir
480
	local htmldir
480
	for htmldir in gudev libudev; do
481
	for htmldir in gudev libudev; do
481
		if [[ -d ${ROOT}usr/share/gtk-doc/html/${htmldir} ]]; then
482
		if [[ -d ${ROOT}/usr/share/gtk-doc/html/${htmldir} ]]; then
482
			rm -rf "${ROOT}"usr/share/gtk-doc/html/${htmldir}
483
			rm -rf "${ROOT}"/usr/share/gtk-doc/html/${htmldir}
483
		fi
484
		fi
484
		if [[ -d ${D}/usr/share/doc/${PF}/html/${htmldir} ]]; then
485
		if [[ -d ${D}/usr/share/doc/${PF}/html/${htmldir} ]]; then
485
			dosym ../../doc/${PF}/html/${htmldir} \
486
			dosym ../../doc/${PF}/html/${htmldir} \
Lines 489-503 Link Here
489
	preserve_old_lib /{,usr/}$(get_libdir)/libudev$(get_libname 0)
490
	preserve_old_lib /{,usr/}$(get_libdir)/libudev$(get_libname 0)
490
}
491
}
491
492
492
# This function determines if a directory is a mount point.
493
# It was lifted from dracut.
494
ismounted() {
495
	while read a m a; do
496
		[[ $m = $1 ]] && return 0
497
	done < "${ROOT}"/proc/mounts
498
	return 1
499
}
500
501
pkg_postinst() {
493
pkg_postinst() {
502
	mkdir -p "${ROOT}"/run
494
	mkdir -p "${ROOT}"/run
503
495
Lines 520-543 Link Here
520
		einfo "Removed unneeded file ${old_dm_rules}"
512
		einfo "Removed unneeded file ${old_dm_rules}"
521
	fi
513
	fi
522
514
523
	if ismounted /usr; then
524
		ewarn
525
		ewarn "Your system has /usr on a separate partition. This means"
526
		ewarn "you will need to use an initramfs to pre-mount /usr before"
527
		ewarn "udev runs."
528
		ewarn
529
		ewarn "If this is not set up before your next reboot, udev may work;"
530
		ewarn "However, you also may experience failures which are very"
531
		ewarn "difficult to troubleshoot."
532
		ewarn
533
		ewarn "For a more detailed explanation, see the following URL:"
534
		ewarn "http://www.freedesktop.org/wiki/Software/systemd/separate-usr-is-broken"
535
		ewarn
536
		ewarn "For more information on setting up an initramfs, see the"
537
		ewarn "following URL:"
538
		ewarn "http://www.gentoo.org/doc/en/initramfs-guide.xml"
539
	fi
540
541
	local fstab="${ROOT}"/etc/fstab dev path fstype rest
515
	local fstab="${ROOT}"/etc/fstab dev path fstype rest
542
	while read -r dev path fstype rest; do
516
	while read -r dev path fstype rest; do
543
		if [[ ${path} == /dev && ${fstype} != devtmpfs ]]; then
517
		if [[ ${path} == /dev && ${fstype} != devtmpfs ]]; then
Lines 595-601 Link Here
595
	ewarn "(replace <ifname> with, for example, eth0):"
569
	ewarn "(replace <ifname> with, for example, eth0):"
596
	ewarn "# udevadm test-builtin net_id /sys/class/net/<ifname> 2> /dev/null"
570
	ewarn "# udevadm test-builtin net_id /sys/class/net/<ifname> 2> /dev/null"
597
	ewarn
571
	ewarn
598
	ewarn "You can use kernel command net.ifnames= to control this feature."
572
	ewarn "You can use kernel commandline net.ifnames=0 to disable this feature."
599
573
600
	ewarn
574
	ewarn
601
	ewarn "You need to restart udev as soon as possible to make the upgrade go"
575
	ewarn "You need to restart udev as soon as possible to make the upgrade go"
Lines 605-617 Link Here
605
	preserve_old_lib_notify /{,usr/}$(get_libdir)/libudev$(get_libname 0)
579
	preserve_old_lib_notify /{,usr/}$(get_libdir)/libudev$(get_libname 0)
606
580
607
	elog
581
	elog
608
	elog "For more information on udev on Gentoo, writing udev rules, and"
582
	elog "For more information on udev on Gentoo, upgrading, writing udev rules, and"
609
	elog "         fixing known issues visit:"
583
	elog "         fixing known issues visit:"
584
	elog "         http://wiki.gentoo.org/wiki/Udev/upgrade"
610
	elog "         http://www.gentoo.org/doc/en/udev-guide.xml"
585
	elog "         http://www.gentoo.org/doc/en/udev-guide.xml"
611
586
612
	# Keep this here in case the database format changes so it gets updated
587
	# Update hwdb database in case the format is changed by udev version.
613
	# when required. Despite that this file is owned by sys-apps/hwids.
588
	if use hwdb && has_version 'sys-apps/hwids[udev]'; then
614
	if use hwdb && has_version sys-apps/hwids; then
615
		udevadm hwdb --update --root="${ROOT%/}"
589
		udevadm hwdb --update --root="${ROOT%/}"
616
	fi
590
	fi
617
}
591
}

Return to bug 461940