From 4082afb8a911a03d720a1be9aa35a5fa3678055f Mon Sep 17 00:00:00 2001 From: Mikko Rapeli Date: Mon, 19 May 2025 15:56:37 +0100 Subject: 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 Signed-off-by: Armin Kuster --- meta-tpm/recipes-core/systemd/systemd_%.bbappend | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'meta-tpm/recipes-core') 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 = " \ # TODO: use swtpm-native to calculate TPM measurements do_install:append() { if "${@bb.utils.contains('DISTRO_FEATURES', 'tpm2', 'true', 'false', d)}"; then - sed -i -e "s/^ConditionSecurity=measured-uki/ConditionSecurity=tpm2/g" \ - $( grep -rl ^ConditionSecurity=measured-uki ${D} ) + FILES=$( grep -rl ^ConditionSecurity=measured-uki ${D} || true ) + if [ "$FILES" != "" ]; then + sed -i -e "s/^ConditionSecurity=measured-uki/ConditionSecurity=tpm2/g" \ + $FILES + fi fi } -- cgit v1.2.3-54-g00ecf