Handle instalaltion of kernel modules in another transaction

I first installed the kernel, then kernel-module-v4l2loopback-5.10-generic.
modinfo did not see it, I had to run depmod manually.
Move it to file trigger.
Remove absolute paths.
This commit is contained in:
Mikhail Novosyolov 2021-10-17 00:46:32 +03:00
parent 42e7e992a9
commit 69d33056c2

View file

@ -32,7 +32,7 @@
%define sublevel 73
# Release number. Increase this before a rebuild.
%define rpmrel 2
%define rpmrel 3
%define fullrpmrel %{rpmrel}
%define rpmtag %{disttag}
@ -535,18 +535,22 @@ input and output, etc. This is a general-purpose kernel.
# that is created then will be non-functional. But when the user installs
# kernel-<...> package, that defunct initrd will be replaced with a working
# one here.
#
# depmod is also needed, because some DKMS-modules might have been installed
# when the devel package was installed but that was before the main modules
# were installed.
# This is also the reason the devel package is in Requires(post) for this
# package now: it must be installed completely before we call depmod here.
/sbin/depmod -a %{kver_full}
/sbin/dracut -f %{initrd_path} %{kver_full}
dracut -f %{initrd_path} %{kver_full}
# File triggers from grub packages will handle this.
#/usr/sbin/update-grub2
%transfiletriggerin -- %{_modulesdir}/%{kver_full}
# Detect all modules, including ones inside kernel-module* packages
if grep -qE '/.*\.ko(|\..*)' ; then
depmod -a %{kver_full}
fi
%transfiletriggerpostun -- %{_modulesdir}/%{kver_full}
# Handle e.g. removal of kernel-module* packages
# List of files is not available here (?)
depmod -a %{kver_full}
%files -f %{kernel_files}
%{_bootdir}/System.map-%{kver_full}
%{_bootdir}/symvers-%{kver_full}.zst