Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
OpenCorePKG_MOD
提交
9e76d919
O
OpenCorePKG_MOD
项目概览
btwise
/
OpenCorePKG_MOD
通知
26
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
OpenCorePKG_MOD
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9e76d919
编写于
2月 10, 2022
作者:
P
PMheart
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
OcAppleKernelLib: Disable trim using new method
closes
https://github.com/acidanthera/bugtracker/issues/1950
上级
b80c8ec3
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
50 addition
and
38 deletion
+50
-38
Changelog.md
Changelog.md
+2
-0
Docs/Configuration.md5
Docs/Configuration.md5
+1
-1
Docs/Configuration.pdf
Docs/Configuration.pdf
+0
-0
Docs/Configuration.tex
Docs/Configuration.tex
+3
-0
Docs/Differences/Differences.pdf
Docs/Differences/Differences.pdf
+0
-0
Docs/Differences/Differences.tex
Docs/Differences/Differences.tex
+8
-4
Docs/Errata/Errata.pdf
Docs/Errata/Errata.pdf
+0
-0
Library/OcAppleKernelLib/CommonPatches.c
Library/OcAppleKernelLib/CommonPatches.c
+36
-33
未找到文件。
Changelog.md
浏览文件 @
9e76d919
...
...
@@ -3,6 +3,8 @@ OpenCore Changelog
#### v0.7.9
-
Added auto-detect
`macOS Installer`
volume name for use when
`.disk_label`
file cannot be displayed
-
Added
`--restore-nosnoop`
flag to AudioDxe, making v0.7.7 fix for Windows sound opt-in
-
Added new method to disable trim when
`SetApfsTrimTimeout`
is set to zero
-
Fixed
`SetApfsTrimTimeout`
on macOS 12 (only works when set to zero)
#### v0.7.8
-
Updated ocvalidate to warn about insecure
`DmgLoading`
with secure
`SecureBootModel`
(already disallowed in runtime)
...
...
Docs/Configuration.md5
浏览文件 @
9e76d919
8fe92652e6b6bf444b97fb743cae2a52
63ebe375542ad0f079cc7071555dd405
Docs/Configuration.pdf
浏览文件 @
9e76d919
无法预览此类型文件
Docs/Configuration.tex
浏览文件 @
9e76d919
...
...
@@ -2748,6 +2748,9 @@ blocking.
\href
{
https://interface31.ru/tech
_
it/2015/04/mozhno-li-effektivno-ispolzovat-ssd-bez-podderzhki-trim.html
}{
article
}
for details.
As of macOS 12.0, it is no longer possible to set trim timeout for APFS filesystems.
However, trim can be disabled when the timeout value is set to
\texttt
{
0
}
.
\item
\texttt
{
ThirdPartyDrives
}
\\
\textbf
{
Type
}
:
\texttt
{
plist
\
boolean
}
\\
...
...
Docs/Differences/Differences.pdf
浏览文件 @
9e76d919
无法预览此类型文件
Docs/Differences/Differences.tex
浏览文件 @
9e76d919
\documentclass
[]
{
article
}
%DIF LATEXDIFF DIFFERENCE FILE
%DIF DEL PreviousConfiguration.tex
Wed Feb 9 09:37:10
2022
%DIF ADD ../Configuration.tex
Wed Feb 9 23:42:58
2022
%DIF DEL PreviousConfiguration.tex
Thu Feb 10 15:29:05
2022
%DIF ADD ../Configuration.tex
Thu Feb 10 19:56:56
2022
\usepackage
{
lmodern
}
\usepackage
{
amssymb,amsmath
}
...
...
@@ -118,7 +118,7 @@
%DIF HYPERREF PREAMBLE %DIF PREAMBLE
\providecommand
{
\DIFadd
}
[1]
{
\texorpdfstring
{
\DIFaddtex
{
#1
}}{
#1
}}
%DIF PREAMBLE
\providecommand
{
\DIFdel
}
[1]
{
\texorpdfstring
{
\DIFdeltex
{
#1
}}{}}
%DIF PREAMBLE
%DIF LISTINGS PREAMBLE %DIF PREAMBLE
%DIF
COLOR
LISTINGS PREAMBLE %DIF PREAMBLE
\RequirePackage
{
listings
}
%DIF PREAMBLE
\RequirePackage
{
color
}
%DIF PREAMBLE
\lstdefinelanguage
{
DIFcode
}{
%DIF PREAMBLE
...
...
@@ -2808,7 +2808,11 @@ blocking.
\href
{
https://interface31.ru/tech
_
it/2015/04/mozhno-li-effektivno-ispolzovat-ssd-bez-podderzhki-trim.html
}{
article
}
for details.
\item
\DIFaddbegin
\DIFadd
{
As of macOS 12.0, it is no longer possible to set trim timeout for APFS filesystems.
However, trim can be disabled when the timeout value is set to
}
\texttt
{
\DIFadd
{
0
}}
\DIFadd
{
.
}
\DIFaddend
\item
\texttt
{
ThirdPartyDrives
}
\\
\textbf
{
Type
}
:
\texttt
{
plist
\
boolean
}
\\
\textbf
{
Failsafe
}
:
\texttt
{
false
}
\\
...
...
Docs/Errata/Errata.pdf
浏览文件 @
9e76d919
无法预览此类型文件
Library/OcAppleKernelLib/CommonPatches.c
浏览文件 @
9e76d919
...
...
@@ -1979,45 +1979,38 @@ mApfsTimeoutPatch = {
.
Limit
=
0
};
STATIC
UINT8
mApfsTimeoutV2Find
[]
=
{
0x40
,
0x42
,
0x0F
,
0x00
};
VOID
PatchSetApfsTimeout
(
IN
UINT32
Timeout
)
{
// FIXME: This is really ugly, make quirks take a context param.
DEBUG
((
DEBUG_INFO
,
"OCAK: Registering %u APFS timeout
\n
"
,
Timeout
));
CopyMem
(
&
mApfsTimeoutReplace
[
2
],
&
Timeout
,
sizeof
(
Timeout
));
}
STATIC
UINT8
mApfsTimeoutV2Replace
[]
=
{
0x00
,
0x02
,
0x00
,
0x00
mApfsDisableTrimReplace
[]
=
{
0x31
,
0xC0
,
///< xor eax, eax
0xC3
///< ret
};
STATIC
PATCHER_GENERIC_PATCH
mApfs
TimeoutV2
Patch
=
{
.
Comment
=
DEBUG_POINTER
(
"ApfsTimeout
V2
"
),
.
Base
=
"_spaceman_
scan_free_blocks
"
,
.
Find
=
mApfsTimeoutV2Find
,
mApfs
DisableTrim
Patch
=
{
.
Comment
=
DEBUG_POINTER
(
"ApfsTimeout
disable trim
"
),
.
Base
=
"_spaceman_
iterate_free_extents_internal
"
,
.
Find
=
NULL
,
.
Mask
=
NULL
,
.
Replace
=
mApfs
TimeoutV2
Replace
,
.
Replace
=
mApfs
DisableTrim
Replace
,
.
ReplaceMask
=
NULL
,
.
Size
=
sizeof
(
mApfs
TimeoutV2Find
),
.
Count
=
2
,
.
Size
=
sizeof
(
mApfs
DisableTrimReplace
),
.
Count
=
1
,
.
Skip
=
0
,
.
Limit
=
4096
.
Limit
=
0
};
VOID
PatchSetApfsTimeout
(
IN
UINT32
Timeout
)
{
// FIXME: This is really ugly, make quirks take a context param.
DEBUG
((
DEBUG_INFO
,
"OCAK: Registering %u APFS timeout
\n
"
,
Timeout
));
CopyMem
(
&
mApfsTimeoutReplace
[
2
],
&
Timeout
,
sizeof
(
Timeout
));
CopyMem
(
&
mApfsTimeoutV2Replace
[
0
],
&
Timeout
,
sizeof
(
Timeout
));
}
STATIC
EFI_STATUS
PatchSetApfsTrimTimeout
(
...
...
@@ -2036,23 +2029,33 @@ PatchSetApfsTrimTimeout (
return
EFI_NOT_FOUND
;
}
if
(
KernelVersion
>=
KERNEL_VERSION_MONTEREY_MIN
)
{
Status
=
PatcherApplyGenericPatch
(
Patcher
,
&
mApfsTimeoutV2Patch
);
//
// Disable trim using another patch when timeout is 0.
//
if
(
mApfsTimeoutReplace
[
2
]
==
0
)
{
Status
=
PatcherApplyGenericPatch
(
Patcher
,
&
mApfsDisableTrimPatch
);
if
(
EFI_ERROR
(
Status
))
{
DEBUG
((
DEBUG_INFO
,
"OCAK: Failed to apply patch
SetApfsTrimTimeoutV2
- %r
\n
"
,
Status
));
DEBUG
((
DEBUG_INFO
,
"OCAK: Failed to apply patch
ApfsDisableTrim
- %r
\n
"
,
Status
));
}
else
{
DEBUG
((
DEBUG_INFO
,
"OCAK: Patch success
SetApfsTrimTimeoutV2
\n
"
));
DEBUG
((
DEBUG_INFO
,
"OCAK: Patch success
ApfsDisableTrim
\n
"
));
}
}
else
{
return
Status
;
}
if
(
KernelVersion
<
KERNEL_VERSION_MONTEREY_MIN
)
{
Status
=
PatcherApplyGenericPatch
(
Patcher
,
&
mApfsTimeoutPatch
);
if
(
EFI_ERROR
(
Status
))
{
DEBUG
((
DEBUG_INFO
,
"OCAK: Failed to apply patch SetApfsTrimTimeout - %r
\n
"
,
Status
));
}
else
{
DEBUG
((
DEBUG_INFO
,
"OCAK: Patch success SetApfsTrimTimeout
\n
"
));
}
return
Status
;
}
return
Status
;
DEBUG
((
DEBUG_INFO
,
"OCAK: Skipping patch SetApfsTrimTimeout on macOS 12.0+
\n
"
));
return
EFI_SUCCESS
;
}
//
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录