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

Đang mở Phù hợp với người mới
#233 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
82/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
bash, linux, shell
Lĩnh vực
operating-systems

Hướng nghiên cứu

Bắt đầu bằng cách so sánh /usr/lib/kernel/install.d/20-grub.install giữa các phiên bản 2.06-127.0.1 và 2.06-134.0.1, tập trung vào DEFAULTKERNEL và KERNEL_NAME. Theo dõi cách tmp_saved_entry được đặt làm mặc định trong 95-set-boot-entry.install, sau đó kiểm tra các bài kiểm thử liên quan của gói nếu có. Công việc được xem là hoàn tất khi cài đặt RHCK với DEFAULTKERNEL=kernel-uek-core vẫn để mục khởi động UEK làm mặc định.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Shell
Star
180
Fork
52
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của oracle/oracle-linux

Tất cả issue của oracle/oracle-linux

Issue tương tự

Thêm issue về Shell/Bash

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.