Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/systemd/
Date: Thu, 24 Jan 2019 14:53:39
Message-Id: 1548341236.55b9c69178b4518b06b29c3f156c2f1e33211224.floppym@gentoo
1 commit: 55b9c69178b4518b06b29c3f156c2f1e33211224
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jan 24 14:47:16 2019 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Thu Jan 24 14:47:16 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=55b9c691
7
8 sys-apps/systemd: backports for 240 based on v240-stable branch
9
10 Bug: https://bugs.gentoo.org/674520
11 Bug: https://bugs.gentoo.org/674292
12 Bug: https://bugs.gentoo.org/674152
13 Package-Manager: Portage-2.3.56_p3, Repoman-2.3.12_p50
14 Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
15
16 sys-apps/systemd/Manifest | 1 +
17 sys-apps/systemd/systemd-240-r4.ebuild | 457 +++++++++++++++++++++++++++++++++
18 2 files changed, 458 insertions(+)
19
20 diff --git a/sys-apps/systemd/Manifest b/sys-apps/systemd/Manifest
21 index daf7009c328..690f6b032b0 100644
22 --- a/sys-apps/systemd/Manifest
23 +++ b/sys-apps/systemd/Manifest
24 @@ -3,4 +3,5 @@ DIST systemd-239-patches-2.tar.gz 33416 BLAKE2B 9602d101cbac65d3b2490f28308e843c
25 DIST systemd-239.tar.gz 7157293 BLAKE2B 975f6215c8bb6662d6e161f637e1fece22930c0190b3c31a8fc4cb1a10600546a252704ac95590d9d14e495fcd06082a590e6d755e36603a41b3a396d579d8b0 SHA512 fd44590dfd148504c5ed1e67521efce50d84b627b7fc77015fa95dfa76d7a42297c56cc89eff40181809732024b16d48f2a87038cf435e0c63bc2b95ecd86b0f
26 DIST systemd-240-patches-1.tar.gz 15364 BLAKE2B e5cf4c2b8666a5c03e658f46674422d2566a748d3dc088f3cda0f5c5e7b51aec00a531ef7e9d047fd59504299d2e8a44faa353da1183260ae72156bb486d51f7 SHA512 1541810dbcfcc75c4323015c056c963ef69d633761293dea7f27aa6106e3ccc59a84263c703fc5542cf2fb3410c846e97ffb11ecc7d56a98ca658b43b73b6313
27 DIST systemd-240-patches-2.tar.gz 28099 BLAKE2B 2e497ed729e2482ef3cc0d010504314f2982a9af19341d6f4efa06b24b3c01f9f69996d43e5b484c641777d00a8a0ba4508bcf6a0296a63d4fc57440f2d3708c SHA512 1be0432d918a4866056ffc65de6e8b412784e5018490c0349a98bba801536d2689c5b2ce41ddd5adbb945aac71bfd0168f94c1daf0788661cd83b159a8c975b8
28 +DIST systemd-240-patches-3.tar.gz 31952 BLAKE2B 0677d24c4f4e1575dbd4953eb75734f0773671e4ffc2a8d848353a379f5ea2caf4f96620ed6303d98ec00a15367d5e2124b493aaef80b1a0fe118866a1c04ada SHA512 e604e1de17bcd4c941036f12d2e3ae96dd6e86647db2b07576e8468405900b6e8af6a0e55a50c7e9b19704601930b8152c8ac506b2624e261ee0cd35dfc91a21
29 DIST systemd-240.tar.gz 7582001 BLAKE2B cf53595a83424984dd9f533f7cd0c9905366c5a52ab946fc45ff7fd1bcc85978ff654720113641534e40c0f9a1ad1c9628255778616770762950426789f659c3 SHA512 da7467781b16f65d868931ae88fd07554db61542aec7f11dbec9f7279b529f900301edfea2d3813ddb64eeb3fdcfb7be86e540c65212dd7cfdcdebbc80de2ff5
30
31 diff --git a/sys-apps/systemd/systemd-240-r4.ebuild b/sys-apps/systemd/systemd-240-r4.ebuild
32 new file mode 100644
33 index 00000000000..2fe824b0e42
34 --- /dev/null
35 +++ b/sys-apps/systemd/systemd-240-r4.ebuild
36 @@ -0,0 +1,457 @@
37 +# Copyright 1999-2019 Gentoo Authors
38 +# Distributed under the terms of the GNU General Public License v2
39 +
40 +EAPI=7
41 +
42 +if [[ ${PV} == 9999 ]]; then
43 + EGIT_REPO_URI="https://github.com/systemd/systemd.git"
44 + inherit git-r3
45 +else
46 + SRC_URI="https://github.com/systemd/systemd/archive/v${PV}/${P}.tar.gz
47 + https://dev.gentoo.org/~floppym/dist/${P}-patches-3.tar.gz"
48 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
49 +fi
50 +
51 +PYTHON_COMPAT=( python{3_5,3_6,3_7} )
52 +
53 +inherit bash-completion-r1 linux-info meson multilib-minimal ninja-utils pam python-any-r1 systemd toolchain-funcs udev user
54 +
55 +DESCRIPTION="System and service manager for Linux"
56 +HOMEPAGE="https://www.freedesktop.org/wiki/Software/systemd"
57 +
58 +LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
59 +SLOT="0/2"
60 +IUSE="acl apparmor audit build cryptsetup curl elfutils +gcrypt gnuefi http idn importd +kmod libidn2 +lz4 lzma nat pam pcre policykit qrcode +resolvconf +seccomp selinux +split-usr ssl +sysv-utils test vanilla xkb"
61 +
62 +REQUIRED_USE="importd? ( curl gcrypt lzma )"
63 +RESTRICT="!test? ( test )"
64 +
65 +MINKV="3.11"
66 +
67 +COMMON_DEPEND=">=sys-apps/util-linux-2.30:0=[${MULTILIB_USEDEP}]
68 + sys-libs/libcap:0=[${MULTILIB_USEDEP}]
69 + !<sys-libs/glibc-2.16
70 + acl? ( sys-apps/acl:0= )
71 + apparmor? ( sys-libs/libapparmor:0= )
72 + audit? ( >=sys-process/audit-2:0= )
73 + cryptsetup? ( >=sys-fs/cryptsetup-1.6:0= )
74 + curl? ( net-misc/curl:0= )
75 + elfutils? ( >=dev-libs/elfutils-0.158:0= )
76 + gcrypt? ( >=dev-libs/libgcrypt-1.4.5:0=[${MULTILIB_USEDEP}] )
77 + http? (
78 + >=net-libs/libmicrohttpd-0.9.33:0=
79 + ssl? ( >=net-libs/gnutls-3.1.4:0= )
80 + )
81 + idn? (
82 + libidn2? ( net-dns/libidn2:= )
83 + !libidn2? ( net-dns/libidn:= )
84 + )
85 + importd? (
86 + app-arch/bzip2:0=
87 + sys-libs/zlib:0=
88 + )
89 + kmod? ( >=sys-apps/kmod-15:0= )
90 + lz4? ( >=app-arch/lz4-0_p131:0=[${MULTILIB_USEDEP}] )
91 + lzma? ( >=app-arch/xz-utils-5.0.5-r1:0=[${MULTILIB_USEDEP}] )
92 + nat? ( net-firewall/iptables:0= )
93 + pam? ( virtual/pam:=[${MULTILIB_USEDEP}] )
94 + pcre? ( dev-libs/libpcre2 )
95 + qrcode? ( media-gfx/qrencode:0= )
96 + seccomp? ( >=sys-libs/libseccomp-2.3.3:0= )
97 + selinux? ( sys-libs/libselinux:0= )
98 + xkb? ( >=x11-libs/libxkbcommon-0.4.1:0= )"
99 +
100 +# baselayout-2.2 has /run
101 +RDEPEND="${COMMON_DEPEND}
102 + >=sys-apps/baselayout-2.2
103 + selinux? ( sec-policy/selinux-base-policy[systemd] )
104 + sysv-utils? ( !sys-apps/sysvinit )
105 + !sysv-utils? ( sys-apps/sysvinit )
106 + resolvconf? ( !net-dns/openresolv )
107 + !build? ( || (
108 + sys-apps/util-linux[kill(-)]
109 + sys-process/procps[kill(+)]
110 + sys-apps/coreutils[kill(-)]
111 + ) )
112 + !sys-auth/nss-myhostname
113 + !<sys-kernel/dracut-044
114 + !sys-fs/eudev
115 + !sys-fs/udev"
116 +
117 +# sys-apps/dbus: the daemon only (+ build-time lib dep for tests)
118 +PDEPEND=">=sys-apps/dbus-1.9.8[systemd]
119 + >=sys-apps/hwids-20150417[udev]
120 + >=sys-fs/udev-init-scripts-25
121 + policykit? ( sys-auth/polkit )
122 + !vanilla? ( sys-apps/gentoo-systemd-integration )"
123 +
124 +# Newer linux-headers needed by ia64, bug #480218
125 +DEPEND="
126 + >=sys-kernel/linux-headers-${MINKV}
127 + gnuefi? ( >=sys-boot/gnu-efi-3.0.2 )
128 +"
129 +
130 +BDEPEND="
131 + app-arch/xz-utils:0
132 + dev-util/gperf
133 + >=dev-util/meson-0.46
134 + >=dev-util/intltool-0.50
135 + >=sys-apps/coreutils-8.16
136 + virtual/pkgconfig[${MULTILIB_USEDEP}]
137 + test? ( sys-apps/dbus )
138 + app-text/docbook-xml-dtd:4.2
139 + app-text/docbook-xml-dtd:4.5
140 + app-text/docbook-xsl-stylesheets
141 + dev-libs/libxslt:0
142 + $(python_gen_any_dep 'dev-python/lxml[${PYTHON_USEDEP}]')
143 +"
144 +
145 +pkg_pretend() {
146 + if [[ ${MERGE_TYPE} != buildonly ]]; then
147 + local CONFIG_CHECK="~AUTOFS4_FS ~BLK_DEV_BSG ~CGROUPS
148 + ~CHECKPOINT_RESTORE ~DEVTMPFS ~EPOLL ~FANOTIFY ~FHANDLE
149 + ~INOTIFY_USER ~IPV6 ~NET ~NET_NS ~PROC_FS ~SIGNALFD ~SYSFS
150 + ~TIMERFD ~TMPFS_XATTR ~UNIX
151 + ~CRYPTO_HMAC ~CRYPTO_SHA256 ~CRYPTO_USER_API_HASH
152 + ~!FW_LOADER_USER_HELPER_FALLBACK ~!GRKERNSEC_PROC ~!IDE ~!SYSFS_DEPRECATED
153 + ~!SYSFS_DEPRECATED_V2"
154 +
155 + use acl && CONFIG_CHECK+=" ~TMPFS_POSIX_ACL"
156 + use seccomp && CONFIG_CHECK+=" ~SECCOMP ~SECCOMP_FILTER"
157 + kernel_is -lt 3 7 && CONFIG_CHECK+=" ~HOTPLUG"
158 + kernel_is -lt 4 7 && CONFIG_CHECK+=" ~DEVPTS_MULTIPLE_INSTANCES"
159 + kernel_is -ge 4 10 && CONFIG_CHECK+=" ~CGROUP_BPF"
160 +
161 + if linux_config_exists; then
162 + local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
163 + if [[ -n ${uevent_helper_path} ]] && [[ ${uevent_helper_path} != '""' ]]; then
164 + ewarn "It's recommended to set an empty value to the following kernel config option:"
165 + ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
166 + fi
167 + if linux_chkconfig_present X86; then
168 + CONFIG_CHECK+=" ~DMIID"
169 + fi
170 + fi
171 +
172 + if kernel_is -lt ${MINKV//./ }; then
173 + ewarn "Kernel version at least ${MINKV} required"
174 + fi
175 +
176 + check_extra_config
177 + fi
178 +}
179 +
180 +pkg_setup() {
181 + :
182 +}
183 +
184 +src_unpack() {
185 + default
186 + [[ ${PV} != 9999 ]] || git-r3_src_unpack
187 +}
188 +
189 +src_prepare() {
190 + # Do NOT add patches here
191 + local PATCHES=()
192 +
193 + [[ -d "${WORKDIR}"/patches ]] && PATCHES+=( "${WORKDIR}"/patches )
194 +
195 + # Add local patches here
196 + PATCHES+=(
197 + )
198 +
199 + if ! use vanilla; then
200 + PATCHES+=(
201 + "${FILESDIR}/gentoo-Dont-enable-audit-by-default.patch"
202 + "${FILESDIR}/gentoo-systemd-user-pam.patch"
203 + "${FILESDIR}/gentoo-uucp-group-r1.patch"
204 + "${FILESDIR}/gentoo-generator-path-r1.patch"
205 + )
206 + fi
207 +
208 + default
209 +}
210 +
211 +src_configure() {
212 + # Prevent conflicts with i686 cross toolchain, bug 559726
213 + tc-export AR CC NM OBJCOPY RANLIB
214 +
215 + python_setup
216 +
217 + multilib-minimal_src_configure
218 +}
219 +
220 +meson_use() {
221 + usex "$1" true false
222 +}
223 +
224 +meson_multilib() {
225 + if multilib_is_native_abi; then
226 + echo true
227 + else
228 + echo false
229 + fi
230 +}
231 +
232 +meson_multilib_native_use() {
233 + if multilib_is_native_abi && use "$1"; then
234 + echo true
235 + else
236 + echo false
237 + fi
238 +}
239 +
240 +multilib_src_configure() {
241 + local myconf=(
242 + --localstatedir="${EPREFIX}/var"
243 + -Dpamlibdir="$(getpam_mod_dir)"
244 + # avoid bash-completion dep
245 + -Dbashcompletiondir="$(get_bashcompdir)"
246 + # make sure we get /bin:/sbin in PATH
247 + -Dsplit-usr=$(usex split-usr true false)
248 + -Drootprefix="$(usex split-usr "${EPREFIX:-/}" "${EPREFIX}/usr")"
249 + -Dsysvinit-path=
250 + -Dsysvrcnd-path=
251 + # Avoid infinite exec recursion, bug 642724
252 + -Dtelinit-path="${EPREFIX}/lib/sysvinit/telinit"
253 + # no deps
254 + -Defi=$(meson_multilib)
255 + -Dima=true
256 + # Optional components/dependencies
257 + -Dacl=$(meson_multilib_native_use acl)
258 + -Dapparmor=$(meson_multilib_native_use apparmor)
259 + -Daudit=$(meson_multilib_native_use audit)
260 + -Dlibcryptsetup=$(meson_multilib_native_use cryptsetup)
261 + -Dlibcurl=$(meson_multilib_native_use curl)
262 + -Delfutils=$(meson_multilib_native_use elfutils)
263 + -Dgcrypt=$(meson_use gcrypt)
264 + -Dgnu-efi=$(meson_multilib_native_use gnuefi)
265 + -Defi-libdir="${EPREFIX}/usr/$(get_libdir)"
266 + -Dmicrohttpd=$(meson_multilib_native_use http)
267 + $(usex http -Dgnutls=$(meson_multilib_native_use ssl) -Dgnutls=false)
268 + -Dimportd=$(meson_multilib_native_use importd)
269 + -Dbzip2=$(meson_multilib_native_use importd)
270 + -Dzlib=$(meson_multilib_native_use importd)
271 + -Dkmod=$(meson_multilib_native_use kmod)
272 + -Dlz4=$(meson_use lz4)
273 + -Dxz=$(meson_use lzma)
274 + -Dlibiptc=$(meson_multilib_native_use nat)
275 + -Dpam=$(meson_use pam)
276 + -Dpcre2=$(meson_multilib_native_use pcre)
277 + -Dpolkit=$(meson_multilib_native_use policykit)
278 + -Dqrencode=$(meson_multilib_native_use qrcode)
279 + -Dseccomp=$(meson_multilib_native_use seccomp)
280 + -Dselinux=$(meson_multilib_native_use selinux)
281 + #-Dtests=$(meson_multilib_native_use test)
282 + -Ddbus=$(meson_multilib_native_use test)
283 + -Dxkbcommon=$(meson_multilib_native_use xkb)
284 + # hardcode a few paths to spare some deps
285 + -Dkill-path=/bin/kill
286 + -Dntp-servers="0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org"
287 + # Breaks screen, tmux, etc.
288 + -Ddefault-kill-user-processes=false
289 +
290 + # multilib options
291 + -Dbacklight=$(meson_multilib)
292 + -Dbinfmt=$(meson_multilib)
293 + -Dcoredump=$(meson_multilib)
294 + -Denvironment-d=$(meson_multilib)
295 + -Dfirstboot=$(meson_multilib)
296 + -Dhibernate=$(meson_multilib)
297 + -Dhostnamed=$(meson_multilib)
298 + -Dhwdb=$(meson_multilib)
299 + -Dldconfig=$(meson_multilib)
300 + -Dlocaled=$(meson_multilib)
301 + -Dman=$(meson_multilib)
302 + -Dnetworkd=$(meson_multilib)
303 + -Dquotacheck=$(meson_multilib)
304 + -Drandomseed=$(meson_multilib)
305 + -Drfkill=$(meson_multilib)
306 + -Dsysusers=$(meson_multilib)
307 + -Dtimedated=$(meson_multilib)
308 + -Dtimesyncd=$(meson_multilib)
309 + -Dtmpfiles=$(meson_multilib)
310 + -Dvconsole=$(meson_multilib)
311 + )
312 +
313 + if multilib_is_native_abi && use idn; then
314 + myconf+=(
315 + -Dlibidn2=$(usex libidn2 true false)
316 + -Dlibidn=$(usex libidn2 false true)
317 + )
318 + else
319 + myconf+=(
320 + -Dlibidn2=false
321 + -Dlibidn=false
322 + )
323 + fi
324 +
325 + meson_src_configure "${myconf[@]}"
326 +}
327 +
328 +multilib_src_compile() {
329 + eninja
330 +}
331 +
332 +multilib_src_test() {
333 + unset DBUS_SESSION_BUS_ADDRESS XDG_RUNTIME_DIR
334 + eninja test
335 +}
336 +
337 +multilib_src_install() {
338 + DESTDIR="${D}" eninja install
339 +}
340 +
341 +multilib_src_install_all() {
342 + local rootprefix=$(usex split-usr '' /usr)
343 +
344 + # meson doesn't know about docdir
345 + mv "${ED}"/usr/share/doc/{systemd,${PF}} || die
346 +
347 + einstalldocs
348 + dodoc "${FILESDIR}"/nsswitch.conf
349 +
350 + if ! use resolvconf; then
351 + rm -f "${ED}${rootprefix}"/sbin/resolvconf || die
352 + fi
353 +
354 + if ! use sysv-utils; then
355 + rm "${ED}${rootprefix}"/sbin/{halt,init,poweroff,reboot,runlevel,shutdown,telinit} || die
356 + rm "${ED}"/usr/share/man/man1/init.1 || die
357 + rm "${ED}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 || die
358 + fi
359 +
360 + if ! use resolvconf && ! use sysv-utils; then
361 + rmdir "${ED}${rootprefix}"/sbin || die
362 + fi
363 +
364 + # Preserve empty dirs in /etc & /var, bug #437008
365 + keepdir /etc/{binfmt.d,modules-load.d,tmpfiles.d}
366 + keepdir /etc/systemd/{ntp-units.d,user} /var/lib/systemd
367 + keepdir /etc/udev/{hwdb.d,rules.d}
368 + keepdir /var/log/journal/remote
369 +
370 + # Symlink /etc/sysctl.conf for easy migration.
371 + dosym ../sysctl.conf /etc/sysctl.d/99-sysctl.conf
372 +
373 + # If we install these symlinks, there is no way for the sysadmin to remove them
374 + # permanently.
375 + rm -f "${ED}"/etc/systemd/system/multi-user.target.wants/systemd-networkd.service || die
376 + rm -f "${ED}"/etc/systemd/system/dbus-org.freedesktop.network1.service || die
377 + rm -f "${ED}"/etc/systemd/system/multi-user.target.wants/systemd-resolved.service || die
378 + rm -f "${ED}"/etc/systemd/system/dbus-org.freedesktop.resolve1.service || die
379 + rm -fr "${ED}"/etc/systemd/system/network-online.target.wants || die
380 + rm -fr "${ED}"/etc/systemd/system/sockets.target.wants || die
381 + rm -fr "${ED}"/etc/systemd/system/sysinit.target.wants || die
382 +
383 + local udevdir=/lib/udev
384 + use split-usr || udevdir=/usr/lib/udev
385 +
386 + rm -r "${ED}${udevdir}/hwdb.d" || die
387 +
388 + if use split-usr; then
389 + # Avoid breaking boot/reboot
390 + dosym ../../../lib/systemd/systemd /usr/lib/systemd/systemd
391 + dosym ../../../lib/systemd/systemd-shutdown /usr/lib/systemd/systemd-shutdown
392 + fi
393 +}
394 +
395 +migrate_locale() {
396 + local envd_locale_def="${EROOT}/etc/env.d/02locale"
397 + local envd_locale=( "${EROOT}"/etc/env.d/??locale )
398 + local locale_conf="${EROOT}/etc/locale.conf"
399 +
400 + if [[ ! -L ${locale_conf} && ! -e ${locale_conf} ]]; then
401 + # If locale.conf does not exist...
402 + if [[ -e ${envd_locale} ]]; then
403 + # ...either copy env.d/??locale if there's one
404 + ebegin "Moving ${envd_locale} to ${locale_conf}"
405 + mv "${envd_locale}" "${locale_conf}"
406 + eend ${?} || FAIL=1
407 + else
408 + # ...or create a dummy default
409 + ebegin "Creating ${locale_conf}"
410 + cat > "${locale_conf}" <<-EOF
411 + # This file has been created by the sys-apps/systemd ebuild.
412 + # See locale.conf(5) and localectl(1).
413 +
414 + # LANG=${LANG}
415 + EOF
416 + eend ${?} || FAIL=1
417 + fi
418 + fi
419 +
420 + if [[ ! -L ${envd_locale} ]]; then
421 + # now, if env.d/??locale is not a symlink (to locale.conf)...
422 + if [[ -e ${envd_locale} ]]; then
423 + # ...warn the user that he has duplicate locale settings
424 + ewarn
425 + ewarn "To ensure consistent behavior, you should replace ${envd_locale}"
426 + ewarn "with a symlink to ${locale_conf}. Please migrate your settings"
427 + ewarn "and create the symlink with the following command:"
428 + ewarn "ln -s -n -f ../locale.conf ${envd_locale}"
429 + ewarn
430 + else
431 + # ...or just create the symlink if there's nothing here
432 + ebegin "Creating ${envd_locale_def} -> ../locale.conf symlink"
433 + ln -n -s ../locale.conf "${envd_locale_def}"
434 + eend ${?} || FAIL=1
435 + fi
436 + fi
437 +}
438 +
439 +pkg_postinst() {
440 + newusergroup() {
441 + enewgroup "$1"
442 + enewuser "$1" -1 -1 -1 "$1"
443 + }
444 +
445 + enewgroup input
446 + enewgroup kvm 78
447 + enewgroup render
448 + enewgroup systemd-journal
449 + newusergroup systemd-bus-proxy
450 + newusergroup systemd-coredump
451 + newusergroup systemd-journal-gateway
452 + newusergroup systemd-journal-remote
453 + newusergroup systemd-journal-upload
454 + newusergroup systemd-network
455 + newusergroup systemd-resolve
456 + newusergroup systemd-timesync
457 +
458 + systemd_update_catalog
459 +
460 + # Keep this here in case the database format changes so it gets updated
461 + # when required. Despite that this file is owned by sys-apps/hwids.
462 + if has_version "sys-apps/hwids[udev]"; then
463 + udevadm hwdb --update --root="${EROOT}"
464 + fi
465 +
466 + udev_reload || FAIL=1
467 +
468 + # Bug 465468, make sure locales are respect, and ensure consistency
469 + # between OpenRC & systemd
470 + migrate_locale
471 +
472 + systemd_reenable systemd-networkd.service systemd-resolved.service
473 +
474 + if [[ -z ${ROOT} && -d /run/systemd/system ]]; then
475 + ebegin "Reexecuting system manager"
476 + systemctl daemon-reexec
477 + eend $?
478 + fi
479 +
480 + if [[ ${FAIL} ]]; then
481 + eerror "One of the postinst commands failed. Please check the postinst output"
482 + eerror "for errors. You may need to clean up your system and/or try installing"
483 + eerror "systemd again."
484 + eerror
485 + fi
486 +}
487 +
488 +pkg_prerm() {
489 + # If removing systemd completely, remove the catalog database.
490 + if [[ ! ${REPLACED_BY_VERSION} ]]; then
491 + rm -f -v "${EROOT}"/var/lib/systemd/catalog/database
492 + fi
493 +}