1 Star 0 Fork 16

jackzhao166/grub2

forked from OpenCloudOS Stream/grub2 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0225-Add-more-dprintf-and-nerf-dprintf-in-script.c.patch 2.53 KB
一键复制 编辑 原始数据 按行查看 历史
nilusyi 提交于 2024-04-07 16:45 . update patches
From 6c277b3935da3a20fe5be7aad019ca4405516437 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Tue, 11 Sep 2018 15:58:29 -0400
Subject: [PATCH 225/272] Add more dprintf, and nerf dprintf in script.c
Signed-off-by: Peter Jones <pjones@redhat.com>
---
grub-core/disk/diskfilter.c | 3 +++
grub-core/disk/efi/efidisk.c | 1 +
grub-core/kern/device.c | 1 +
grub-core/script/script.c | 5 +++++
4 files changed, 10 insertions(+)
diff --git a/grub-core/disk/diskfilter.c b/grub-core/disk/diskfilter.c
index 1e44e3add..8c4345668 100644
--- a/grub-core/disk/diskfilter.c
+++ b/grub-core/disk/diskfilter.c
@@ -281,6 +281,8 @@ scan_disk (const char *name, int accept_diskfilter)
grub_disk_t disk;
static int scan_depth = 0;
+ grub_dprintf ("diskfilter", "scanning %s\n", name);
+
if (!accept_diskfilter && is_valid_diskfilter_name (name))
return 0;
@@ -1396,6 +1398,7 @@ insert_array (grub_disk_t disk, const struct grub_diskfilter_pv_id *id,
the same. */
if (pv->disk && grub_disk_native_sectors (disk) >= grub_disk_native_sectors (pv->disk))
return GRUB_ERR_NONE;
+ grub_dprintf ("diskfilter", "checking %s\n", disk->name);
if (disk->partition)
{
char *p = grub_partition_get_name (disk->partition);
diff --git a/grub-core/disk/efi/efidisk.c b/grub-core/disk/efi/efidisk.c
index 3b5ed5691..822005456 100644
--- a/grub-core/disk/efi/efidisk.c
+++ b/grub-core/disk/efi/efidisk.c
@@ -865,6 +865,7 @@ grub_efidisk_get_device_name (grub_efi_handle_t *handle)
return 0;
}
+ grub_dprintf ("efidisk", "getting disk for %s\n", device_name);
parent = grub_disk_open (device_name);
grub_free (dup_dp);
diff --git a/grub-core/kern/device.c b/grub-core/kern/device.c
index 670e213cf..d01963747 100644
--- a/grub-core/kern/device.c
+++ b/grub-core/kern/device.c
@@ -34,6 +34,7 @@ grub_device_open (const char *name)
{
grub_device_t dev = 0;
+ grub_dprintf ("device", "opening device %s\n", name);
if (! name)
{
name = grub_env_get ("root");
diff --git a/grub-core/script/script.c b/grub-core/script/script.c
index ec4d4337c..844e8343c 100644
--- a/grub-core/script/script.c
+++ b/grub-core/script/script.c
@@ -22,6 +22,11 @@
#include <grub/parser.h>
#include <grub/mm.h>
+#ifdef grub_dprintf
+#undef grub_dprintf
+#endif
+#define grub_dprintf(no, fmt, ...)
+
/* It is not possible to deallocate the memory when a syntax error was
found. Because of that it is required to keep track of all memory
allocations. The memory is freed in case of an error, or assigned
--
2.41.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jackzhao166/grub2.git
git@gitee.com:jackzhao166/grub2.git
jackzhao166
grub2
grub2
master

搜索帮助