加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
grub2-getroot-scan-disk-pv.patch 1.20 KB
一键复制 编辑 原始数据 按行查看 历史
zhangqiumiao 提交于 2024-03-04 03:17 . update to 2.12
From: Michael Chang <mchang@suse.com>
Subject: Fix grub2-mkconfig warning when disk is LVM PV
References: bsc#1071239
When a disk device was found in grub_util_biosdisk_get_grub_dev, its grub
hostdisk device name just returned. Since the disk could also be used as PV
disk, use grub_util_get_ldm to kick scanning of on disk metadata and adding it
to VG array.
---
Index: grub-2.02/util/getroot.c
===================================================================
--- grub-2.02.orig/util/getroot.c
+++ grub-2.02/util/getroot.c
@@ -272,8 +272,28 @@ grub_util_biosdisk_get_grub_dev (const c
grub_util_info ("%s is a parent of %s", sys_disk, os_dev);
if (!is_part)
{
+#if defined(__APPLE__)
free (sys_disk);
return make_device_name (drive);
+#else
+ char *name, *ldm_name;
+ grub_disk_t disk;
+
+ free (sys_disk);
+ name = make_device_name (drive);
+ disk = grub_disk_open (name);
+ if (!disk)
+ return name;
+ ldm_name = grub_util_get_ldm (disk, 0);
+ if (ldm_name)
+ {
+ grub_disk_close (disk);
+ grub_free (name);
+ return ldm_name;
+ }
+ grub_disk_close (disk);
+ return name;
+#endif
}
free (sys_disk);
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化