[elrepo] Bug in elrepo template and ?many? packages
Roger Sewell
roger.sewell at cantab.net
Wed Mar 3 14:49:13 EST 2021
Having had difficulty getting initramfs to build correctly when
upgrading kmod-megaraid_sas from 4.18.0-193.6.3 to a test kernel based
on 4.18.0-287, and again when downgrading, I think that I have found the
cause, as follows:
In the elrepo template at
http://elrepo.org/tiki/kmodspec-el8?highlight=template
there is a section of the %posttrans script reading
# The same check as in weak-modules: we assume that the kernel present
# if the symvers file exists.
if [ -e "/boot/symvers-$k.gz" ]; then
/usr/bin/dracut -f "$tmp_initramfs" "$k" || exit 1
However, the corresponding script /sbin/weak-modules from
kmod-25-16.el8.x86_64 contains the excerpt
# find_symvers_file:
# Since /boot/ files population process is now controlled by systemd's
# kernel-install bash script and its plug-ins, it might be the case
# that, while present, symvers file is not populated in /boot.
# Let's also check for /lib/modules/$kver/symvers.gz, since that's where
# it is populated from.
and when I change the %posttrans script in kmod-megaraid_sas to instead
of the above contain
# The same check as in weak-modules: we assume that the kernel present
# if the symvers file exists.
if [ -e "/boot/symvers-$k.gz" -o -e "/lib/modules/$k/symvers.gz" ]; then
/usr/bin/dracut -f "$tmp_initramfs" "$k" || exit 1
then my upgrading and downgrading between kernel versions works
correctly with yum upgrade and yum downgrade applied to the relevant
kmod-megaraid_sas package.
As far as I can see the same issue affects many other elrepo packages
also.
Please let me know whether or not you agree, as I am in no sense an
expert.
In addition, if anybody can explain to me
a) why yum/dnf appears to install the new version of a package before
removing the old version, and/or
b) what the purpose of the lines of the form
if rpm -q --filetriggers kmod 2> /dev/null| grep -q "Trigger for weak-modules call on kmod removal"; then
and the code paragraphs that follows them is, I would be most
grateful.
Many thanks,
Roger Sewell.
More information about the elrepo
mailing list