diff options
author | Violet Purcell <vimproved@inventati.org> | 2023-09-09 13:41:11 -0400 |
---|---|---|
committer | Mike Gilbert <floppym@gentoo.org> | 2023-09-09 16:24:44 -0400 |
commit | 48a49e120fc72a0ef39916c1c7ccffca75751530 (patch) | |
tree | 52f929eb89748fe7a015e268240c71091b81c5f7 /sys-apps | |
parent | profiles: mask <dev-libs/openssl-3 (diff) | |
download | gentoo-48a49e120fc72a0ef39916c1c7ccffca75751530.tar.gz gentoo-48a49e120fc72a0ef39916c1c7ccffca75751530.tar.bz2 gentoo-48a49e120fc72a0ef39916c1c7ccffca75751530.zip |
sys-apps/systemd-utils: add 254.3
Signed-off-by: Violet Purcell <vimproved@inventati.org>
Closes: https://github.com/gentoo/gentoo/pull/32237
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
Diffstat (limited to 'sys-apps')
3 files changed, 604 insertions, 0 deletions
diff --git a/sys-apps/systemd-utils/Manifest b/sys-apps/systemd-utils/Manifest index 4f39da4a1f9c..285c8dbc2eff 100644 --- a/sys-apps/systemd-utils/Manifest +++ b/sys-apps/systemd-utils/Manifest @@ -1,5 +1,6 @@ DIST systemd-musl-patches-252.4.tar.gz 25053 BLAKE2B 1d75f85ea0c48c788e9199e2d919bac90edce16a9788a349332cf308c32fb9510ac2883f8e09f21e7f37fbac2e557dc39cdf44dcd7a986587c40dedd2d1b5df5 SHA512 1dc8e220eae1869eb4bb50f9c701392542b053099cf9b6bde13f12a2d26fa29984819a8b4ce1b6c57e38a71f86324469a87cf9e22abe0f6d67ac3e84c6b9a3ba DIST systemd-musl-patches-253.3.tar.gz 28384 BLAKE2B 2736a4ddc36b2ce087c08c57c0b995db2dcf6f82a4ae6f20b07609657bc5ea1e4a12ec78da1576b364e03260577b4f9fc85fae8c0f7497eca564c6fb857e06d8 SHA512 4b556975f25393cbeb5df495267c68edf14bef0f8baae20955151c900f200d1402b54630cab7dd3a69bbb82bef3f7464869222e2022c60faa2311444fa87ec80 +DIST systemd-musl-patches-254.3.tar.gz 28640 BLAKE2B 54837f49cdb8cf025e367ad13bab0d0509c2e11ad84d29724bb6baa226c54e0ab97a91035361f66009dd9b1a22f7b3e82f90b1c14adf4aa20d576b9410589d38 SHA512 07d028a57025b2626471d6f48507f2dfc50658db24efaac93bafae9a1d4cdc3ec82e80da426d2a6280c32af2d813565609dab7df5538260ba809b63309a0ffed DIST systemd-stable-252.10.tar.gz 11841052 BLAKE2B 33ebca90ff17ef5983677c08c93a80350908aa4f4f1860d8e69c234ead926f0e21a4c4692c171f061e05e41c94d8fe2ba3a3be75fb7b582b86e851194a1f0203 SHA512 5309d8df51b5cda694e03e2ded574d4e3606916fab5d190b21fcd0284d8d8f56cab8b3423d7d0b90e44cd9775cc62bc26198f3d2a43f8aa545959b5c27b0dd9d DIST systemd-stable-252.9.tar.gz 11829389 BLAKE2B a45a72bfe113f8cb7424d731692f548c389f59d34b649e874db2f85868943b0a9c33ef62185c83c41a9c220caddd65c44ff328026eff19c3c7efda5efbd73574 SHA512 fa34b9c2f692af8f70dffc5044fe502ff5e21625af5b27cad7fc5e833570b180f53c5d03a0add785e83a5b4e7564117fe4728931df4ef599888c73e92c7f2103 DIST systemd-stable-253.10.tar.gz 12116663 BLAKE2B 9232067c5fb4ceb3c941d9840a043f34ca3c6eee6e696743715e9f36d47a58e98046ffb6af19084bbd7e8b4edf40c67132a3fa967f37785eb988a18530ca89b1 SHA512 dab45496586a9a78ba46a3c03c02e6bd97a8b832e28f96fdf052ecf1906c8c1bdc55967fc243ca837d0371e81730a92bb230e59a43e2ab6bc1b62fbd42a051d4 @@ -7,3 +8,4 @@ DIST systemd-stable-253.5.tar.gz 12015672 BLAKE2B 3b09bc1a63bc3321c51ea05080f959 DIST systemd-stable-253.6.tar.gz 12069024 BLAKE2B 7dfb28127bf6c091180a6cfbae1eb657b99896920cc6b74d1e86586f51bf312d6c2647582a635a479048cadceb0b5ed508918ddff42b2639cec6234a656762f4 SHA512 c81f7ac0cca9073878026d6a3024ebad8bf38c4745fe7bac5a156906ba9fd7b78b90fdc69376821c9927dd60173dd6604684e2ea7dcb55dc2e60a0e20ee01735 DIST systemd-stable-253.7.tar.gz 12111722 BLAKE2B 2007653c264d615fbef52cd91d173597f175ba05c1b961c6035d51c1a28ff663151a72d858115536c316a2644d880dfe94e6d00809bf3a2abe3e2f5532df565b SHA512 6935508f511930d6e980a7f0a3319295acbbc482cbce4f8f407af399259fe04b095dabd470f8825d84328a7d0f39efe6d5926022c1bdf18ec7fffe43b2586aa1 DIST systemd-stable-253.8.tar.gz 12112413 BLAKE2B 0edf5d2fdb47ef4c2fd9257642a719cb3cf70096d74ae0002f4df2696f3efd591ddf239f2ac9762aa53ebcee5bf31295739f8176313b8260e97fe99cc51722f6 SHA512 628db658ccf01e6cf09c6832735ad08c3d0dd906798e3366d42621fb08ad8b72aa7a51ae4874d76acf6c56282c63dc5fdce677cde3d4e102ce0036571ccabcc4 +DIST systemd-stable-254.3.tar.gz 14329148 BLAKE2B 10b947e04a4ef9ccaeb7adaa67ac0f391927fb172c0750ffb93d4df69d970fd91f26b052f8bfdfb4f81ae69566d0a3459cbc87cc86b624014cfb8781a2914121 SHA512 a0c361c993ac9a121823bdd58e29ef7bd25ccfd206ae0c3e1eed9833b3ddf24f53afe6f669eb9fbff5078977403236b0e4ef5a5f6fde56c504caed1d411e71fe diff --git a/sys-apps/systemd-utils/files/systemd-utils-254.3-add-link-kernel-install-shared-option.patch b/sys-apps/systemd-utils/files/systemd-utils-254.3-add-link-kernel-install-shared-option.patch new file mode 100644 index 000000000000..17e4ea4832a2 --- /dev/null +++ b/sys-apps/systemd-utils/files/systemd-utils-254.3-add-link-kernel-install-shared-option.patch @@ -0,0 +1,58 @@ +From 5973e4b237e7b50dca1c9f3157db459ef1ee6da5 Mon Sep 17 00:00:00 2001 +From: Violet Purcell <vimproved@inventati.org> +Date: Sat, 9 Sep 2023 13:22:54 -0400 +Subject: [PATCH] meson: add link-kernel-install-shared option + +Signed-off-by: Violet Purcell <vimproved@inventati.org> +--- + meson.build | 9 ++++++++- + meson_options.txt | 2 ++ + 2 files changed, 10 insertions(+), 1 deletion(-) + +diff --git a/meson.build b/meson.build +index 053e772567..003a34574a 100644 +--- a/meson.build ++++ b/meson.build +@@ -4420,11 +4420,17 @@ executable( + install : true, + install_dir : rootlibexecdir) + ++if get_option('link-kernel-install-shared') ++ kernel_install_link_with = [libshared] ++else ++ kernel_install_link_with = [libsystemd_static, libshared_static] ++endif ++ + kernel_install = executable( + 'kernel-install', + 'src/kernel-install/kernel-install.c', + include_directories : includes, +- link_with : [libshared], ++ link_with : kernel_install_link_with, + dependencies : [userspace, + versiondep], + install_rpath : rootpkglibdir, +@@ -5059,6 +5065,7 @@ foreach tuple : [ + ['link-timesyncd-shared', get_option('link-timesyncd-shared')], + ['link-journalctl-shared', get_option('link-journalctl-shared')], + ['link-boot-shared', get_option('link-boot-shared')], ++ ['link-kernel-install-shared', get_option('link-kernel-install-shared')], + ['link-portabled-shared', get_option('link-portabled-shared')], + ['first-boot-full-preset'], + ['fexecve'], +diff --git a/meson_options.txt b/meson_options.txt +index 1909323850..36794e6d98 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -29,6 +29,8 @@ option('link-journalctl-shared', type: 'boolean', + description : 'link journalctl against libsystemd-shared.so') + option('link-boot-shared', type: 'boolean', + description : 'link bootctl and systemd-bless-boot against libsystemd-shared.so') ++option('link-kernel-install-shared', type: 'boolean', ++ description : 'link kernel-install against libsystemd-shared.so') + option('link-portabled-shared', type: 'boolean', + description : 'link systemd-portabled and its helpers to libsystemd-shared.so') + option('first-boot-full-preset', type: 'boolean', value: false, +-- +2.42.0 + diff --git a/sys-apps/systemd-utils/systemd-utils-254.3.ebuild b/sys-apps/systemd-utils/systemd-utils-254.3.ebuild new file mode 100644 index 000000000000..594ed9e2a554 --- /dev/null +++ b/sys-apps/systemd-utils/systemd-utils-254.3.ebuild @@ -0,0 +1,544 @@ +# Copyright 2022-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 +PYTHON_COMPAT=( python3_{10..11} ) + +QA_PKGCONFIG_VERSION=$(ver_cut 1) + +inherit bash-completion-r1 flag-o-matic linux-info meson-multilib python-single-r1 +inherit secureboot 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-254.3" +SRC_URI+=" elibc_musl? ( https://github.com/vimproved/systemd-musl-patches/archive/refs/tags/${MUSL_PATCHSET##*-}.tar.gz -> ${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 ) + ${PYTHON_REQUIRED_USE} +" +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 +" + +PEFILE_DEPEND='dev-python/pefile[${PYTHON_USEDEP}]' + +RDEPEND="${COMMON_DEPEND} + boot? ( + !<sys-boot/systemd-boot-250 + ${PYTHON_DEPS} + $(python_gen_cond_dep "${PEFILE_DEPEND}") + ) + tmpfiles? ( !<sys-apps/systemd-tmpfiles-250 ) + udev? ( + acct-group/audio + acct-group/cdrom + acct-group/dialout + acct-group/disk + acct-group/floppy + 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/usb + 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=" + 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 + $(python_gen_cond_dep " + dev-python/jinja[\${PYTHON_USEDEP}] + dev-python/lxml[\${PYTHON_USEDEP}] + boot? ( + >=dev-python/pyelftools-0.30[\${PYTHON_USEDEP}] + test? ( ${PEFILE_DEPEND} ) + ) + ") +" + +TMPFILES_OPTIONAL=1 +UDEV_OPTIONAL=1 + +QA_EXECSTACK="usr/lib/systemd/boot/efi/*" +QA_FLAGS_IGNORED="usr/lib/systemd/boot/efi/.*" + +CONFIG_CHECK="~BLK_DEV_BSG ~DEVTMPFS ~!IDE ~INOTIFY_USER ~!SYSFS_DEPRECATED + ~!SYSFS_DEPRECATED_V2 ~SIGNALFD ~EPOLL ~FHANDLE ~NET ~UNIX" + +pkg_setup() { + if [[ ${MERGE_TYPE} != buildonly ]] && use udev; then + linux-info_pkg_setup + fi + use boot && secureboot_pkg_setup +} + +src_prepare() { + local PATCHES=( + "${FILESDIR}/${PN}-254.3-add-link-kernel-install-shared-option.patch" + ) + + if use elibc_musl; then + PATCHES+=( + "${WORKDIR}/${MUSL_PATCHSET}" + ) + fi + default + + # Remove install_rpath; we link statically + local rpath_pattern="install_rpath : rootpkglibdir," + grep -q -e "${rpath_pattern}" meson.build || die + sed -i -e "/${rpath_pattern}/d" meson.build || die +} + +src_configure() { + python_setup + meson-multilib_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 bootloader) + $(meson_native_use_bool selinux) + $(meson_native_use_bool sysusers) + $(meson_use test tests) + $(meson_native_use_bool tmpfiles) + $(meson_use udev hwdb) + + # Link staticly with libsystemd-shared + -Dlink-boot-shared=false + -Dlink-kernel-install-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 + 90-loaderentry.install + src/boot/efi/linux$(efi_arch).efi.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 + tmpfiles.d/{etc,static-nodes-permissions,var}.conf + ) + 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/60-persistent-storage.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-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-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} + # 90-loaderentry.install is generated from 90-loaderentry.install.in + exeinto usr/lib/kernel/install.d + doexe src/kernel-install/*.install + 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} + insinto /usr/lib/tmpfiles.d + doins tmpfiles.d/{etc,static-nodes-permissions,var}.conf + 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 + exeinto /etc/cron.daily + doexe "${FILESDIR}"/systemd-tmpfiles-clean + insinto /usr/share/zsh/site-functions + doins shell-completion/zsh/_systemd-tmpfiles + insinto /usr/lib/tmpfiles.d + doins tmpfiles.d/{tmp,x11}.conf + doins "${FILESDIR}"/legacy.conf + 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 + + use boot && secureboot_auto_sign +} + +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 +} |