Skip to content
This repository has been archived by the owner on Jan 6, 2024. It is now read-only.

Commit

Permalink
fix(systemd-255): handle systemd-pcrphase -> systemd-pcrextend
Browse files Browse the repository at this point in the history
In systemd 255 systemd-pcrphase was renamed to systemd-pcrextend;
there was no other change to it, just the rename.

This adds a copy of systemd-pcrphase changed for pcrextend.  Rather
than trying to make one module work for both, the file was forked
due to the expectation upstream may add some more things to pcrextend
down the line.

Fixes dracutdevs#2583 .

Signed-off-by: Brian Harring <[email protected]>
  • Loading branch information
ferringb committed Dec 12, 2023
1 parent 4971f44 commit 540ed46
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions modules.d/01systemd-pcrextend/module-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash
# This file is part of dracut.
# SPDX-License-Identifier: GPL-2.0-or-later

# Prerequisite check(s) for module.
check() {

# If the binary(s) requirements are not fulfilled the module can't be installed.
require_binaries "$systemdutildir"/systemd-pcrextend || return 1

# Return 255 to only include the module, if another module requires it.
return 255

}

# Module dependency requirements.
depends() {

# This module has external dependency on other module(s).
echo systemd tpm2-tss
# Return 0 to include the dependent module(s) in the initramfs.
return 0

}

# Install the required file(s) and directories for the module in the initramfs.
install() {

inst_multiple -o \
"$systemdutildir"/systemd-pcrextend \
"$systemdsystemunitdir"/systemd-pcrextend-initrd.service \
"$systemdsystemunitdir/systemd-pcrextend-initrd.service.d/*.conf" \
"$systemdsystemunitdir"/initrd.target.wants/systemd-pcrextend-initrd.service

# Install the hosts local user configurations if enabled.
if [[ $hostonly ]]; then
inst_multiple -H -o \
"$systemdsystemconfdir"/systemd-pcrextend-initrd.service \
"$systemdsystemconfdir/systemd-pcrextend-initrd.service.d/*.conf" \
"$systemdsystemconfdir"/initrd.target.wants/systemd-pcrextend-initrd.service
fi

}

0 comments on commit 540ed46

Please sign in to comment.