Skip to content

Commit d345ca2

Browse files
johannbgLaszloGombos
authored andcommitted
feat(systemd-pcrphase): introducing the systemd-pcrphase module
Introducing the systemd-pcrphase module
1 parent 444944a commit d345ca2

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/bin/bash
2+
# This file is part of dracut.
3+
# SPDX-License-Identifier: GPL-2.0-or-later
4+
5+
# Prerequisite check(s) for module.
6+
check() {
7+
8+
# If the binary(s) requirements are not fulfilled the module can't be installed.
9+
require_binaries "$systemdutildir"/systemd-pcrphase || return 1
10+
11+
# Return 255 to only include the module, if another module requires it.
12+
return 255
13+
14+
}
15+
16+
# Module dependency requirements.
17+
depends() {
18+
19+
# This module has external dependency on other module(s).
20+
echo systemd tpm2-tss
21+
# Return 0 to include the dependent module(s) in the initramfs.
22+
return 0
23+
24+
}
25+
26+
# Install the required file(s) and directories for the module in the initramfs.
27+
install() {
28+
29+
inst_multiple -o \
30+
"$systemdutildir"/systemd-pcrphase \
31+
"$systemdsystemunitdir"/systemd-pcrphase.service \
32+
"$systemdsystemunitdir/systemd-pcrphase.service.d/*.conf" \
33+
"$systemdsystemunitdir"/systemd-pcrphase-sysinit.service \
34+
"$systemdsystemunitdir/systemd-pcrphase-sysinit.service/*.conf" \
35+
"$systemdsystemunitdir"/systemd-pcrphase-initrd.service \
36+
"$systemdsystemunitdir/systemd-pcrphase-initrd.service.d/*.conf" \
37+
"$systemdsystemunitdir"/initrd.target.wants/systemd-pcrphase-initrd.service
38+
39+
# Install the hosts local user configurations if enabled.
40+
if [[ $hostonly ]]; then
41+
inst_multiple -H -o \
42+
"$systemdsystemconfdir"/systemd-pcrphase.service \
43+
"$systemdsystemconfdir/systemd-pcrphase.service.d/*.conf" \
44+
"$systemdsystemconfdir"/systemd-pcrphase-sysinit.service \
45+
"$systemdsystemconfdir/systemd-pcrphase-sysinit.service.d/*.conf" \
46+
"$systemdsystemconfdir"/systemd-pcrphase-initrd.service \
47+
"$systemdsystemconfdir/systemd-pcrphase-initrd.service.d/*.conf" \
48+
"$systemdsystemconfdir"/initrd.target.wants/systemd-pcrphase-initrd.service
49+
fi
50+
51+
}

pkgbuild/dracut.spec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/
330330
%{dracutlibdir}/modules.d/01systemd-journald
331331
%{dracutlibdir}/modules.d/01systemd-ldconfig
332332
%{dracutlibdir}/modules.d/01systemd-modules-load
333+
%{dracutlibdir}/modules.d/01systemd-pcrphase
333334
%{dracutlibdir}/modules.d/01systemd-portabled
334335
%{dracutlibdir}/modules.d/01systemd-pstore
335336
%{dracutlibdir}/modules.d/01systemd-repart

0 commit comments

Comments
 (0)