OL9.9 grub2-common-2.06-134.0.1: 20-grub.install ignores DEFAULTKERNEL — installing RHCK steals the default from UEK

Abierto Apto para principiantes
#233 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
82/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
bash, linux, shell

Línea de trabajo

Empieza comparando /usr/lib/kernel/install.d/20-grub.install entre las versiones 2.06-127.0.1 y 2.06-134.0.1, centrándote en DEFAULTKERNEL y KERNEL_NAME. Sigue cómo se convierte tmp_saved_entry en la entrada predeterminada en 95-set-boot-entry.install y luego comprueba las pruebas relevantes del paquete, si las hay. El objetivo se alcanza cuando instalar RHCK con DEFAULTKERNEL=kernel-uek-core deja la entrada de arranque de UEK como predeterminada.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Environment

  • Oracle Linux 9.9, x86_64 (bare metal, BLS, GRUB_ENABLE_BLSCFG=true)
  • grub2-common-2.06-134.0.1.el9 (upgraded from 2.06-127.0.1.el9_8)
  • /etc/sysconfig/kernel: UPDATEDEFAULT=yes, DEFAULTKERNEL=kernel-uek-core
  • Both UEK (kernel-uek-core-5.15.0-326.224.5.1.el9uek) and RHCK (kernel-core) installed

What happened
A routine dnf-automatic update (9.8 → 9.9) installed kernel-core-5.14.0-741.20.1.el9_9 together with
grub2-*-2.06-134.0.1. After the reboot the system came up on RHCK 5.14.0-741.20.1.el9_9 instead of UEK;
grub2-editenv list shows saved_entry=<machine-id>-5.14.0-741.20.1.el9_9.x86_64.

Earlier RHCK updates on the same host (kernel-core-5.14.0-687.60.1/.61.1/.65.1/.66.1, all installed while
grub2 2.06-127.0.1 was present) did NOT change the default — the system stayed on UEK.

Root cause
/usr/lib/kernel/install.d/20-grub.install lost Oracle's DEFAULTKERNEL guard (Orabug 30643497,
"honor /etc/sysconfig/kernel DEFAULTKERNEL setting for BLS") when it was rebased onto Red Hat's 2.06-130 change
"Wait for initramfs and kernel to be installed before set default kernel" (tmp_saved_entry + 95-set-boot-entry.install):

--- 2.06-127.0.1.el9_8  20-grub.install
+++ 2.06-134.0.1.el9    20-grub.install
@@ -159,2 +159,2 @@
-            if [ -n "$NEWDEFAULT" ] && [ "$DEFAULTKERNEL" = "$KERNEL_NAME" ]; then
-                grub2-editenv - set "saved_entry=${NEWDEFAULT}"
+            if [ -n "$NEWDEFAULT" ]; then
+                grub2-editenv - set "tmp_saved_entry=${NEWDEFAULT}"

KERNEL_NAME is still computed but no longer used. 95-set-boot-entry.install then promotes
tmp_saved_entry to saved_entry unconditionally, so any newly installed kernel (RHCK included) becomes the
default. The 2.06-134.0.1 changelog still lists the Orabug 30643497 patch.

Expected
With DEFAULTKERNEL=kernel-uek-core, installing/updating RHCK must not change the default boot entry
(as with 2.06-127.0.1, and as documented: updates keep the installed kernel type).

Suggested fix
Restore the guard on the new line:

if [ -n "$NEWDEFAULT" ] && [ "$DEFAULTKERNEL" = "$KERNEL_NAME" ]; then
    grub2-editenv - set "tmp_saved_entry=${NEWDEFAULT}"

Reproduce

  1. OL9 with UEK default, DEFAULTKERNEL=kernel-uek-core, grub2-common-2.06-134.0.1.
  2. dnf install kernel-core-<newer RHCK> (or dnf reinstall).
  3. grubby --default-kernel → now the RHCK image.

Workaround
grubby --set-default /boot/vmlinuz-<uek-version> after each RHCK update, or exclude RHCK from updates.

Lenguaje dominante
Shell
Estrellas
180
Forks
52
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de oracle/oracle-linux

Todos los issues de oracle/oracle-linux

Issues similares

Más issues de Shell/Bash

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.