Bug 1124074
Summary: | grub2-mkconfig wrong sorting | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | amit yadav <ayadav> | ||||
Component: | grub2 | Assignee: | rmarshall | ||||
Status: | CLOSED ERRATA | QA Contact: | Release Test Team <release-test-team-automation> | ||||
Severity: | urgent | Docs Contact: | Petr Bokoc <pbokoc> | ||||
Priority: | urgent | ||||||
Version: | 7.2 | CC: | admiller, ajb, bloch, bugreports2005, cww, fedora, fkrska, hartsjc, jkurik, kdreyer, lukebenes, mbanas, md, mkolbas, mvermaes, ncrawfor, olchansk, opensource, pdwyer, phil, pjanda, pl.totev, rainer.traut, rbinkhor, redhat-bugzilla, rmarshall, schlichting, sreber, tgummels, t.h.amundsen, toracat | ||||
Target Milestone: | rc | Keywords: | ZStream | ||||
Target Release: | --- | ||||||
Hardware: | Unspecified | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: |
Improved sorting of GRUB2 boot menu
An issue with the sorting mechanism used by the "grub2-mkconfig" command could cause the grub.cfg configuration file to be generated with available kernels sorted incorrectly.
GRUB2 now uses the _rpmdevtools_ package to sort available kernels and the configuration file is being generated correctly with the most recent kernel version listed at the top.
|
Story Points: | --- | ||||
Clone Of: | |||||||
: | 1229329 1249668 (view as bug list) | Environment: | |||||
Last Closed: | 2015-11-19 12:23:28 UTC | Type: | Bug | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Bug Depends On: | |||||||
Bug Blocks: | 1133060, 1205794, 1229329 | ||||||
Attachments: |
|
Description
amit yadav
2014-07-28 23:21:02 UTC
I'm seeing this behavior as well. After updating/installing the latest kernel and rebooting I still see the following output from yum: Security: kernel-3.10.0-123.6.3.el7.x86_64 is an installed security update Security: kernel-3.10.0-123.el7.x86_64 is the currently running version The work around described here seems to work: https://access.redhat.com/solutions/1145853 Not sure about the workaround, I thought that the sort fails because the "e" of "el7" in "123.el7.x86_64" wins over numbers when compared to the three-level deep revisions of the latter kernels. The comparison is version_test_gt() in /usr/share/grub/grub-mkconfig_lib, and at least this quick modification that simply crops off from .el7 appeared to result in correct ordering: version_test_gt_a="`echo "$1" | sed -e "s/[^-]*-//" -e "s/\.el[0-9].*//"`" version_test_gt_b="`echo "$2" | sed -e "s/[^-]*-//" -e "s/\.el[0-9].*//"`" potentially related https://bugzilla.redhat.com/show_bug.cgi?id=1154430 The problem is .x86_64 on the end. I created a patch that works around this issue. I tested it actual numbers 123, 123.6.3, and 123.9.3. I also tested it with actual numbers and made up numbers like 122 and 124. It does the right thing in both cases. I also formatted my patch be friendly with adding the the src.rpm. Created attachment 966036 [details]
Workaround patch for version sorting
*** Bug 1154430 has been marked as a duplicate of this bug. *** This bug also affects Fedora 21. It is just that Fedora has stuck to simpler/shorter release numbers for kernel packages. I made a custom kernel, kernel-core-3.17.6-300.11.fc21.x86_64, based on kernel-core-3.17.6-300.fc21.x86_64. It has the same issue with grub2. The reason is that grub-mkconfig_lib user sort -V to compare the order of two versions and the GNU implementation does not recognizes suffixes that contain '_' such as x86_64. The bug is reported on the GRUB site - https://savannah.gnu.org/bugs/?42844 I've provided more detailed explanation and patch there Hi Robert, I have updated Doc Text to prepare it for 7.2 Beta Release Notes. Please review the Doc Text field and let me know whether it's correct or if there's anything you would like to add or change. reproduced on RHEL-7.1 with grub2-tools-2.02-0.16.el7.x86_64 verified with grub2-tools-2.02-0.25.el7.x86_64 from RHEL-7.2-20150820.0 Petr Bokoc - Doc Text looks fine to me. *** Bug 1260555 has been marked as a duplicate of this bug. *** Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHSA-2015-2401.html |