diff options
author | V3n3RiX <venerix@koprulu.sector> | 2023-01-11 11:44:03 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2023-01-11 11:44:03 +0000 |
commit | df26c7469c1f2af2e643d43e2e32a6c9142e4885 (patch) | |
tree | 1beee9b11d06bfcc69d1d6c8ab00566f8633aec1 /sys-apps/systemd-utils | |
parent | ad391b961414c99124b93cb86695c04bd8d57937 (diff) |
gentoo auto-resync : 11:01:2023 - 11:44:03
Diffstat (limited to 'sys-apps/systemd-utils')
-rw-r--r-- | sys-apps/systemd-utils/Manifest | 7 | ||||
-rw-r--r-- | sys-apps/systemd-utils/files/251-meson-0.64.patch | 26 | ||||
-rw-r--r-- | sys-apps/systemd-utils/files/251-tmpfiles-ub.patch | 71 | ||||
-rw-r--r-- | sys-apps/systemd-utils/systemd-utils-251.10-r1.ebuild (renamed from sys-apps/systemd-utils/systemd-utils-251.9.ebuild) | 12 | ||||
-rw-r--r-- | sys-apps/systemd-utils/systemd-utils-251.7.ebuild | 527 |
5 files changed, 84 insertions, 559 deletions
diff --git a/sys-apps/systemd-utils/Manifest b/sys-apps/systemd-utils/Manifest index 63bb89a25b0c..f3e67a7c1d34 100644 --- a/sys-apps/systemd-utils/Manifest +++ b/sys-apps/systemd-utils/Manifest @@ -1,17 +1,14 @@ AUX 251-gpt-auto-no-cryptsetup.patch 958 BLAKE2B 7067224e613433fcb139c38597552e080e07d33b207965a9c9a2b3d4e353c43dae38e6800d6ce28cadcba5f914b1b49e80fa48929df2c4bb96248bfeb6bf6aa5 SHA512 6a78bbdde3aae9a2ad4c4f824eb5281ca9ab24770516ad7c9a9e3daf7f39475bf9b4dd868c857a9833dd408db801393f949b8fae1700b2ad04ea822dc84e3429 -AUX 251-meson-0.64.patch 919 BLAKE2B e9eb5f82235f60f18658e4a6a3bc262525cb3152f8b6953b38683c51d439ebebe215dc4b71935e4059e17d82a07bc9e0ffd1354453d5c6977c927d0ba8f52646 SHA512 2d331194071c6cd0c1e8cf3c50de71b3a06b65ec7cf03f0ced15f2d060dd1b0b252efd59604bc871a8b3bb60794cdafecd9ab01ca17f73d854fce77528cf3f4a AUX 251-revert-fortify-source-3-fix.patch 2059 BLAKE2B 5b34062821f2097fc622ffc66d83029267173b2b4131b29d9339644577b7e80c513c83f62d07ba3e030c2a861efe7d399bd871cc35803b39940f7ec0e7bacfec SHA512 14c5ac8d0343a4cb50de6c56124e515b159cf5f9bf358404ba41ec7a9c439206673e0d44888164ff3872236c7b8c74f5ea9544ea7a981a3b5930585dabcd4782 +AUX 251-tmpfiles-ub.patch 2892 BLAKE2B 0c65c90c0a631a48b7f3b8194350fb90e6915e0e7f32b0de87cfb83ca170f68576017efbe8a531fdeb01485ac6840a4c75628d1a384e750fc5094dff68dddcab SHA512 5c4fac1933a0b8443b80cff7069f21904773d486f30be24337f2b68234c708568ccd0f1ab216968ce71f760e4e27f85912971cdb9dd3ee724d7e6a2d8bc917d7 AUX 40-gentoo.rules 167 BLAKE2B 07116c6e5aab7de9fa8a88c6cdd9ad76a09d797d6f7bc3d0535c93ccf83486bbdae8f68d682714576b072a174df070505cce9c6f4b729e91a6f61ed89da72e8e SHA512 92e2be610839432f46cefab4d128825199dc9f2c5ef33119f9ff84dfe635ef56a4f7aaed64ba52ea2798868b00c3a1b7955caa33219aa298c6a2b8290181f94b AUX systemd-tmpfiles-clean 58 BLAKE2B 6a33f92a136218f3a27ea31e5cdd519706b15a3bba368f6f900d1d540f50493905a2cdab35ee3d216c9cb45e821251bfacc4965ad5a2ca7b1e1ae5627f4a3680 SHA512 3084eb1623b56cb09e4c9bd3e314a3e1d6d88f002149bea75b1c506a30b6345c51c7a90a1330baa5eec86ae6b90116f9970d8ff5add91929167df84bef6e82fe AUX systemd-tmpfiles-setup 329 BLAKE2B 7b4d801ec7c29a3d6073c47af8fa1c9fa670b3762c5358d0008ecf372e675e3f65cba3ea453d374c5e23453cfe32252421b69dff23aaeea636c611b960eb7b11 SHA512 cd7f7c69d1b1861cb4eac90d44579361e365ee77906376b6124ff79ba1c0d414b8891ffca19e715585d7400bddc5e9ad973f191125039a4a2c37acb95a111c37 AUX systemd-tmpfiles-setup-dev 342 BLAKE2B 95956e57d4f2aa10a09f23c08045ceed6fac3c569ee604a83707310f074740a41832d2e3fa3b528a3816202132e18be50ce40dbcded9430031ed9a2a172d3187 SHA512 3c5e29fc5bc2829984458149de1186075eec48775983376a8b47da162cbf4892754f19a3b277170f8b759a862bb5d910789da1db2bbf8447d6dacccb411be222 DIST systemd-musl-patches-251.2.tar.gz 28512 BLAKE2B 4ac6a5220dab8409962a3954af2fb2484af718d0f282129957236ce241fbe8538a90d507a96c7c3d86f4f408ab784a6888b37486405d3276e7734a1bd5aa9680 SHA512 6e56b62234ac54929faea5a7cad699d0b932f869b48e3ba4e1f349a88653b7c787efec24a09b00290c3dc566614e3c1dc2f3c04f04e943f513108a91eca1be82 DIST systemd-stable-251.10.tar.gz 11461671 BLAKE2B a351b6dd9fc307e4bdcf0323b16e7f58c714392cfa466180a81196309c289b54767bfe5d03037eb1bd6b273d7eb8f6f42b927aabaa1310be04266675d1a3dd06 SHA512 49e33dbbc1b2ebe123b2f722070c87524b3126d1e605fb3e24a3f9f328ab67de506dc4588a92caf157428c21b9c73c3884726c4a5b1f67bb997d4a68bb871e5b -DIST systemd-stable-251.7.tar.gz 11448429 BLAKE2B 959ac7944d778c8e6d7a3c67ea6adc89e5e7ac1cc3b163e2af2a582211b91316da5ffba37b854978b7b2a5b3f9aae3651701a23e4391da6676e078747df1a37b SHA512 a4c06b2d25c47af58abb1e1dc85737b2fb0eb394f09d2bb7c6b7b716cb4b1383a145885bbc8e5ffcdc26611fd44d362fba2152c4dd0ead6a03a93965b82bb9a4 DIST systemd-stable-251.8.tar.gz 11457551 BLAKE2B d4ca799a5b22164362fa8948bbec95215d6ebc04380f13f755916c4bfd4e1cc43a82177c21d2c56aa9d8440b44872b773f21682fc127c7f6d2b3542661c27d80 SHA512 c337fad3cf2beef11401850ddd6418efef035d4ec6405049084302738042f77ac1f8bfd7eb3611668a13038878389c9617e63278ec0b37782b3e0242e69c4843 -DIST systemd-stable-251.9.tar.gz 11461131 BLAKE2B ba8fa2d70cc992ded3d1aa354e36d9815c6ae87a6f438f8879771e9e5ae9f7d10591956cf8c617ba0c5c13fdc229bc23a7ea173aa9849bfdf6476cc0721d62be SHA512 27df2076445a826911274101286a3555528ebd0894a5c32f2dea71a075b5fcde3931f4d04f5726c5b39d482357939d2fbd2b52ac9a894b6853f48833984f4c17 +EBUILD systemd-utils-251.10-r1.ebuild 12423 BLAKE2B 26170b02154980fc7f13728279b20a658c2aeaf4c2f8547aa2ad3646934ec23eba0b9c86ddce39f02f5e64e7020f107b52dcdac043773bc593a2e14b164f7edf SHA512 0d1ef8059508fefaf676420282b43e777ef15c3a95e8c334f44538c19a6b0f5741ffb739344a4e7814323b3ae3bf7794295c29e827d9efb22961324f2d136e5f EBUILD systemd-utils-251.10.ebuild 11958 BLAKE2B 8d0b1810a80db25f5f8010e1960a5d332f899dacd8d2b3cf194c586188a46e4ddbcae441aefa2cf520bd220cf65c57ccc53859a82f1d931087d0ddde7d844936 SHA512 22f2b1ea22dc193340f64c9908c3341e810c87ce81dc94bb701e3fc9bf2090444d36e1471ff6ed07fae1e8daa11c4d3e5297bc02b95d6c288b9f742e41ae00f7 -EBUILD systemd-utils-251.7.ebuild 12136 BLAKE2B 2f408ed102c3665bfa2f29272dc95a138f7ac34d8f28be72c6fbafea60da14ebb0a2331adb0a1405fe4792582800dfb80c5e296a4894e0a141a17d1503084e04 SHA512 148ab4d8aa2d22fc1e16ce46d09a3f00cc88a3db245fee4fda57634e20cf3bcd4d97167fcef6f2381171ccb0be8de70580c06495ee95df2ff6c746fb08ba1e94 EBUILD systemd-utils-251.8-r1.ebuild 11946 BLAKE2B 9c1d6cd8394a63cfd56bb2f12c9f3db971d023939281cef9af458e3ea98122f82d447699a0ca4b535bd75ebc5b29e461dfa266bd25f05cd10fea06e306db1317 SHA512 ddf219d94c48781c00639abc73ace2177bdff9ec4d32ffa3926fb5d4b4ed23d0a2d2beebadd9eba0e5a9da067eb40e3ec637ebb277b67670a52034e9e9b5449f -EBUILD systemd-utils-251.9.ebuild 11954 BLAKE2B 81aa07ef9fadf86b368d447f4f71e03f9aa481e9b5a8ef11458a39ad558338742b7350c6eacbe4521b02352192dd351ba7b44cd6192939cb834439fce59143eb SHA512 7e9f86f068521089966b7b91f11e2028cd107d0349b7f579839bd6be7abe920f7cbb00ef55bd97a67d5c7b676e5cbc39200fdd860ec34d654b33e75ca8f6c404 MISC metadata.xml 713 BLAKE2B 1dcb5d9949600c9a8c8ac0c005ffa03b2ca91293a932fa96092a24c094e9fb29f2cf063af041432c12daec4aa4e60d11ea77ed0a423e188095f995c68e75b91a SHA512 46d167a6d898abfc56130e373d232c18fb3ef8865755379fa7678c049515458e7354b7a8cab3bf3faa7326932cccceb0b0745b4695ab9bea492bc2344abf9da4 diff --git a/sys-apps/systemd-utils/files/251-meson-0.64.patch b/sys-apps/systemd-utils/files/251-meson-0.64.patch deleted file mode 100644 index 6cc200bbd87d..000000000000 --- a/sys-apps/systemd-utils/files/251-meson-0.64.patch +++ /dev/null @@ -1,26 +0,0 @@ -From cddbc850270415a818aadabd71fe12dc0dddd508 Mon Sep 17 00:00:00 2001 -From: Jan Janssen <medhefgo@web.de> -Date: Sun, 9 Oct 2022 17:16:12 +0200 -Subject: [PATCH] meson: Fix build with --optimization=plain - -Note that -O0 is deliberately filtered out as we have to compile with at -least -O1 due to #24202. - -Fixes: #24323 ---- - src/boot/efi/meson.build | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/boot/efi/meson.build b/src/boot/efi/meson.build -index e0cd4ebad993..395386d3eda7 100644 ---- a/src/boot/efi/meson.build -+++ b/src/boot/efi/meson.build -@@ -223,7 +223,7 @@ endif - if get_option('debug') and get_option('mode') == 'developer' - efi_cflags += ['-ggdb', '-DEFI_DEBUG'] - endif --if get_option('optimization') != '0' -+if get_option('optimization') in ['1', '2', '3', 's', 'g'] - efi_cflags += ['-O' + get_option('optimization')] - endif - if get_option('b_ndebug') == 'true' or ( diff --git a/sys-apps/systemd-utils/files/251-tmpfiles-ub.patch b/sys-apps/systemd-utils/files/251-tmpfiles-ub.patch new file mode 100644 index 000000000000..df190d500e34 --- /dev/null +++ b/sys-apps/systemd-utils/files/251-tmpfiles-ub.patch @@ -0,0 +1,71 @@ +https://github.com/systemd/systemd/pull/25957 +https://github.com/systemd/systemd/pull/25959 +https://github.com/systemd/systemd/commit/9f804ab04d566ff745849e1c4ced680a0447cf76 +https://github.com/systemd/systemd/commit/34680637e838415204850f77c93ca6ca219abaf1 + +From 9f804ab04d566ff745849e1c4ced680a0447cf76 Mon Sep 17 00:00:00 2001 +From: Sam James <sam@gentoo.org> +Date: Fri, 6 Jan 2023 10:58:32 +0000 +Subject: [PATCH] tmpfiles: avoid null free() for acl attributes + +When built with ACL support, we might be processing a tmpfiles +entry where there's no cause for us to call parse_acls_from_arg, +then we get to the end of parse_line without having ever populated +i.{acl_access, acl_default}. + +Then we pass a null pointer into acl_free(). + +From UBSAN w/ GCC 13.0.0_pre20230101: +``` +$ systemd-tmpfiles --clean +/var/tmp/portage/sys-apps/acl-2.3.1-r1/work/acl-2.3.1/libacl/acl_free.c:44:14: runtime error: applying non-zero offset 18446744073709551608 to null pointer + #0 0x7f65d868b482 in acl_free /var/tmp/portage/sys-apps/acl-2.3.1-r1/work/acl-2.3.1/libacl/acl_free.c:44 + #1 0x55fe7e592249 in item_free_contents ../systemd-9999/src/tmpfiles/tmpfiles.c:2855 + #2 0x55fe7e5a347a in parse_line ../systemd-9999/src/tmpfiles/tmpfiles.c:3158 + #3 0x55fe7e5a347a in read_config_file ../systemd-9999/src/tmpfiles/tmpfiles.c:3897 + #4 0x55fe7e590c61 in read_config_files ../systemd-9999/src/tmpfiles/tmpfiles.c:3985 + #5 0x55fe7e590c61 in run ../systemd-9999/src/tmpfiles/tmpfiles.c:4157 + #6 0x55fe7e590c61 in main ../systemd-9999/src/tmpfiles/tmpfiles.c:4218 + #7 0x7f65d7ebe289 (/usr/lib64/libc.so.6+0x23289) + #8 0x7f65d7ebe344 in __libc_start_main (/usr/lib64/libc.so.6+0x23344) + #9 0x55fe7e591900 in _start (/usr/bin/systemd-tmpfiles+0x11900) +``` +--- a/src/tmpfiles/tmpfiles.c ++++ b/src/tmpfiles/tmpfiles.c +@@ -2852,8 +2852,11 @@ static void item_free_contents(Item *i) { + strv_free(i->xattrs); + + #if HAVE_ACL +- acl_free(i->acl_access); +- acl_free(i->acl_default); ++ if (i->acl_access) ++ acl_free(i->acl_access); ++ ++ if (i->acl_default) ++ acl_free(i->acl_default); + #endif + } + + +From 34680637e838415204850f77c93ca6ca219abaf1 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering <lennart@poettering.net> +Date: Fri, 6 Jan 2023 12:30:36 +0100 +Subject: [PATCH] nspawn: guard acl_free() with a NULL check + +Inspired by #25957 there's one other place where we don't guard +acl_free() calls with a NULL check. + +Fix that. +--- a/src/nspawn/nspawn-patch-uid.c ++++ b/src/nspawn/nspawn-patch-uid.c +@@ -181,7 +181,9 @@ static int patch_acls(int fd, const char *name, const struct stat *st, uid_t shi + + if (S_ISDIR(st->st_mode)) { + acl_free(acl); +- acl_free(shifted); ++ ++ if (shifted) ++ acl_free(shifted); + + acl = shifted = NULL; + diff --git a/sys-apps/systemd-utils/systemd-utils-251.9.ebuild b/sys-apps/systemd-utils/systemd-utils-251.10-r1.ebuild index e3565a14d72b..4eddaff04164 100644 --- a/sys-apps/systemd-utils/systemd-utils-251.9.ebuild +++ b/sys-apps/systemd-utils/systemd-utils-251.10-r1.ebuild @@ -1,9 +1,18 @@ -# Copyright 2022 Gentoo Authors +# Copyright 2022-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 PYTHON_COMPAT=( python3_{8..11} ) +if [[ ${PV} != 25[12].* ]] ; then + # The F_S=3 issues should be fixed in 253. + # - https://github.com/systemd/systemd/issues/22801 + # - https://github.com/systemd/systemd/pull/25967 + # - https://github.com/systemd/systemd/commit/7929e180aa47a2692ad4f053afac2857d7198758 + # - https://github.com/systemd/systemd/commit/4f79f545b3c46c358666c9f5f2b384fe50aac4b4 + die "Please remove the FORTIFY_SOURCE hacks in src_configure." +fi + QA_PKGCONFIG_VERSION=$(ver_cut 1) inherit bash-completion-r1 flag-o-matic meson-multilib python-any-r1 toolchain-funcs udev usr-ldscript @@ -106,6 +115,7 @@ QA_FLAGS_IGNORED="usr/lib/systemd/boot/efi/.*" src_prepare() { local PATCHES=( "${FILESDIR}/251-gpt-auto-no-cryptsetup.patch" + "${FILESDIR}/251-tmpfiles-ub.patch" ) if use elibc_musl; then diff --git a/sys-apps/systemd-utils/systemd-utils-251.7.ebuild b/sys-apps/systemd-utils/systemd-utils-251.7.ebuild deleted file mode 100644 index 71637af6ed33..000000000000 --- a/sys-apps/systemd-utils/systemd-utils-251.7.ebuild +++ /dev/null @@ -1,527 +0,0 @@ -# Copyright 2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 -PYTHON_COMPAT=( python3_{8..11} ) - -QA_PKGCONFIG_VERSION=$(ver_cut 1) - -inherit bash-completion-r1 flag-o-matic meson-multilib python-any-r1 toolchain-funcs udev usr-ldscript - -DESCRIPTION="Utilities split out from systemd for OpenRC users" -HOMEPAGE="https://systemd.io/" - -if [[ ${PV} == *.* ]]; then - MY_P="systemd-stable-${PV}" - S="${WORKDIR}/${MY_P}" - SRC_URI="https://github.com/systemd/systemd-stable/archive/refs/tags/v${PV}.tar.gz -> ${MY_P}.tar.gz" -else - MY_P="systemd-${PV}" - S="${WORKDIR}/${MY_P}" - SRC_URI="https://github.com/systemd/systemd/archive/refs/tags/v${PV}.tar.gz -> ${MY_P}.tar.gz" -fi - -MUSL_PATCHSET="systemd-musl-patches-251.2" -SRC_URI+=" elibc_musl? ( https://dev.gentoo.org/~floppym/dist/${MUSL_PATCHSET}.tar.gz )" - -LICENSE="GPL-2 LGPL-2.1 MIT public-domain" -SLOT="0" -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86" -IUSE="+acl boot +kmod selinux split-usr sysusers +tmpfiles test +udev" -REQUIRED_USE="|| ( boot tmpfiles sysusers udev )" -RESTRICT="!test? ( test )" - -COMMON_DEPEND=" - elibc_musl? ( >=sys-libs/musl-1.2.3 ) - selinux? ( sys-libs/libselinux:0= ) - tmpfiles? ( - acl? ( sys-apps/acl:0= ) - ) - udev? ( - >=sys-apps/util-linux-2.30:0=[${MULTILIB_USEDEP}] - sys-libs/libcap:0=[${MULTILIB_USEDEP}] - virtual/libcrypt:=[${MULTILIB_USEDEP}] - acl? ( sys-apps/acl:0= ) - kmod? ( >=sys-apps/kmod-15:0= ) - ) - !udev? ( - >=sys-apps/util-linux-2.30:0= - sys-libs/libcap:0= - virtual/libcrypt:= - ) -" -DEPEND="${COMMON_DEPEND} - >=sys-kernel/linux-headers-3.11 - boot? ( >=sys-boot/gnu-efi-3.0.2 ) -" -RDEPEND="${COMMON_DEPEND} - boot? ( !<sys-boot/systemd-boot-250 ) - tmpfiles? ( !<sys-apps/systemd-tmpfiles-250 ) - udev? ( - acct-group/audio - acct-group/cdrom - acct-group/dialout - acct-group/disk - acct-group/input - acct-group/kmem - acct-group/kvm - acct-group/lp - acct-group/render - acct-group/sgx - acct-group/tape - acct-group/tty - acct-group/video - !sys-apps/gentoo-systemd-integration - !sys-apps/hwids[udev] - !<sys-fs/udev-250 - !sys-fs/eudev - ) - !sys-apps/systemd -" -PDEPEND=" - udev? ( >=sys-fs/udev-init-scripts-34 ) -" -BDEPEND=" - $(python_gen_any_dep 'dev-python/jinja[${PYTHON_USEDEP}]') - app-text/docbook-xml-dtd:4.2 - app-text/docbook-xml-dtd:4.5 - app-text/docbook-xsl-stylesheets - dev-libs/libxslt - dev-util/gperf - >=sys-apps/coreutils-8.16 - sys-devel/gettext - virtual/pkgconfig -" - -TMPFILES_OPTIONAL=1 -UDEV_OPTIONAL=1 - -python_check_deps() { - python_has_version "dev-python/jinja[${PYTHON_USEDEP}]" -} - -QA_EXECSTACK="usr/lib/systemd/boot/efi/*" -QA_FLAGS_IGNORED="usr/lib/systemd/boot/efi/.*" - -src_prepare() { - local PATCHES=( - # Breaks Clang. Revert the commit for now and force off F_S=3. - "${FILESDIR}/251-revert-fortify-source-3-fix.patch" - "${FILESDIR}/251-gpt-auto-no-cryptsetup.patch" - "${FILESDIR}/251-meson-0.64.patch" - ) - - if use elibc_musl; then - PATCHES+=( "${WORKDIR}/${MUSL_PATCHSET}" ) - # Applied upstream in 251.3 - rm "${WORKDIR}/${MUSL_PATCHSET}/0001-Add-sys-file.h-for-LOCK_.patch" || die - fi - default - - # Remove install_rpath; we link statically - local rpath_pattern="install_rpath : rootlibexecdir," - grep -q -e "${rpath_pattern}" meson.build || die - sed -i -e "/${rpath_pattern}/d" meson.build || die -} - -src_configure() { - # Broken with FORTIFY_SOURCE=3 without a patch. And the patch - # wasn't backported to 250.x, but it turns out to break Clang - # anyway: bug #841770. - # - # Our toolchain sets F_S=2 by default w/ >= -O2, so we need - # to unset F_S first, then explicitly set 2, to negate any default - # and anything set by the user if they're choosing 3 (or if they've - # modified GCC to set 3). - # - if is-flagq '-O[23]' || is-flagq '-Ofast' ; then - # We can't unconditionally do this b/c we fortify needs - # some level of optimisation. - filter-flags -D_FORTIFY_SOURCE=3 - append-cppflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 - fi - - multilib-minimal_src_configure -} - -multilib_src_configure() { - local emesonargs=( - $(meson_use split-usr) - $(meson_use split-usr split-bin) - -Drootprefix="$(usex split-usr "${EPREFIX:-/}" "${EPREFIX}/usr")" - -Drootlibdir="${EPREFIX}/usr/$(get_libdir)" - -Dsysvinit-path= - $(meson_native_use_bool boot efi) - $(meson_native_use_bool boot gnu-efi) - $(meson_native_use_bool boot kernel-install) - $(meson_native_use_bool selinux) - $(meson_native_use_bool sysusers) - $(meson_use test tests) - $(meson_native_use_bool tmpfiles) - $(meson_use udev hwdb) - - -Defi-libdir="${ESYSROOT}/usr/$(get_libdir)" - - # Link staticly with libsystemd-shared - -Dlink-boot-shared=false - -Dlink-udev-shared=false - - # systemd-tmpfiles has a separate "systemd-tmpfiles.standalone" target - -Dstandalone-binaries=true - - # Disable all optional features - -Dadm-group=false - -Danalyze=false - -Dapparmor=false - -Daudit=false - -Dbacklight=false - -Dbinfmt=false - -Dbpf-framework=false - -Dbzip2=false - -Dcoredump=false - -Ddbus=false - -Delfutils=false - -Denvironment-d=false - -Dfdisk=false - -Dgcrypt=false - -Dglib=false - -Dgshadow=false - -Dgnutls=false - -Dhibernate=false - -Dhostnamed=false - -Didn=false - -Dima=false - -Dinitrd=false - -Dfirstboot=false - -Dldconfig=false - -Dlibcryptsetup=false - -Dlibcurl=false - -Dlibfido2=false - -Dlibidn=false - -Dlibidn2=false - -Dlibiptc=false - -Dlocaled=false - -Dlogind=false - -Dlz4=false - -Dmachined=false - -Dmicrohttpd=false - -Dnetworkd=false - -Dnscd=false - -Dnss-myhostname=false - -Dnss-resolve=false - -Dnss-systemd=false - -Doomd=false - -Dopenssl=false - -Dp11kit=false - -Dpam=false - -Dpcre2=false - -Dpolkit=false - -Dportabled=false - -Dpstore=false - -Dpwquality=false - -Drandomseed=false - -Dresolve=false - -Drfkill=false - -Dseccomp=false - -Dsmack=false - -Dsysext=false - -Dtimedated=false - -Dtimesyncd=false - -Dtpm=false - -Dqrencode=false - -Dquotacheck=false - -Duserdb=false - -Dutmp=false - -Dvconsole=false - -Dwheel-group=false - -Dxdg-autostart=false - -Dxkbcommon=false - -Dxz=false - -Dzlib=false - -Dzstd=false - ) - - if use tmpfiles || use udev; then - emesonargs+=( $(meson_native_use_bool acl) ) - else - emesonargs+=( -Dacl=false ) - fi - - if use udev; then - emesonargs+=( $(meson_native_use_bool kmod) ) - else - emesonargs+=( -Dkmod=false ) - fi - - if use elibc_musl; then - # Avoid redefinition of struct ethhdr. - append-cppflags -D__UAPI_DEF_ETHHDR=0 - fi - - if multilib_is_native_abi || use udev; then - meson_src_configure - fi -} - -efi_arch() { - case "$(tc-arch)" in - amd64) echo x64 ;; - arm) echo arm ;; - arm64) echo aa64 ;; - x86) echo x86 ;; - esac -} - -multilib_src_compile() { - local targets=() - if multilib_is_native_abi; then - if use boot; then - targets+=( - bootctl - kernel-install - man/bootctl.1 - man/kernel-install.8 - src/boot/efi/linux$(efi_arch).{efi,elf}.stub - src/boot/efi/systemd-boot$(efi_arch).efi - ) - fi - if use sysusers; then - targets+=( - systemd-sysusers.standalone - man/sysusers.d.5 - man/systemd-sysusers.8 - ) - if use test; then - targets+=( - systemd-runtest.env - ) - fi - fi - if use tmpfiles; then - targets+=( - systemd-tmpfiles.standalone - man/tmpfiles.d.5 - man/systemd-tmpfiles.8 - ) - if use test; then - targets+=( test-tmpfiles ) - fi - fi - if use udev; then - targets+=( - udevadm - systemd-hwdb - src/udev/ata_id - src/udev/cdrom_id - src/udev/fido_id - src/udev/mtd_probe - src/udev/scsi_id - src/udev/udev.pc - src/udev/v4l_id - man/udev.conf.5 - man/systemd.link.5 - man/hwdb.7 - man/udev.7 - man/systemd-hwdb.8 - man/systemd-udevd.service.8 - man/udevadm.8 - hwdb.d/60-autosuspend-chromiumos.hwdb - rules.d/50-udev-default.rules - rules.d/64-btrfs.rules - ) - if use test; then - targets+=( - # Used by udev-test.pl - systemd-detect-virt - test/sys - test-udev - - test-fido-id-desc - test-udev-builtin - test-udev-event - test-udev-netlink - test-udev-node - test-udev-util - ) - fi - fi - fi - if use udev; then - targets+=( - udev:shared_library - src/libudev/libudev.pc - ) - if use test; then - targets+=( - test-libudev - test-libudev-sym - test-udev-device-thread - ) - fi - fi - if multilib_is_native_abi || use udev; then - meson_src_compile "${targets[@]}" - fi -} - -multilib_src_test() { - local tests=() - if multilib_is_native_abi; then - if use sysusers; then - tests+=( - test-sysusers.standalone - ) - fi - if use tmpfiles; then - tests+=( - test-systemd-tmpfiles.standalone - test-tmpfiles - ) - fi - if use udev; then - tests+=( - rule-syntax-check - test-fido-id-desc - test-udev-builtin - test-udev-event - test-udev-netlink - test-udev-node - test-udev-util - ) - if [[ -w /dev ]]; then - tests+=( udev-test ) - else - ewarn "Skipping udev-test (needs write access to /dev)" - fi - fi - fi - if use udev; then - tests+=( - test-libudev - test-libudev-sym - test-udev-device-thread - ) - fi - if [[ ${#tests[@]} -ne 0 ]]; then - meson_src_test "${tests[@]}" - fi -} - -src_install() { - local rootprefix="$(usex split-usr '' /usr)" - meson-multilib_src_install -} - -multilib_src_install() { - if multilib_is_native_abi; then - if use boot; then - into /usr - dobin bootctl kernel-install - doman man/{bootctl.1,kernel-install.8} - insinto usr/lib/systemd/boot/efi - doins src/boot/efi/{linux$(efi_arch).{efi,elf}.stub,systemd-boot$(efi_arch).efi} - fi - if use sysusers; then - into "${rootprefix:-/}" - newbin systemd-sysusers{.standalone,} - doman man/{systemd-sysusers.8,sysusers.d.5} - fi - if use tmpfiles; then - into "${rootprefix:-/}" - newbin systemd-tmpfiles{.standalone,} - doman man/{systemd-tmpfiles.8,tmpfiles.d.5} - fi - if use udev; then - into "${rootprefix:-/}" - dobin udevadm systemd-hwdb - dosym ../../bin/udevadm "${rootprefix}"/lib/systemd/systemd-udevd - - exeinto "${rootprefix}"/lib/udev - doexe src/udev/{ata_id,cdrom_id,fido_id,mtd_probe,scsi_id,v4l_id} - - insinto "${rootprefix}"/lib/udev/rules.d - doins rules.d/*.rules - - insinto "${rootprefix}"/lib/udev/hwdb.d - doins hwdb.d/*.hwdb - - insinto /usr/share/pkgconfig - doins src/udev/udev.pc - - doman man/{udev.conf.5,systemd.link.5,hwdb.7,systemd-hwdb.8,udev.7,udevadm.8} - newman man/systemd-udevd.service.8 systemd-udevd.8 - fi - fi - if use udev; then - meson_install --no-rebuild --tags libudev - gen_usr_ldscript -a udev - insinto "/usr/$(get_libdir)/pkgconfig" - doins src/libudev/libudev.pc - fi -} - -multilib_src_install_all() { - einstalldocs - if use boot; then - into /usr - exeinto usr/lib/kernel/install.d - doexe src/kernel-install/*.install - dobashcomp shell-completion/bash/bootctl - insinto /usr/share/zsh/site-functions - doins shell-completion/zsh/{_bootctl,_kernel-install} - fi - if use tmpfiles; then - doinitd "${FILESDIR}"/systemd-tmpfiles-setup - doinitd "${FILESDIR}"/systemd-tmpfiles-setup-dev - insinto /usr/share/zsh/site-functions - doins shell-completion/zsh/_systemd-tmpfiles - fi - if use udev; then - doheader src/libudev/libudev.h - - insinto /etc/udev - doins src/udev/udev.conf - keepdir /etc/udev/{hwdb.d,rules.d} - - insinto "${rootprefix}"/lib/systemd/network - doins network/99-default.link - - # Remove to avoid conflict with elogind - # https://bugs.gentoo.org/856433 - rm rules.d/70-power-switch.rules || die - insinto "${rootprefix}"/lib/udev/rules.d - doins rules.d/*.rules - doins "${FILESDIR}"/40-gentoo.rules - - insinto "${rootprefix}"/lib/udev/hwdb.d - doins hwdb.d/*.hwdb - - dobashcomp shell-completion/bash/udevadm - - insinto /usr/share/zsh/site-functions - doins shell-completion/zsh/_udevadm - fi -} - -add_service() { - local initd=$1 - local runlevel=$2 - - ebegin "Adding '${initd}' service to the '${runlevel}' runlevel" - mkdir -p "${EROOT}/etc/runlevels/${runlevel}" && - ln -snf "${EPREFIX}/etc/init.d/${initd}" "${EROOT}/etc/runlevels/${runlevel}/${initd}" - eend $? -} - -pkg_postinst() { - if [[ -z ${REPLACING_VERSIONS} ]]; then - add_service systemd-tmpfiles-setup-dev sysinit - add_service systemd-tmpfiles-setup boot - fi - if use udev; then - ebegin "Updating hwdb" - systemd-hwdb --root="${ROOT}" update - eend $? - udev_reload - fi -} |