Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 879229

Summary: sys-apps/systemd-252 with USE -tpm installs services for pcrphase but not the executable
Product: Gentoo Linux Reporter: stealth
Component: Current packagesAssignee: Gentoo systemd Team <systemd>
Status: RESOLVED OBSOLETE    
Severity: trivial CC: d
Priority: Normal    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description stealth 2022-11-02 23:17:47 UTC
the following services are installed and enabled by default:
systemd-pcrphase-initrd.service
systemd-pcrphase-sysinit.service
systemd-pcrphase.service

they rely on systemd-pcrphase executable which is understandably not installed because its related to tpm.
Comment 1 David Sardari 2022-11-02 23:29:24 UTC
I have USE="tpm" set, but had to mask the services as a quick fix for my laptop to be able to bootup with measured boot. systemd-pcrphase-initrd.service at least doesn't have a timeout making my laptop wait indefinitely.
Comment 2 stealth 2022-11-03 00:19:24 UTC
(I have merged /usr and enabled the merged-usr profile so not sure if the paths below should be just /lib or /usr/lib)

I copied the 252 ebuild to my local repo and added:

if ! use tpm; then
    # mask systemd-pcrphase services which depend on tpm
    dosym /dev/null /usr/lib/systemd/system/systemd-pcrphase.service
    dosym /dev/null /usr/lib/systemd/system/systemd-pcrphase-initrd.service
    dosym /dev/null /usr/lib/systemd/system/systemd-pcrphase-sysinit.service
fi

below the if use split-usr conditional in multilib_src_install_all function

systemd is no longer in degraded state after that
Comment 3 David Sardari 2022-11-03 07:14:42 UTC
These are the symlinks I have after using "systemctl mask ...":

❯ find / -xdev -name "systemd-pcrphase*.service" -exec ls -ld {} +
lrwxrwxrwx 1 root root   9  2. Nov 14:58 /etc/systemd/system/systemd-pcrphase-initrd.service -> /dev/null
lrwxrwxrwx 1 root root   9  2. Nov 14:58 /etc/systemd/system/systemd-pcrphase-sysinit.service -> /dev/null
lrwxrwxrwx 1 root root   9  2. Nov 14:58 /etc/systemd/system/systemd-pcrphase.service -> /dev/null
lrwxrwxrwx 1 root root  34  2. Nov 12:35 /usr/lib/systemd/system/initrd.target.wants/systemd-pcrphase-initrd.service -> ../systemd-pcrphase-initrd.service
lrwxrwxrwx 1 root root  35  2. Nov 12:35 /usr/lib/systemd/system/sysinit.target.wants/systemd-pcrphase-sysinit.service -> ../systemd-pcrphase-sysinit.service
lrwxrwxrwx 1 root root  27  2. Nov 12:35 /usr/lib/systemd/system/sysinit.target.wants/systemd-pcrphase.service -> ../systemd-pcrphase.service
-rw-r--r-- 1 root root 959  2. Nov 12:34 /usr/lib/systemd/system/systemd-pcrphase-initrd.service
-rw-r--r-- 1 root root 861  2. Nov 12:34 /usr/lib/systemd/system/systemd-pcrphase-sysinit.service
-rw-r--r-- 1 root root 823  2. Nov 12:34 /usr/lib/systemd/system/systemd-pcrphase.service
Comment 4 Mike Gilbert gentoo-dev 2023-07-22 20:43:28 UTC
It looks like recent systemd releases do not install those unit files when USE="-tpm". Please re-open if this is still an issue.