Adjust scriplets that use /var/lib to use /usr/lib for ostree environments.

Resolves: rhbz#2105013

Signed-off-by: Susan LeGendre-McGhee <slegendr@redhat.com>
This commit is contained in:
Susan LeGendre-McGhee 2022-09-19 19:45:26 +00:00
parent 460499d5f8
commit 53ec985d27

View File

@ -1,7 +1,7 @@
%global commit 6077a128b887100e478048f67e6b8734cddd0ec7
%global gittag 8.2.0.18
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%define spec_release 46
%define spec_release 47
%define kmod_name kvdo
%define kmod_driver_version %{gittag}
@ -68,15 +68,15 @@ done
%post
modules=( $(find /lib/modules/%{kmod_headers_version}/extra/kmod-%{kmod_name} | grep '\.ko$') )
printf '%s\n' "${modules[@]}" >> /var/lib/rpm-kmod-posttrans-weak-modules-add
printf '%s\n' "${modules[@]}" >> /usr/lib/rpm-kmod-posttrans-weak-modules-add
%pretrans -p <lua>
posix.unlink("/var/lib/rpm-kmod-posttrans-weak-modules-add")
posix.unlink("/usr/lib/rpm-kmod-posttrans-weak-modules-add")
%posttrans
if [ -f "/var/lib/rpm-kmod-posttrans-weak-modules-add" ]; then
modules=( $(cat /var/lib/rpm-kmod-posttrans-weak-modules-add) )
rm -rf /var/lib/rpm-kmod-posttrans-weak-modules-add
if [ -f "/usr/lib/rpm-kmod-posttrans-weak-modules-add" ]; then
modules=( $(cat /usr/lib/rpm-kmod-posttrans-weak-modules-add) )
rm -rf /usr/lib/rpm-kmod-posttrans-weak-modules-add
printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --dracut=/usr/bin/dracut --add-modules
fi
@ -155,6 +155,10 @@ install -m 644 -D source/greylist.txt $RPM_BUILD_ROOT/usr/share/doc/kmod-%{kmod_
rm -rf $RPM_BUILD_ROOT
%changelog
* Mon Sep 19 2022 - Susan LeGendre-McGhee <slegendr@redhat.com> - 8.2.0.18-47.el9_2
- Adjust scriplets that use /var/lib to use /usr/lib for ostree environments.
- Resolves: rhbz#2105013
* Tue Sep 13 2022 - Andy Walsh <awalsh@redhat.com> - 8.2.0.18-46.el9_2
- Rebuilt for latest kernel.
- Related: rhbz#2119820