Skip to main content
add a workaround
Source Link
maxschlepzig
  • 59.7k
  • 53
  • 224
  • 298

This is a well known bug:

To determine how a kernel package updates grub.cfg one can display the scripts via:

$ yum whatprovides /boot/vmlinuz-3.10.0-123.9.3.el7.x86_64
kernel-3.10.0-123.9.3.el7.x86_64 : The Linux kernel
[..]
$ rpm -q --scripts kernel-3.10.0-123.9.3.el7.x86_64

This shows that /usr/sbin/new-kernel-pkg is called - which in turn calls grubby.

Workaround

(until it is fixed in RHEL/CentOS)


--- /usr/share/grub/grub-mkconfig_lib.orig  2014-06-30 18:16:11.000000000 +0200
+++ /usr/share/grub/grub-mkconfig_lib       2014-11-26 17:38:57.814000000 +0100
@@ -255,13 +255,24 @@
 
 version_find_latest ()
 {
-  version_find_latest_a=""
-  for i in "$@" ; do
-    if version_test_gt "$i" "$version_find_latest_a" ; then
-      version_find_latest_a="$i"
-    fi
-  done
-  echo "$version_find_latest_a"
+  # workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1124074
+  # 'grub2-mkconfig wrong sorting'
+  {
+    for i in "$@"; do
+      echo $i
+    done | grep -v rescue | sort -V
+    for i in "$@"; do
+      echo $i
+    done | grep rescue | sort -V
+  } | head -n 1
 }

This is a well known bug:

To determine how a kernel package updates grub.cfg one can display the scripts via:

$ yum whatprovides /boot/vmlinuz-3.10.0-123.9.3.el7.x86_64
kernel-3.10.0-123.9.3.el7.x86_64 : The Linux kernel
[..]
$ rpm -q --scripts kernel-3.10.0-123.9.3.el7.x86_64

This shows that /usr/sbin/new-kernel-pkg is called - which in turn calls grubby.

This is a well known bug:

To determine how a kernel package updates grub.cfg one can display the scripts via:

$ yum whatprovides /boot/vmlinuz-3.10.0-123.9.3.el7.x86_64
kernel-3.10.0-123.9.3.el7.x86_64 : The Linux kernel
[..]
$ rpm -q --scripts kernel-3.10.0-123.9.3.el7.x86_64

This shows that /usr/sbin/new-kernel-pkg is called - which in turn calls grubby.

Workaround

(until it is fixed in RHEL/CentOS)


--- /usr/share/grub/grub-mkconfig_lib.orig  2014-06-30 18:16:11.000000000 +0200
+++ /usr/share/grub/grub-mkconfig_lib       2014-11-26 17:38:57.814000000 +0100
@@ -255,13 +255,24 @@
 
 version_find_latest ()
 {
-  version_find_latest_a=""
-  for i in "$@" ; do
-    if version_test_gt "$i" "$version_find_latest_a" ; then
-      version_find_latest_a="$i"
-    fi
-  done
-  echo "$version_find_latest_a"
+  # workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1124074
+  # 'grub2-mkconfig wrong sorting'
+  {
+    for i in "$@"; do
+      echo $i
+    done | grep -v rescue | sort -V
+    for i in "$@"; do
+      echo $i
+    done | grep rescue | sort -V
+  } | head -n 1
 }
add grubby info
Source Link
maxschlepzig
  • 59.7k
  • 53
  • 224
  • 298

This is a well known bug:

Still unclear what command is used for regeneratingTo determine how a kernel package updates grub.cfg during regular kernel updatesone can display the scripts via:

$ yum whatprovides /boot/vmlinuz-3.10.0-123.9.3.el7.x86_64
kernel-3.10.0-123.9.3.el7.x86_64 : The Linux kernel
[..]
$ rpm -q --scripts kernel-3.10.0-123.9.3.el7.x86_64

This shows that /usr/sbin/new-kernel-pkg is called - which in turn calls grubby.

This is a well known bug:

Still unclear what command is used for regenerating grub.cfg during regular kernel updates.

This is a well known bug:

To determine how a kernel package updates grub.cfg one can display the scripts via:

$ yum whatprovides /boot/vmlinuz-3.10.0-123.9.3.el7.x86_64
kernel-3.10.0-123.9.3.el7.x86_64 : The Linux kernel
[..]
$ rpm -q --scripts kernel-3.10.0-123.9.3.el7.x86_64

This shows that /usr/sbin/new-kernel-pkg is called - which in turn calls grubby.

Source Link
maxschlepzig
  • 59.7k
  • 53
  • 224
  • 298

This is a well known bug:

Still unclear what command is used for regenerating grub.cfg during regular kernel updates.