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
This commit is contained in:
parent
a51b046922
commit
dc3cd7581a
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user