Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 478538
Collapse All | Expand All

(-)a/systemd-206.ebuild (-50 / +74 lines)
Lines 7-13 EAPI=5 Link Here
7
AUTOTOOLS_PRUNE_LIBTOOL_FILES=all
7
AUTOTOOLS_PRUNE_LIBTOOL_FILES=all
8
PYTHON_COMPAT=( python2_7 )
8
PYTHON_COMPAT=( python2_7 )
9
inherit autotools-utils bash-completion-r1 fcaps linux-info multilib \
9
inherit autotools-utils bash-completion-r1 fcaps linux-info multilib \
10
	pam python-single-r1 systemd toolchain-funcs udev user
10
	pam python-single-r1 systemd toolchain-funcs user
11
11
12
DESCRIPTION="System and service manager for Linux"
12
DESCRIPTION="System and service manager for Linux"
13
HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
13
HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
Lines 74-95 pkg_pretend() { Link Here
74
		~SYSFS ~!IDE ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2"
74
		~SYSFS ~!IDE ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2"
75
#		~!FW_LOADER_USER_HELPER"
75
#		~!FW_LOADER_USER_HELPER"
76
76
77
	# read null-terminated argv[0] from PID 1
78
	# and see which path to systemd was used (if any)
79
	local init_path
80
	IFS= read -r -d '' init_path < /proc/1/cmdline
81
	if [[ ${init_path} == */bin/systemd ]]; then
82
		eerror "You are using a compatibility symlink to run systemd. The symlink"
83
		eerror "has been removed. Please update your bootloader to use:"
84
		eerror
85
		eerror "	init=/usr/lib/systemd/systemd"
86
		eerror
87
		eerror "and reboot your system. We are sorry for the inconvenience."
88
		if [[ ${MERGE_TYPE} != buildonly ]]; then
89
			die "Compatibility symlink used to boot systemd."
90
		fi
91
	fi
92
93
	if [[ ${MERGE_TYPE} != binary ]]; then
77
	if [[ ${MERGE_TYPE} != binary ]]; then
94
		if [[ $(gcc-major-version) -lt 4
78
		if [[ $(gcc-major-version) -lt 4
95
			|| ( $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 6 ) ]]
79
			|| ( $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 6 ) ]]
Lines 133-138 src_configure() { Link Here
133
		# no deps
117
		# no deps
134
		--enable-efi
118
		--enable-efi
135
		--enable-ima
119
		--enable-ima
120
		# These are needed since we do not have the /usr merge
121
		--with-rootlibdir=/$(get_libdir)
122
		--with-rootprefix=
123
136
		# optional components/dependencies
124
		# optional components/dependencies
137
		$(use_enable acl)
125
		$(use_enable acl)
138
		$(use_enable audit)
126
		$(use_enable audit)
Lines 162-170 src_configure() { Link Here
162
		QUOTACHECK=/usr/sbin/quotacheck
150
		QUOTACHECK=/usr/sbin/quotacheck
163
	)
151
	)
164
152
165
	# Keep using the one where the rules were installed.
166
	MY_UDEVDIR=$(get_udevdir)
167
168
	if use firmware-loader; then
153
	if use firmware-loader; then
169
		myeconfargs+=(
154
		myeconfargs+=(
170
			--with-firmware-path="/lib/firmware/updates:/lib/firmware"
155
			--with-firmware-path="/lib/firmware/updates:/lib/firmware"
Lines 177-209 src_configure() { Link Here
177
	autotools-utils_src_configure
162
	autotools-utils_src_configure
178
}
163
}
179
164
180
src_compile() {
181
	autotools-utils_src_compile \
182
		udevlibexecdir="${MY_UDEVDIR}"
183
}
184
185
src_install() {
165
src_install() {
186
	autotools-utils_src_install -j1 \
166
	autotools-utils_src_install -j1 \
187
		udevlibexecdir="${MY_UDEVDIR}" \
188
		dist_udevhwdb_DATA=
167
		dist_udevhwdb_DATA=
189
168
190
	# keep udev working without initramfs, for openrc compat
169
	# add compatibility symlinks
191
	dodir /bin /sbin
170
	dosym ../bin/udevadm /sbin/udevadm
192
	mv "${D}"/usr/lib/systemd/systemd-udevd "${D}"/sbin/udevd || die
171
	dosym ../lib/systemd/systemd-udevd /sbin/udevd
193
	mv "${D}"/usr/bin/udevadm "${D}"/bin/udevadm || die
194
	dosym ../../../sbin/udevd /usr/lib/systemd/systemd-udevd
195
	dosym ../../bin/udevadm /usr/bin/udevadm
196
172
197
	# zsh completion
173
	# zsh completion
198
	insinto /usr/share/zsh/site-functions
174
	insinto /usr/share/zsh/site-functions
199
	newins shell-completion/systemd-zsh-completion.zsh "_${PN}"
175
	newins shell-completion/systemd-zsh-completion.zsh "_${PN}"
200
176
201
	# compat for init= use
202
	dosym ../usr/lib/systemd/systemd /bin/systemd
203
	dosym ../lib/systemd/systemd /usr/bin/systemd
204
	# rsyslog.service depends on it...
205
	dosym ../usr/bin/systemctl /bin/systemctl
206
207
	# we just keep sysvinit tools, so no need for the mans
177
	# we just keep sysvinit tools, so no need for the mans
208
	rm "${D}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 \
178
	rm "${D}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 \
209
		|| die
179
		|| die
Lines 225-238 src_install() { Link Here
225
	# Preserve empty dirs in /etc & /var, bug #437008
195
	# Preserve empty dirs in /etc & /var, bug #437008
226
	keepdir /etc/binfmt.d /etc/modules-load.d /etc/tmpfiles.d \
196
	keepdir /etc/binfmt.d /etc/modules-load.d /etc/tmpfiles.d \
227
		/etc/systemd/ntp-units.d /etc/systemd/user /var/lib/systemd
197
		/etc/systemd/ntp-units.d /etc/systemd/user /var/lib/systemd
228
229
	# Check whether we won't break user's system.
230
	local x
231
	for x in /bin/systemd /usr/bin/systemd \
232
		/usr/bin/udevadm /usr/lib/systemd/systemd-udevd
233
	do
234
		[[ -x ${D}${x} ]] || die "${x} symlink broken, aborting."
235
	done
236
}
198
}
237
199
238
optfeature() {
200
optfeature() {
Lines 249-254 optfeature() { Link Here
249
	elog "${text} (${desc})"
211
	elog "${text} (${desc})"
250
}
212
}
251
213
214
# This function was lifted from dracut and slightly modified.
215
ismounted() {
216
	local real_mnt dev mnt etc
217
	real_mnt="$(readlink -e -q $1)"
218
	while read dev mnt etc; do
219
		[ "$mnt" = "$real_mnt" ] && return 0
220
	done < /proc/self/mounts
221
	return 1
222
}
223
252
pkg_postinst() {
224
pkg_postinst() {
253
	# for udev rules
225
	# for udev rules
254
	enewgroup dialout
226
	enewgroup dialout
Lines 277-286 pkg_postinst() { Link Here
277
		ewarn
249
		ewarn
278
	fi
250
	fi
279
251
280
	elog "To get additional features, a number of optional runtime dependencies may"
252
	if ! has_version sys-apps/systemd-ui; then
281
	elog "be installed:"
253
		optfeature 'for GTK+ systemadm UI and gnome-ask-password-agent' \
282
	optfeature 'for GTK+ systemadm UI and gnome-ask-password-agent' \
254
			'sys-apps/systemd-ui'
283
		'sys-apps/systemd-ui'
255
	fi
256
257
	# discover which init process was run
258
	local init_path
259
	IFS= read -r -d '' init_path < /proc/1/cmdline
260
	if [[ ${init_path} != "/lib/systemd/systemd" ]]; then
261
		elog
262
		elog "To use systemd, add the following to your boot loader"
263
		elog "configuration:"
264
		elog
265
		elog "init=/lib/systemd/systemd"
266
	fi
267
268
	if [[ ! -L "${ROOT}"/lib && -d "${ROOT}"/usr/lib/systemd/system ]]; then
269
		ewarn
270
		ewarn "You need to re-emerge packages installing files in"
271
		ewarn "/usr/lib/systemd/system so these files move to"
272
		ewarn "/lib/systemd/system."
273
		ewarn
274
		ewarn "One way to do this is to run the following command:"
275
		ewarn "emerge -av1 /usr/lib/systemd/system"
276
		ewarn
277
		ewarn "Once you do this, you may need to disable then re-enable"
278
		ewarn "services. an easy way to do this is to run"
279
		ewarn "systemd-fix-services as root."
280
	fi
281
282
	if [[ ! -L "${ROOT}"/lib && -d "${ROOT}"/usr/lib/udev ]]; then
283
		ewarn
284
		ewarn "You need to re-emerge packages installing files in /usr/lib/udev"
285
		ewarn "to move these files to /lib/udev."
286
		ewarn
287
		ewarn "One way to do this is to run the following command:"
288
		ewarn "emerge -av1 /usr/lib/udev"
289
	fi
290
291
	if ismounted /usr && [[ -z $REPLACING_VERSIONS ]]; then
292
		ewarn
293
		ewarn "Your system has /usr on a separate partition. This means"
294
		ewarn "you will need to use an initramfs to pre-mount /usr before"
295
		ewarn "systemd runs."
296
		ewarn
297
		ewarn "If this is not set up before your next reboot, systemd may work;"
298
		ewarn "However, you also may experience failures which are very"
299
		ewarn "difficult to troubleshoot."
300
		ewarn
301
		ewarn "For a more detailed explanation, see the following URL:"
302
		ewarn "http://www.freedesktop.org/wiki/Software/systemd/separate-usr-is-broken"
303
		ewarn
304
		ewarn "For more information on setting up an initramfs, see the"
305
		ewarn "following URL:"
306
		ewarn "http://www.gentoo.org/doc/en/initramfs-guide.xml"
307
	fi
284
}
308
}
285
309
286
pkg_prerm() {
310
pkg_prerm() {

Return to bug 478538