From 6d6ac4e2d03a4b7d5e44319e14248511b754a98d Mon Sep 17 00:00:00 2001 From: Coiby Xu Date: Thu, 30 Oct 2025 08:46:12 +0800 Subject: [PATCH] ima-setup: skip installing rpm-plugin-ima if it has been installed Resolves: https://issues.redhat.com/browse/RHEL-99358 Upstream Status: RHEL-only Suggested-by: Marko Myllynen Signed-off-by: Coiby Xu --- ima-setup.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ima-setup.sh b/ima-setup.sh index a84fc4d..8223374 100755 --- a/ima-setup.sh +++ b/ima-setup.sh @@ -50,10 +50,12 @@ if [[ $# -eq 0 ]]; then usage fi -echo "Installing prerequisite package rpm-plugin-ima" -if ! dnf install rpm-plugin-ima -yq; then - echo "Failed to install rpm-plugin-ima, abort" - exit 1 +if ! rpm --quiet -q rpm-plugin-ima; then + echo "Installing prerequisite package rpm-plugin-ima" + if ! dnf install rpm-plugin-ima -yq; then + echo "Failed to install rpm-plugin-ima, abort" + exit 1 + fi fi # Add IMA signatures