1 Star 0 Fork 100

陈亚强/grub2

forked from src-openEuler/grub2 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
osdep-freebsd-Fix-partition-calculation-for-EBR-entr.patch 1.49 KB
一键复制 编辑 原始数据 按行查看 历史
hexiaowen 提交于 2019-09-30 10:52 . Package init
From 222cb8f6df4f0e5964a5dfcdc9a4eb9ad2e631a6 Mon Sep 17 00:00:00 2001
From: James Clarke <[email protected]>
Date: Tue, 26 Feb 2019 18:40:14 +0000
Subject: [PATCH 266/270] osdep/freebsd: Fix partition calculation for EBR
entries
For EBR partitions, "start" is the relative starting sector of the EBR
header itself, whereas "offset" is the relative starting byte of the
partition's contents, excluding the EBR header and any padding. Thus we
must use "offset", and divide by the sector size to convert to sectors.
Fixes Debian bug #923253.
Signed-off-by: James Clarke <[email protected]>
Reviewed-by: Colin Watson <[email protected]>
Reviewed-by: Daniel Kiper <[email protected]>
---
grub-core/osdep/freebsd/getroot.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/grub-core/osdep/freebsd/getroot.c b/grub-core/osdep/freebsd/getroot.c
index ccc1d70..b1e8244 100644
--- a/grub-core/osdep/freebsd/getroot.c
+++ b/grub-core/osdep/freebsd/getroot.c
@@ -338,8 +338,8 @@ grub_util_follow_gpart_up (const char *name, grub_disk_addr_t *off_out, char **n
grub_util_follow_gpart_up (name_tmp, &off, name_out);
free (name_tmp);
LIST_FOREACH (config, &provider->lg_config, lg_config)
- if (strcasecmp (config->lg_name, "start") == 0)
- off += strtoull (config->lg_val, 0, 10);
+ if (strcasecmp (config->lg_name, "offset") == 0)
+ off += strtoull (config->lg_val, 0, 10) / provider->lg_sectorsize;
if (off_out)
*off_out = off;
return;
--
1.8.3.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yaqiangchen/grub2.git
[email protected]:yaqiangchen/grub2.git
yaqiangchen
grub2
grub2
master

搜索帮助