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

オープン 初心者向け
#233 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
82/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
bash, linux, shell

調査の方向性

まず、2.06-127.0.1 と 2.06-134.0.1 の各バージョン間で /usr/lib/kernel/install.d/20-grub.install を比較し、DEFAULTKERNEL と KERNEL_NAME に注目します。95-set-boot-entry.install で tmp_saved_entry がどのように昇格されるかを追い、関連するパッケージテストがあれば確認します。DEFAULTKERNEL=kernel-uek-core を指定して RHCK をインストールした後も、UEK のブートエントリーがデフォルトになっていれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Shell
スター
180
フォーク
52
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

oracle/oracle-linux のほかの issue

oracle/oracle-linux の issue をすべて見る

似ている issue

Shell/Bash の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。