View Issue Details

IDProjectCategoryView StatusLast Update
0017255CentOS-8kernelpublic2020-07-01 18:14
Reporterbitsbeats 
PriorityhighSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version8.1.1911 
Target VersionFixed in Version 
Summary0017255: grub2/grub.cfg not updated for new kernel: kernel-core-4.18.0-147.8.1.el8_1.x86_64
Descriptionyum update installs new kernel "kernel-core-4.18.0-147.8.1.el8_1.x86_64" but does not add it to grub.cfg

We tried to debug the root cause, this seems to be the scripts involved for a kernel update:

rpm script
----------
rpm -q --scripts kernel-core-4.18.0-147.8.1.el8_1.x86_64
postinstall scriptlet (using /bin/sh):

if [ `uname -i` == "x86_64" -o `uname -i` == "i386" ] &&
   [ -f /etc/sysconfig/kernel ]; then
  /bin/sed -r -i -e 's/^DEFAULTKERNEL=kernel-smp$/DEFAULTKERNEL=kernel/' /etc/sysconfig/kernel || exit $?
fi
preuninstall scriptlet (using /bin/sh):
/bin/kernel-install remove 4.18.0-147.8.1.el8_1.x86_64 /lib/modules/4.18.0-147.8.1.el8_1.x86_64/vmlinuz || exit $?
if [ -x /usr/sbin/weak-modules ]
then
    /usr/sbin/weak-modules --remove-kernel 4.18.0-147.8.1.el8_1.x86_64 || exit $?
fi
posttrans scriptlet (using /bin/sh):
if [ -x /usr/sbin/weak-modules ]
then
    /usr/sbin/weak-modules --add-kernel 4.18.0-147.8.1.el8_1.x86_64 || exit $?
fi
/bin/kernel-install add 4.18.0-147.8.1.el8_1.x86_64 /lib/modules/4.18.0-147.8.1.el8_1.x86_64/vmlinuz || exit $?
-------------

kernel-install script triggers all scripts:
-------------
 ls /usr/lib/kernel/install.d
20-grubby.install 20-grub.install 50-depmod.install 50-dracut.install 51-dracut-rescue.install 90-loaderentry.install 99-grub-mkconfig.install
 ls /etc/kernel/install.d
20-grubby.install 90-loaderentry.install
-------------

Only 99-grub-mkconfig.install got a grub2-mkconfig entry that will add the new kernel to the /boot/grub2/grub.cfg

There is an if statement:
-------------
# Is only needed for ppc64* since we can't assume a BLS capable bootloader there
if [[ $ARCH != "ppc64" && $ARCH != "ppc64le" ]]; then
    exit 0
fi
-------------

That will trigger and exit the script before grub2-mkconfig..

So any info on how grub.cfg update is done will be helpful =)

Steps To Reproduceyum install kernel-core-4.18.0-147.8.1.el8_1.x86_64
or
yum reinstall kernel-core-4.18.0-147.8.1.el8_1.x86_64
Additional Informationecho $ARCH
x86_64
Tagscentos 8, grub2, kernel, scanner

Activities

bitsbeats

bitsbeats

2020-07-01 10:02

reporter   ~0037284

Issue seems to be fixed, please close this ticket.
toracat

toracat

2020-07-01 18:14

manager   ~0037287

Closing as per user's report.

Issue History

Date Modified Username Field Change
2020-04-15 11:20 bitsbeats New Issue
2020-04-15 11:20 bitsbeats Tag Attached: centos 8
2020-04-15 11:20 bitsbeats Tag Attached: grub2
2020-04-15 11:20 bitsbeats Tag Attached: kernel
2020-04-15 11:20 bitsbeats Tag Attached: scanner
2020-07-01 10:02 bitsbeats Note Added: 0037284
2020-07-01 18:14 toracat Status new => closed
2020-07-01 18:14 toracat Resolution open => fixed
2020-07-01 18:14 toracat Note Added: 0037287