diff options
| author | Mikko Rapeli <mikko.rapeli@linaro.org> | 2025-05-19 15:56:37 +0100 |
|---|---|---|
| committer | Armin Kuster <akuster808@gmail.com> | 2025-06-23 09:05:21 -0400 |
| commit | 4082afb8a911a03d720a1be9aa35a5fa3678055f (patch) | |
| tree | 5e4b610d7a85332a103ddd131a76e0e0835567a3 | |
| parent | 5b6ea2a099b2f6ebbe3a2872d4b36db3012920df (diff) | |
| download | meta-security-4082afb8a911a03d720a1be9aa35a5fa3678055f.tar.gz | |
systemd: fix empty file list with sed
If measured-uki support is not enabled or build is continuing
from previous stages, then the matching file list can be empty.
Fixes build failure where sed says no input files.
Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
| -rw-r--r-- | meta-tpm/recipes-core/systemd/systemd_%.bbappend | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/meta-tpm/recipes-core/systemd/systemd_%.bbappend b/meta-tpm/recipes-core/systemd/systemd_%.bbappend index 82b79ba..867c111 100644 --- a/meta-tpm/recipes-core/systemd/systemd_%.bbappend +++ b/meta-tpm/recipes-core/systemd/systemd_%.bbappend | |||
| @@ -11,7 +11,10 @@ PACKAGECONFIG:append = " \ | |||
| 11 | # TODO: use swtpm-native to calculate TPM measurements | 11 | # TODO: use swtpm-native to calculate TPM measurements |
| 12 | do_install:append() { | 12 | do_install:append() { |
| 13 | if "${@bb.utils.contains('DISTRO_FEATURES', 'tpm2', 'true', 'false', d)}"; then | 13 | if "${@bb.utils.contains('DISTRO_FEATURES', 'tpm2', 'true', 'false', d)}"; then |
| 14 | sed -i -e "s/^ConditionSecurity=measured-uki/ConditionSecurity=tpm2/g" \ | 14 | FILES=$( grep -rl ^ConditionSecurity=measured-uki ${D} || true ) |
| 15 | $( grep -rl ^ConditionSecurity=measured-uki ${D} ) | 15 | if [ "$FILES" != "" ]; then |
| 16 | sed -i -e "s/^ConditionSecurity=measured-uki/ConditionSecurity=tpm2/g" \ | ||
| 17 | $FILES | ||
| 18 | fi | ||
| 16 | fi | 19 | fi |
| 17 | } | 20 | } |
