From df6e16fbe618b90174e9d19d414f9ee367c510bd Mon Sep 17 00:00:00 2001 From: Mike Gilbert Date: Fri, 27 Feb 2015 20:42:56 +0000 Subject: Re-add the audit patch. Package-Manager: portage-2.2.17/cvs/Linux x86_64 Manifest-Sign-Key: 0x0BBEEA1FEA4843A4 --- sys-apps/systemd/ChangeLog | 8 +- sys-apps/systemd/Manifest | 10 +- sys-apps/systemd/systemd-219-r1.ebuild | 485 +++++++++++++++++++++++++++++++++ sys-apps/systemd/systemd-219.ebuild | 483 -------------------------------- 4 files changed, 497 insertions(+), 489 deletions(-) create mode 100644 sys-apps/systemd/systemd-219-r1.ebuild delete mode 100644 sys-apps/systemd/systemd-219.ebuild (limited to 'sys-apps') diff --git a/sys-apps/systemd/ChangeLog b/sys-apps/systemd/ChangeLog index 781de29e2c79..d27570da3613 100644 --- a/sys-apps/systemd/ChangeLog +++ b/sys-apps/systemd/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for sys-apps/systemd # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/systemd/ChangeLog,v 1.351 2015/02/20 16:13:22 floppym Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/systemd/ChangeLog,v 1.352 2015/02/27 20:42:49 floppym Exp $ + +*systemd-219-r1 (27 Feb 2015) + + 27 Feb 2015; Mike Gilbert +systemd-219-r1.ebuild, + -systemd-219.ebuild: + Re-add the audit patch. 20 Feb 2015; Mike Gilbert systemd-219.ebuild, systemd-9999.ebuild: diff --git a/sys-apps/systemd/Manifest b/sys-apps/systemd/Manifest index 2564ab530df5..3739505f66e7 100644 --- a/sys-apps/systemd/Manifest +++ b/sys-apps/systemd/Manifest @@ -16,14 +16,14 @@ EBUILD systemd-215-r3.ebuild 16088 SHA256 29066774eada0721a1c48aa49273ce79052f76 EBUILD systemd-216-r3.ebuild 16098 SHA256 55145bcee79b532010ca729b24d113e1db52382ce5dd6ce9dfb78d081e244f3b SHA512 e8b4bdade44306672a7312e7c4f88e914f7686b41e9d81066a4285bc4600114cd8d340bbe3d5295e1856a3caa831c6c66f54cf5b3296a4bf5837bc696910bc21 WHIRLPOOL 979355b007ab513b60952f6e0bc0786c819f14f7d4b0eb077ab6715ba518df5f9b579ad672d8b311c7955ee4a6842f8932e93c6d50e9524c438ae8258c056efb EBUILD systemd-216-r4.ebuild 16027 SHA256 c95f0d46695377e552be65a5037bf101de264246ffb82b1ca322b6b3015f4bdd SHA512 eee0e7dd2b913991137673a87d185a440a7b3ac0da66b844a77dc1845740a215409ac7c798d825fa160d1a116d9171cdee96d7d7ccc69fa00fc004a0d0f5b63e WHIRLPOOL 22aa0778741fa5a14f60ac0d91c9d80c4b94d9c880bac92fb531fbb5b9f1fb61061ca6b3253c2b500989e6eae1c1a72adbd7d3a1d228dd18880e0cdd4428eb48 EBUILD systemd-218-r3.ebuild 15068 SHA256 200897ae4bc92789be51ef6c2bb9436577715cf862432d40255856493d67cbf5 SHA512 8353c8e3e80cadefc254ef1582cef44ab175cd4237e2e5abf123f11db238f73f8ee5b8049c36f1bd3f8127ad1aa3e48b6b8533c72139065063fa6986c916fabf WHIRLPOOL bf464c79603b12855d093c52ccdf78aff98b1c71d22d158c6f65785add2336e46a863e4b29ac56892952ee5888bf9a7b192c862b2aa7e7f9918b17ed539b5760 -EBUILD systemd-219.ebuild 15177 SHA256 5f3e7d305ae4ac09d66ef7a75da38d1f8434801d7f0f3cb008d6c230be6cc362 SHA512 0740ecc99b6cb0c43e025398e939abf40cc2a54d87f0f365dd2b0145474c4a9da2c4e59f5d7446c41760657da14332989664f604383764bf1846788c346e8516 WHIRLPOOL 4aef5e61df398b8aea684e08bbe324ddfc2439306d4bb5bc52b262775bc1a6c6cea55510a6ecb06ef0155fdbf7364d3bec4752275bc1650f35faa564b933b464 +EBUILD systemd-219-r1.ebuild 15246 SHA256 fc237f42b1565304eb47a314a1c2ef146901d3d566b4e5764e165adaa637e683 SHA512 ba766a1cf56b26eec5d0524dfcb08f572c2b4537db40be51e7c18ab9553e014f3c2da62822ecd998d1b2b427f1d32c53406eafac1166d3a0721c6b851827e2a8 WHIRLPOOL 055ced4cedd0eb3adabf86dc09da6effadec256410a50e9182a1427fc89aa605e3fd7683317bfed2f454fa83ff7594e60daac8104135f807f3cd235b0af36db0 EBUILD systemd-9999.ebuild 15691 SHA256 f2b56cabd7cd0f97ff00a67515abbd5bdd9422b3d7c41b963036e048c81bf24b SHA512 7eb3f684ed49a90b19ccd213dbfcbacb78ee5d4e437b1337a9d2a393fda8b09b6826d211cfbb4272fcf87d4cf6ebf29372698326d6cb95fd11b10f75771a308e WHIRLPOOL 037482811aff70ce7e6329176b55de34c093db4d8b4af92dedfc087f4f95adda49ec2413694c9852962b859716f172705180feaf6cedec564feed26949c8c7eb -MISC ChangeLog 62503 SHA256 4c722ecc20fe7c4386c56702860f5be6ae31b7274fe8e1fbedf3e61365cda935 SHA512 f3cf06949a440363760a6824cee05ef8d16c4c70b5d9e25bc276547b60bbbb0bd666fde05441baa9281bacc928ef9b73b952e553f32d36aca4ffb42dde45e6fe WHIRLPOOL 7f9ba18200f8bd90b7a3d89fe2e46508bcdbdfd107493167950d8bf7b991b3f591c9e3bbf0baba863f2e7f86ef297cf29980457262228bbb8b01b0be5135cb43 +MISC ChangeLog 62657 SHA256 e559e33e2f00a57f3d95edd8778642831509983a3713771b626b154f1e9bdfbb SHA512 af05541bbc5287aab14dced9e2c5bada0a40e9ec586a044d6ebfa24894c8d750b7f5d95e483316b4f972c09672e1ec3971830a53274206a97d6c533636b62c50 WHIRLPOOL 11e0815e8726ecdd6a08beffde95ad702363589cee79231e8af435a3a45e3977c0d4c8a33bcd28d3f0c5df8eb2e30b02cbbd6ca29c27e203bc1f9114b19a9710 MISC metadata.xml 2101 SHA256 7e794d3e7e47f6667e0efd52d41b1a4b7f41651aa04b275f54cf37b3693871e7 SHA512 8ecafee5b1958903f23f4c0aea110c2cc5e67562a79ed89858a3248f278af04645e98b3cedc12a9f09d1618754c3cb562c4f412460e8fdc9db0e6a17a6a7a4ea WHIRLPOOL 529ebe41470c553daf73969f51ad22eb25a9ebd7cfc52648b019ca8e055c392c5c433642221c78429251f0991bae3ff65dae2d046b5376a5374e61bc4a5ab450 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 -iF4EAREIAAYFAlTnXSYACgkQC77qH+pIQ6TuwwD/ZtY2Ry9VwvwC++ugnk0G9Zvu -XA10H+VTYva28GK/HIEA/AyO9NEEIeR+DQGL7HlZXr3PpDYx3gSKV5dTvLN8E+0F -=YL3g +iF4EAREIAAYFAlTw1s8ACgkQC77qH+pIQ6SKJAEAqtWIr68dFScgy/ONx1stbQIR +r8KXB4OSfaXiFIuz3LoA/3VcIjAtw6Vvm16A5+K1eojOvlcw2EU/rIVLmozjZBBL +=27ge -----END PGP SIGNATURE----- diff --git a/sys-apps/systemd/systemd-219-r1.ebuild b/sys-apps/systemd/systemd-219-r1.ebuild new file mode 100644 index 000000000000..c29be3777ece --- /dev/null +++ b/sys-apps/systemd/systemd-219-r1.ebuild @@ -0,0 +1,485 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/systemd/systemd-219-r1.ebuild,v 1.1 2015/02/27 20:42:49 floppym Exp $ + +EAPI=5 + +AUTOTOOLS_PRUNE_LIBTOOL_FILES=all +PYTHON_COMPAT=( python{2_7,3_2,3_3,3_4} ) +inherit autotools-utils bash-completion-r1 linux-info multilib \ + multilib-minimal pam python-single-r1 systemd toolchain-funcs udev \ + user + +DESCRIPTION="System and service manager for Linux" +HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd" +SRC_URI="http://www.freedesktop.org/software/systemd/${P}.tar.xz" + +LICENSE="GPL-2 LGPL-2.1 MIT public-domain" +SLOT="0/2" +KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86" +IUSE="acl apparmor audit cryptsetup curl doc elfutils gcrypt gudev http + idn importd introspection kdbus +kmod +lz4 lzma nat pam policykit python + qrcode +seccomp selinux ssl sysv-utils terminal test vanilla xkb" +REQUIRED_USE="importd? ( curl gcrypt lzma )" + +MINKV="3.8" + +COMMON_DEPEND=">=sys-apps/util-linux-2.25:0= + sys-libs/libcap:0= + acl? ( sys-apps/acl:0= ) + apparmor? ( sys-libs/libapparmor:0= ) + audit? ( >=sys-process/audit-2:0= ) + cryptsetup? ( >=sys-fs/cryptsetup-1.6:0= ) + curl? ( net-misc/curl:0= ) + elfutils? ( >=dev-libs/elfutils-0.158:0= ) + gcrypt? ( >=dev-libs/libgcrypt-1.4.5:0=[${MULTILIB_USEDEP}] ) + gudev? ( >=dev-libs/glib-2.34.3:2=[${MULTILIB_USEDEP}] ) + http? ( + >=net-libs/libmicrohttpd-0.9.33:0= + ssl? ( >=net-libs/gnutls-3.1.4:0= ) + ) + idn? ( net-dns/libidn:0= ) + importd? ( + app-arch/bzip2:0= + sys-libs/zlib:0= + ) + introspection? ( >=dev-libs/gobject-introspection-1.31.1:0= ) + kmod? ( >=sys-apps/kmod-15:0= ) + lz4? ( >=app-arch/lz4-0_p119:0=[${MULTILIB_USEDEP}] ) + lzma? ( >=app-arch/xz-utils-5.0.5-r1:0=[${MULTILIB_USEDEP}] ) + nat? ( net-firewall/iptables:0= ) + pam? ( virtual/pam:= ) + python? ( ${PYTHON_DEPS} ) + qrcode? ( media-gfx/qrencode:0= ) + seccomp? ( sys-libs/libseccomp:0= ) + selinux? ( sys-libs/libselinux:0= ) + sysv-utils? ( + !sys-apps/systemd-sysv-utils + !sys-apps/sysvinit ) + terminal? ( >=dev-libs/libevdev-1.2:0= + >=x11-libs/libxkbcommon-0.5:0= + >=x11-libs/libdrm-2.4:0= ) + xkb? ( >=x11-libs/libxkbcommon-0.4.1:0= ) + abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r9 + !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )" + +# baselayout-2.2 has /run +RDEPEND="${COMMON_DEPEND} + >=sys-apps/baselayout-2.2 + !sys-auth/nss-myhostname + !=sys-apps/dbus-1.8.8 if/when this is dropped. + local pcfiles=( src/compat-libs/libsystemd-{daemon,id128,journal,login}.pc ) + emake "${mymakeopts[@]}" install-pkgconfiglibDATA \ + pkgconfiglib_DATA="${pcfiles[*]}" +} + +multilib_src_install_all() { + prune_libtool_files --modules + einstalldocs + + if use sysv-utils; then + for app in halt poweroff reboot runlevel shutdown telinit; do + dosym "..${ROOTPREFIX-/usr}/bin/systemctl" /sbin/${app} + done + dosym "..${ROOTPREFIX-/usr}/lib/systemd/systemd" /sbin/init + else + # we just keep sysvinit tools, so no need for the mans + rm "${D}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 \ + || die + rm "${D}"/usr/share/man/man1/init.1 || die + fi + + # Disable storing coredumps in journald, bug #433457 + mv "${D}"/usr/lib/sysctl.d/50-coredump.conf{,.disabled} || die + + # Preserve empty dirs in /etc & /var, bug #437008 + keepdir /etc/binfmt.d /etc/modules-load.d /etc/tmpfiles.d \ + /etc/systemd/ntp-units.d /etc/systemd/user /var/lib/systemd \ + /var/log/journal/remote + + # Symlink /etc/sysctl.conf for easy migration. + dosym ../sysctl.conf /etc/sysctl.d/99-sysctl.conf + + # If we install these symlinks, there is no way for the sysadmin to remove them + # permanently. + rm "${D}"/etc/systemd/system/multi-user.target.wants/systemd-networkd.service || die + rm "${D}"/etc/systemd/system/multi-user.target.wants/systemd-resolved.service || die + rm -r "${D}"/etc/systemd/system/network-online.target.wants || die + rm -r "${D}"/etc/systemd/system/sysinit.target.wants || die +} + +migrate_locale() { + local envd_locale_def="${EROOT%/}/etc/env.d/02locale" + local envd_locale=( "${EROOT%/}"/etc/env.d/??locale ) + local locale_conf="${EROOT%/}/etc/locale.conf" + + if [[ ! -L ${locale_conf} && ! -e ${locale_conf} ]]; then + # If locale.conf does not exist... + if [[ -e ${envd_locale} ]]; then + # ...either copy env.d/??locale if there's one + ebegin "Moving ${envd_locale} to ${locale_conf}" + mv "${envd_locale}" "${locale_conf}" + eend ${?} || FAIL=1 + else + # ...or create a dummy default + ebegin "Creating ${locale_conf}" + cat > "${locale_conf}" <<-EOF + # This file has been created by the sys-apps/systemd ebuild. + # See locale.conf(5) and localectl(1). + + # LANG=${LANG} + EOF + eend ${?} || FAIL=1 + fi + fi + + if [[ ! -L ${envd_locale} ]]; then + # now, if env.d/??locale is not a symlink (to locale.conf)... + if [[ -e ${envd_locale} ]]; then + # ...warn the user that he has duplicate locale settings + ewarn + ewarn "To ensure consistent behavior, you should replace ${envd_locale}" + ewarn "with a symlink to ${locale_conf}. Please migrate your settings" + ewarn "and create the symlink with the following command:" + ewarn "ln -s -n -f ../locale.conf ${envd_locale}" + ewarn + else + # ...or just create the symlink if there's nothing here + ebegin "Creating ${envd_locale_def} -> ../locale.conf symlink" + ln -n -s ../locale.conf "${envd_locale_def}" + eend ${?} || FAIL=1 + fi + fi +} + +migrate_net_name_slot() { + # If user has disabled 80-net-name-slot.rules using a empty file or a symlink to /dev/null, + # do the same for 80-net-setup-link.rules to keep the old behavior + local net_move=no + local net_name_slot_sym=no + local net_rules_path="${EROOT%/}"/etc/udev/rules.d + local net_name_slot="${net_rules_path}"/80-net-name-slot.rules + local net_setup_link="${net_rules_path}"/80-net-setup-link.rules + if [[ -e ${net_setup_link} ]]; then + net_move=no + elif [[ -f ${net_name_slot} && $(sed -e "/^#/d" -e "/^\W*$/d" ${net_name_slot} | wc -l) == 0 ]]; then + net_move=yes + elif [[ -L ${net_name_slot} && $(readlink ${net_name_slot}) == /dev/null ]]; then + net_move=yes + net_name_slot_sym=yes + fi + if [[ ${net_move} == yes ]]; then + ebegin "Copying ${net_name_slot} to ${net_setup_link}" + + if [[ ${net_name_slot_sym} == yes ]]; then + ln -nfs /dev/null "${net_setup_link}" + else + cp "${net_name_slot}" "${net_setup_link}" + fi + eend $? || FAIL=1 + fi +} + +pkg_postinst() { + newusergroup() { + enewgroup "$1" + enewuser "$1" -1 -1 -1 "$1" + } + + enewgroup input + enewgroup systemd-journal + newusergroup systemd-bus-proxy + newusergroup systemd-journal-gateway + newusergroup systemd-journal-remote + newusergroup systemd-journal-upload + newusergroup systemd-network + newusergroup systemd-resolve + newusergroup systemd-timesync + use http && newusergroup systemd-journal-gateway + + systemd_update_catalog + + # Keep this here in case the database format changes so it gets updated + # when required. Despite that this file is owned by sys-apps/hwids. + if has_version "sys-apps/hwids[udev]"; then + udevadm hwdb --update --root="${ROOT%/}" + fi + + udev_reload || FAIL=1 + + # Bug 465468, make sure locales are respect, and ensure consistency + # between OpenRC & systemd + migrate_locale + + # Migrate 80-net-name-slot.rules -> 80-net-setup-link.rules + migrate_net_name_slot + + if [[ ${FAIL} ]]; then + eerror "One of the postinst commands failed. Please check the postinst output" + eerror "for errors. You may need to clean up your system and/or try installing" + eerror "systemd again." + eerror + fi + + if [[ ! -L "${ROOT}"/etc/mtab ]]; then + ewarn "Upstream mandates the /etc/mtab file should be a symlink to /proc/mounts." + ewarn "Not having it is not supported by upstream and will cause tools like 'df'" + ewarn "and 'mount' to not work properly. Please run:" + ewarn " # ln -sf '${ROOT}proc/self/mounts' '${ROOT}etc/mtab'" + ewarn + fi + + if [[ $(readlink "${ROOT}"/etc/resolv.conf) == */run/systemd/network/resolv.conf ]]; then + ewarn "resolv.conf is now generated by systemd-resolved. To use it, enable" + ewarn "systemd-resolved.service, and create a symlink from /etc/resolv.conf" + ewarn "to /run/systemd/resolve/resolv.conf" + ewarn + fi + + if ! has_version sys-apps/systemd-ui; then + elog "To get additional features, a number of optional runtime dependencies may" + elog "be installed:" + elog "- sys-apps/systemd-ui: for GTK+ systemadm UI and gnome-ask-password-agent" + fi + + if has_version sys-apps/openrc && + ! has_version sys-fs/udev-init-scripts; then + elog "If you plan to boot using OpenRC and udev or eudev, you" + elog "need to install the udev-init-scripts package." + fi +} + +pkg_prerm() { + # If removing systemd completely, remove the catalog database. + if [[ ! ${REPLACED_BY_VERSION} ]]; then + rm -f -v "${EROOT}"/var/lib/systemd/catalog/database + fi +} diff --git a/sys-apps/systemd/systemd-219.ebuild b/sys-apps/systemd/systemd-219.ebuild deleted file mode 100644 index cd066882cda7..000000000000 --- a/sys-apps/systemd/systemd-219.ebuild +++ /dev/null @@ -1,483 +0,0 @@ -# Copyright 1999-2015 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/systemd/systemd-219.ebuild,v 1.2 2015/02/20 16:13:22 floppym Exp $ - -EAPI=5 - -AUTOTOOLS_PRUNE_LIBTOOL_FILES=all -PYTHON_COMPAT=( python{2_7,3_2,3_3,3_4} ) -inherit autotools-utils bash-completion-r1 linux-info multilib \ - multilib-minimal pam python-single-r1 systemd toolchain-funcs udev \ - user - -DESCRIPTION="System and service manager for Linux" -HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd" -SRC_URI="http://www.freedesktop.org/software/systemd/${P}.tar.xz" - -LICENSE="GPL-2 LGPL-2.1 MIT public-domain" -SLOT="0/2" -KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86" -IUSE="acl apparmor audit cryptsetup curl doc elfutils gcrypt gudev http - idn importd introspection kdbus +kmod +lz4 lzma nat pam policykit python - qrcode +seccomp selinux ssl sysv-utils terminal test vanilla xkb" -REQUIRED_USE="importd? ( curl gcrypt lzma )" - -MINKV="3.8" - -COMMON_DEPEND=">=sys-apps/util-linux-2.25:0= - sys-libs/libcap:0= - acl? ( sys-apps/acl:0= ) - apparmor? ( sys-libs/libapparmor:0= ) - audit? ( >=sys-process/audit-2:0= ) - cryptsetup? ( >=sys-fs/cryptsetup-1.6:0= ) - curl? ( net-misc/curl:0= ) - elfutils? ( >=dev-libs/elfutils-0.158:0= ) - gcrypt? ( >=dev-libs/libgcrypt-1.4.5:0=[${MULTILIB_USEDEP}] ) - gudev? ( >=dev-libs/glib-2.34.3:2=[${MULTILIB_USEDEP}] ) - http? ( - >=net-libs/libmicrohttpd-0.9.33:0= - ssl? ( >=net-libs/gnutls-3.1.4:0= ) - ) - idn? ( net-dns/libidn:0= ) - importd? ( - app-arch/bzip2:0= - sys-libs/zlib:0= - ) - introspection? ( >=dev-libs/gobject-introspection-1.31.1:0= ) - kmod? ( >=sys-apps/kmod-15:0= ) - lz4? ( >=app-arch/lz4-0_p119:0=[${MULTILIB_USEDEP}] ) - lzma? ( >=app-arch/xz-utils-5.0.5-r1:0=[${MULTILIB_USEDEP}] ) - nat? ( net-firewall/iptables:0= ) - pam? ( virtual/pam:= ) - python? ( ${PYTHON_DEPS} ) - qrcode? ( media-gfx/qrencode:0= ) - seccomp? ( sys-libs/libseccomp:0= ) - selinux? ( sys-libs/libselinux:0= ) - sysv-utils? ( - !sys-apps/systemd-sysv-utils - !sys-apps/sysvinit ) - terminal? ( >=dev-libs/libevdev-1.2:0= - >=x11-libs/libxkbcommon-0.5:0= - >=x11-libs/libdrm-2.4:0= ) - xkb? ( >=x11-libs/libxkbcommon-0.4.1:0= ) - abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r9 - !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )" - -# baselayout-2.2 has /run -RDEPEND="${COMMON_DEPEND} - >=sys-apps/baselayout-2.2 - !sys-auth/nss-myhostname - !=sys-apps/dbus-1.8.8 if/when this is dropped. - local pcfiles=( src/compat-libs/libsystemd-{daemon,id128,journal,login}.pc ) - emake "${mymakeopts[@]}" install-pkgconfiglibDATA \ - pkgconfiglib_DATA="${pcfiles[*]}" -} - -multilib_src_install_all() { - prune_libtool_files --modules - einstalldocs - - if use sysv-utils; then - for app in halt poweroff reboot runlevel shutdown telinit; do - dosym "..${ROOTPREFIX-/usr}/bin/systemctl" /sbin/${app} - done - dosym "..${ROOTPREFIX-/usr}/lib/systemd/systemd" /sbin/init - else - # we just keep sysvinit tools, so no need for the mans - rm "${D}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 \ - || die - rm "${D}"/usr/share/man/man1/init.1 || die - fi - - # Disable storing coredumps in journald, bug #433457 - mv "${D}"/usr/lib/sysctl.d/50-coredump.conf{,.disabled} || die - - # Preserve empty dirs in /etc & /var, bug #437008 - keepdir /etc/binfmt.d /etc/modules-load.d /etc/tmpfiles.d \ - /etc/systemd/ntp-units.d /etc/systemd/user /var/lib/systemd \ - /var/log/journal/remote - - # Symlink /etc/sysctl.conf for easy migration. - dosym ../sysctl.conf /etc/sysctl.d/99-sysctl.conf - - # If we install these symlinks, there is no way for the sysadmin to remove them - # permanently. - rm "${D}"/etc/systemd/system/multi-user.target.wants/systemd-networkd.service || die - rm "${D}"/etc/systemd/system/multi-user.target.wants/systemd-resolved.service || die - rm -r "${D}"/etc/systemd/system/network-online.target.wants || die - rm -r "${D}"/etc/systemd/system/sysinit.target.wants || die -} - -migrate_locale() { - local envd_locale_def="${EROOT%/}/etc/env.d/02locale" - local envd_locale=( "${EROOT%/}"/etc/env.d/??locale ) - local locale_conf="${EROOT%/}/etc/locale.conf" - - if [[ ! -L ${locale_conf} && ! -e ${locale_conf} ]]; then - # If locale.conf does not exist... - if [[ -e ${envd_locale} ]]; then - # ...either copy env.d/??locale if there's one - ebegin "Moving ${envd_locale} to ${locale_conf}" - mv "${envd_locale}" "${locale_conf}" - eend ${?} || FAIL=1 - else - # ...or create a dummy default - ebegin "Creating ${locale_conf}" - cat > "${locale_conf}" <<-EOF - # This file has been created by the sys-apps/systemd ebuild. - # See locale.conf(5) and localectl(1). - - # LANG=${LANG} - EOF - eend ${?} || FAIL=1 - fi - fi - - if [[ ! -L ${envd_locale} ]]; then - # now, if env.d/??locale is not a symlink (to locale.conf)... - if [[ -e ${envd_locale} ]]; then - # ...warn the user that he has duplicate locale settings - ewarn - ewarn "To ensure consistent behavior, you should replace ${envd_locale}" - ewarn "with a symlink to ${locale_conf}. Please migrate your settings" - ewarn "and create the symlink with the following command:" - ewarn "ln -s -n -f ../locale.conf ${envd_locale}" - ewarn - else - # ...or just create the symlink if there's nothing here - ebegin "Creating ${envd_locale_def} -> ../locale.conf symlink" - ln -n -s ../locale.conf "${envd_locale_def}" - eend ${?} || FAIL=1 - fi - fi -} - -migrate_net_name_slot() { - # If user has disabled 80-net-name-slot.rules using a empty file or a symlink to /dev/null, - # do the same for 80-net-setup-link.rules to keep the old behavior - local net_move=no - local net_name_slot_sym=no - local net_rules_path="${EROOT%/}"/etc/udev/rules.d - local net_name_slot="${net_rules_path}"/80-net-name-slot.rules - local net_setup_link="${net_rules_path}"/80-net-setup-link.rules - if [[ -e ${net_setup_link} ]]; then - net_move=no - elif [[ -f ${net_name_slot} && $(sed -e "/^#/d" -e "/^\W*$/d" ${net_name_slot} | wc -l) == 0 ]]; then - net_move=yes - elif [[ -L ${net_name_slot} && $(readlink ${net_name_slot}) == /dev/null ]]; then - net_move=yes - net_name_slot_sym=yes - fi - if [[ ${net_move} == yes ]]; then - ebegin "Copying ${net_name_slot} to ${net_setup_link}" - - if [[ ${net_name_slot_sym} == yes ]]; then - ln -nfs /dev/null "${net_setup_link}" - else - cp "${net_name_slot}" "${net_setup_link}" - fi - eend $? || FAIL=1 - fi -} - -pkg_postinst() { - newusergroup() { - enewgroup "$1" - enewuser "$1" -1 -1 -1 "$1" - } - - enewgroup input - enewgroup systemd-journal - newusergroup systemd-bus-proxy - newusergroup systemd-journal-gateway - newusergroup systemd-journal-remote - newusergroup systemd-journal-upload - newusergroup systemd-network - newusergroup systemd-resolve - newusergroup systemd-timesync - use http && newusergroup systemd-journal-gateway - - systemd_update_catalog - - # Keep this here in case the database format changes so it gets updated - # when required. Despite that this file is owned by sys-apps/hwids. - if has_version "sys-apps/hwids[udev]"; then - udevadm hwdb --update --root="${ROOT%/}" - fi - - udev_reload || FAIL=1 - - # Bug 465468, make sure locales are respect, and ensure consistency - # between OpenRC & systemd - migrate_locale - - # Migrate 80-net-name-slot.rules -> 80-net-setup-link.rules - migrate_net_name_slot - - if [[ ${FAIL} ]]; then - eerror "One of the postinst commands failed. Please check the postinst output" - eerror "for errors. You may need to clean up your system and/or try installing" - eerror "systemd again." - eerror - fi - - if [[ ! -L "${ROOT}"/etc/mtab ]]; then - ewarn "Upstream mandates the /etc/mtab file should be a symlink to /proc/mounts." - ewarn "Not having it is not supported by upstream and will cause tools like 'df'" - ewarn "and 'mount' to not work properly. Please run:" - ewarn " # ln -sf '${ROOT}proc/self/mounts' '${ROOT}etc/mtab'" - ewarn - fi - - if [[ $(readlink "${ROOT}"/etc/resolv.conf) == */run/systemd/network/resolv.conf ]]; then - ewarn "resolv.conf is now generated by systemd-resolved. To use it, enable" - ewarn "systemd-resolved.service, and create a symlink from /etc/resolv.conf" - ewarn "to /run/systemd/resolve/resolv.conf" - ewarn - fi - - if ! has_version sys-apps/systemd-ui; then - elog "To get additional features, a number of optional runtime dependencies may" - elog "be installed:" - elog "- sys-apps/systemd-ui: for GTK+ systemadm UI and gnome-ask-password-agent" - fi - - if has_version sys-apps/openrc && - ! has_version sys-fs/udev-init-scripts; then - elog "If you plan to boot using OpenRC and udev or eudev, you" - elog "need to install the udev-init-scripts package." - fi -} - -pkg_prerm() { - # If removing systemd completely, remove the catalog database. - if [[ ! ${REPLACED_BY_VERSION} ]]; then - rm -f -v "${EROOT}"/var/lib/systemd/catalog/database - fi -} -- cgit v1.2.3-65-gdbad