加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0148-Use-BLS-version-field-to-compare-entries-if-id-field.patch 1.02 KB
一键复制 编辑 原始数据 按行查看 历史
张彬琛 提交于 2021-01-20 13:34 . import grub2-2.02-81.el8.src.rpm
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <javierm@redhat.com>
Date: Fri, 27 Apr 2018 17:53:41 +0200
Subject: [PATCH] Use BLS version field to compare entries if id field isn't
defined
The BootLoaderSpec fragments generated by OSTree don't have the id field,
so grub2 will attempt to sort the entries by using the title field which
may not be correct. The entries do have a version field though so use it.
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---
grub-core/commands/blscfg.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/grub-core/commands/blscfg.c b/grub-core/commands/blscfg.c
index 6ab85df6b3a..c52d2b2e05a 100644
--- a/grub-core/commands/blscfg.c
+++ b/grub-core/commands/blscfg.c
@@ -418,6 +418,9 @@ static int bls_cmp(const void *p0, const void *p1, void *state UNUSED)
rc = bls_keyval_cmp (e0, e1, "id");
+ if (rc == 0)
+ rc = bls_keyval_cmp (e0, e1, "version");
+
if (rc == 0)
rc = bls_keyval_cmp (e0, e1, "title");
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化