From dc3cd7581afc4fb314777df02b04e6373a67b62a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavol=20=C5=BD=C3=A1=C4=8Dik?= Date: Fri, 14 Feb 2025 09:26:34 +0100 Subject: [PATCH] Only run modprobe in %post if the system is running When the package is installed e.g., in a bootc container, it does not make sense to load kernel modules because the kernel is not yet booted. Resolves: RHEL-78695 --- i2c-tools.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i2c-tools.spec b/i2c-tools.spec index f3f3d77..a5bd437 100644 --- a/i2c-tools.spec +++ b/i2c-tools.spec @@ -114,7 +114,7 @@ echo 'i2c-dev' > $RPM_BUILD_ROOT%{_prefix}/lib/modules-load.d/%{name}.conf %post # load i2c-dev after the first install -if [ "$1" = 1 ] ; then +if [ "$1" = 1 ] && systemctl is-system-running > /dev/null; then /usr/sbin/modprobe i2c-dev fi exit 0