代码拉取完成,页面将自动刷新
同步操作将从 src-anolis-os/grub2 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <javierm@redhat.com>
Date: Wed, 18 Jul 2018 08:08:06 +0200
Subject: [PATCH] blscfg: Fallback to search BLS snippets in
/boot/loader/entries
The default path to search the BLS snippets is /loader/entries, this is
only a correct assumption if $root ($root) is a boot partition but it's
not true if /boot isn't a mount point.
A user can set a blsdir grub environment variable to choose a different
path, but instead of failing when /boot is a directory inside the root
partition fallback to search the BLS in /boot/loader/entries to cover
that case as well.
Reported-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---
grub-core/commands/blscfg.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/grub-core/commands/blscfg.c b/grub-core/commands/blscfg.c
index 80d8814fc..321c93069 100644
--- a/grub-core/commands/blscfg.c
+++ b/grub-core/commands/blscfg.c
@@ -692,6 +692,7 @@ static int find_entry (const char *filename,
grub_device_t blsdir_dev = NULL;
const char *blsdir = NULL;
char *saved_env_buf = NULL;
+ int fallback = 0;
int r = 0;
const char *devid = grub_env_get ("boot");
@@ -797,7 +798,9 @@ static int find_entry (const char *filename,
}
read_entry_info.dirname = blsdir;
- r = blsdir_fs->dir (blsdir_dev, blsdir, read_entry, &read_entry_info);
+read_fallback:
+ r = blsdir_fs->dir (blsdir_dev, read_entry_info.dirname, read_entry,
+ &read_entry_info);
if (r != 0) {
grub_dprintf ("blscfg", "read_entry returned error\n");
grub_err_t e;
@@ -807,6 +810,14 @@ static int find_entry (const char *filename,
} while (e);
}
+ if (!nentries && !fallback && info->platform != PLATFORM_EMU) {
+ read_entry_info.dirname = "/boot" GRUB_BLS_CONFIG_PATH;
+ grub_dprintf ("blscfg", "Entries weren't found in %s, fallback to %s\n",
+ blsdir, read_entry_info.dirname);
+ fallback = 1;
+ goto read_fallback;
+ }
+
grub_dprintf ("blscfg", "Sorting %d entries\n", nentries);
grub_qsort(&entries[0], nentries, sizeof (struct bls_entry *), bls_cmp, NULL);
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。