diff --git a/Changelog.md b/Changelog.md index 058602d4247286d95a62fa18ec232c15d09afa72..614eead5dcd98de9240b01d6e897972070d5de34 100644 --- a/Changelog.md +++ b/Changelog.md @@ -16,6 +16,7 @@ OpenCore Changelog - Fixed slide choice on platforms when 0 slide is unavailable, thx @zhen-zen - Fixed assertions caused by unaligned file path access in DEBUG builds - Renamed `ConfigValidity` utility to `ocvalidate` for consistency +- Added `GlobalConnect` for APFS loading to workaround older firmware issues #### v0.5.9 - Added full HiDPI support in OpenCanopy diff --git a/Docs/Configuration.pdf b/Docs/Configuration.pdf index 91bebf20ad777f8a58e23f199357750f87ff64ba..fda4ac520c89e3b10744b75bc0b502a43e0b26e3 100644 Binary files a/Docs/Configuration.pdf and b/Docs/Configuration.pdf differ diff --git a/Docs/Configuration.tex b/Docs/Configuration.tex index c09315fe273722ed93c881d4d7ee5ab3624152df..2101a383d252dda86f6b50e725e1ffe5c218d59c 100755 --- a/Docs/Configuration.tex +++ b/Docs/Configuration.tex @@ -4635,6 +4635,18 @@ functioning. Feature highlights: \texttt{ScanPolicy}. See more details in ``EFI Jumpstart'' section of \href{https://developer.apple.com/support/apple-file-system/Apple-File-System-Reference.pdf}{Apple File System Reference}. + +\item + \texttt{GlobalConnect}\\ + \textbf{Type}: \texttt{plist\ boolean}\\ + \textbf{Failsafe}: \texttt{false}\\ + \textbf{Description}: Perform full device connection during APFS loading. + + Instead of partition handle connection normally used for APFS driver loading + every handle is connected recursively. This may take more time than usual + but can be the only way to access APFS partitions on some firmwares like + those found on older HP laptops. + \item \texttt{HideVerbose}\\ \textbf{Type}: \texttt{plist\ boolean}\\ diff --git a/Docs/Differences/Differences.pdf b/Docs/Differences/Differences.pdf index 20d38551b2a8edd0f1c445af180873ed78666050..ae0a411b99bb1636f8820169f5f8aac50fa3058f 100644 Binary files a/Docs/Differences/Differences.pdf and b/Docs/Differences/Differences.pdf differ diff --git a/Docs/Differences/Differences.tex b/Docs/Differences/Differences.tex index 8ecc496d7853d3d7547ba6ae11a46f885166040c..25792cebf9286969a21fe61ab9ac0d7d1fb6701d 100644 --- a/Docs/Differences/Differences.tex +++ b/Docs/Differences/Differences.tex @@ -1,7 +1,7 @@ \documentclass[]{article} %DIF LATEXDIFF DIFFERENCE FILE %DIF DEL PreviousConfiguration.tex Tue Jun 2 03:55:18 2020 -%DIF ADD ../Configuration.tex Sun Jun 21 16:58:05 2020 +%DIF ADD ../Configuration.tex Mon Jun 22 00:02:42 2020 \usepackage{lmodern} \usepackage{amssymb,amsmath} @@ -4732,8 +4732,22 @@ functioning. Feature highlights: \texttt{ScanPolicy}. See more details in ``EFI Jumpstart'' section of \href{https://developer.apple.com/support/apple-file-system/Apple-File-System-Reference.pdf}{Apple File System Reference}. + +\item + \DIFaddbegin \texttt{\DIFadd{GlobalConnect}}\\ + \textbf{\DIFadd{Type}}\DIFadd{: }\texttt{\DIFadd{plist\ boolean}}\\ + \textbf{\DIFadd{Failsafe}}\DIFadd{: }\texttt{\DIFadd{false}}\\ + \textbf{\DIFadd{Description}}\DIFadd{: Perform full device connection during APFS loading. +} + + \DIFadd{Instead of partition handle connection normally used for APFS driver loading + every handle is connected recursively. This may take more time than usual + but can be the only way to access APFS partitions on some firmwares like + those found on older HP laptops. +} + \item - \texttt{HideVerbose}\\ + \DIFaddend \texttt{HideVerbose}\\ \textbf{Type}: \texttt{plist\ boolean}\\ \textbf{Failsafe}: \texttt{false}\\ \textbf{Description}: Hide verbose output from APFS driver. diff --git a/Docs/Errata/Errata.pdf b/Docs/Errata/Errata.pdf index 0a63500668f61d323485e0d1ddfb9c68659ccc6a..07f967e2b03c75ae9e91b6df29507170a18da890 100644 Binary files a/Docs/Errata/Errata.pdf and b/Docs/Errata/Errata.pdf differ diff --git a/Docs/Sample.plist b/Docs/Sample.plist index d5bb9babc852bc1fac419cff58958eb3c3c0fb1d..2c2ee78f9fda327237b1f9f2efceed917467c321 100644 --- a/Docs/Sample.plist +++ b/Docs/Sample.plist @@ -848,6 +848,8 @@ EnableJumpstart + GlobalConnect + HideVerbose JumpstartHotPlug diff --git a/Docs/SampleFull.plist b/Docs/SampleFull.plist index 62f5f5379ba85ceb7ab3e5ede9975778a833d593..c749e59bdfd09e21695b41da820f894745fb29d1 100644 --- a/Docs/SampleFull.plist +++ b/Docs/SampleFull.plist @@ -951,6 +951,8 @@ EnableJumpstart + GlobalConnect + HideVerbose JumpstartHotPlug diff --git a/Include/Acidanthera/Library/OcApfsLib.h b/Include/Acidanthera/Library/OcApfsLib.h index f3826cce2457f2d5f7f8459daf3fd63614ca601f..a04c5fbe554bae75801cf793f8dd2f4cffa5bc75 100644 --- a/Include/Acidanthera/Library/OcApfsLib.h +++ b/Include/Acidanthera/Library/OcApfsLib.h @@ -57,6 +57,7 @@ @param[in] MinVersion Minimal allowed APFS driver version to load. @param[in] MinDate Minimal allowed APFS driver date to load. @param[in] ScanPolicy OpenCore scan policy. + @param[in] GlobalConnect Perform global device connection for APFS. @param[in] IgnoreVerbose Avoid APFS driver verbose output. **/ VOID @@ -64,6 +65,7 @@ OcApfsConfigure ( IN UINT64 MinVersion, IN UINT32 MinDate, IN UINT32 ScanPolicy, + IN BOOLEAN GlobalConnect, IN BOOLEAN IgnoreVerbose ); diff --git a/Include/Acidanthera/Library/OcConfigurationLib.h b/Include/Acidanthera/Library/OcConfigurationLib.h index e6401df4a1f2e26ec2ba59d573d18ff3fe30cd5a..56a6a9cd6a45eab98655a059ef1452ed344c266d 100644 --- a/Include/Acidanthera/Library/OcConfigurationLib.h +++ b/Include/Acidanthera/Library/OcConfigurationLib.h @@ -479,6 +479,7 @@ typedef enum { _(UINT64 , MinVersion , , 0 , ()) \ _(UINT32 , MinDate , , 0 , ()) \ _(BOOLEAN , EnableJumpstart , , FALSE , ()) \ + _(BOOLEAN , GlobalConnect , , FALSE , ()) \ _(BOOLEAN , HideVerbose , , FALSE , ()) \ _(BOOLEAN , JumpstartHotPlug , , FALSE , ()) OC_DECLARE (OC_UEFI_APFS) diff --git a/Library/OcApfsLib/OcApfsConnect.c b/Library/OcApfsLib/OcApfsConnect.c index 765f66624911e7f13f734b186a7221006b29a09d..1338a25bbbb223e6437f719f736707d45cb313aa 100644 --- a/Library/OcApfsLib/OcApfsConnect.c +++ b/Library/OcApfsLib/OcApfsConnect.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -34,6 +35,7 @@ STATIC UINT64 mApfsMinimalVersion = OC_APFS_VERSION_DEFAULT; STATIC UINT32 mApfsMinimalDate = OC_APFS_DATE_DEFAULT; STATIC UINT32 mOcScanPolicy; STATIC BOOLEAN mIgnoreVerbose; +STATIC BOOLEAN mGlobalConnect; STATIC EFI_SYSTEM_TABLE *mNullSystemTable; // @@ -327,12 +329,23 @@ ApfsStartDriver ( return Status; } - // - // Recursively connect controller to get apfs.efi loaded. - // We cannot use apfs.efi handle as it apparently creates new handles. - // This follows ApfsJumpStart driver implementation. - // - gBS->ConnectController (PrivateData->LocationInfo.ControllerHandle, NULL, NULL, TRUE); + if (mGlobalConnect) { + // + // Connect all devices when implicitly requested. This is a workaround + // for some older HP laptops, which for some reason fail to connect by both + // drive and partition handles. + // REF: https://github.com/acidanthera/bugtracker/issues/960 + // + OcConnectDrivers (); + } else { + // + // Recursively connect controller to get apfs.efi loaded. + // We cannot use apfs.efi handle as it apparently creates new handles. + // This follows ApfsJumpStart driver implementation. + // + gBS->ConnectController (PrivateData->LocationInfo.ControllerHandle, NULL, NULL, TRUE); + } + return EFI_SUCCESS; } @@ -391,6 +404,7 @@ OcApfsConfigure ( IN UINT64 MinVersion, IN UINT32 MinDate, IN UINT32 ScanPolicy, + IN BOOLEAN GlobalConnect, IN BOOLEAN IgnoreVerbose ) { @@ -413,8 +427,9 @@ OcApfsConfigure ( mApfsMinimalDate = MinDate; } - mOcScanPolicy = ScanPolicy; - mIgnoreVerbose = IgnoreVerbose; + mOcScanPolicy = ScanPolicy; + mIgnoreVerbose = IgnoreVerbose; + mGlobalConnect = GlobalConnect; } EFI_STATUS diff --git a/Library/OcApfsLib/OcApfsLib.inf b/Library/OcApfsLib/OcApfsLib.inf index 310d13c34d87342f69e6e70b56fc427f28cc5788..5a0dab044f784c943b60abf0759f7b57611cf136 100644 --- a/Library/OcApfsLib/OcApfsLib.inf +++ b/Library/OcApfsLib/OcApfsLib.inf @@ -57,6 +57,7 @@ DebugLib OcAppleImageVerificationLib OcConsoleLib + OcDriverConnectionLib OcGuardLib OcMiscLib MemoryAllocationLib diff --git a/Library/OcConfigurationLib/OcConfigurationLib.c b/Library/OcConfigurationLib/OcConfigurationLib.c index d104894417764a5f100b6a76e6025b91460e10b4..585c188d542a3d6afc27e9b70a942049d8430890 100644 --- a/Library/OcConfigurationLib/OcConfigurationLib.c +++ b/Library/OcConfigurationLib/OcConfigurationLib.c @@ -566,6 +566,7 @@ STATIC OC_SCHEMA mUefiApfsSchema[] = { OC_SCHEMA_BOOLEAN_IN ("EnableJumpstart", OC_GLOBAL_CONFIG, Uefi.Apfs.EnableJumpstart), + OC_SCHEMA_BOOLEAN_IN ("GlobalConnect", OC_GLOBAL_CONFIG, Uefi.Apfs.GlobalConnect), OC_SCHEMA_BOOLEAN_IN ("HideVerbose", OC_GLOBAL_CONFIG, Uefi.Apfs.HideVerbose), OC_SCHEMA_BOOLEAN_IN ("JumpstartHotPlug", OC_GLOBAL_CONFIG, Uefi.Apfs.JumpstartHotPlug), OC_SCHEMA_INTEGER_IN ("MinDate", OC_GLOBAL_CONFIG, Uefi.Apfs.MinDate), diff --git a/Platform/OpenCore/OpenCoreUefi.c b/Platform/OpenCore/OpenCoreUefi.c index 337cb6584f8f000a9751b6e722ffc109305bcd3e..fc7425f69bc8f1133d82fa13b06efb22fbcfae81 100644 --- a/Platform/OpenCore/OpenCoreUefi.c +++ b/Platform/OpenCore/OpenCoreUefi.c @@ -538,6 +538,7 @@ OcLoadUefiSupport ( Config->Uefi.Apfs.MinVersion, Config->Uefi.Apfs.MinDate, Config->Misc.Security.ScanPolicy, + Config->Uefi.Apfs.GlobalConnect, Config->Uefi.Apfs.HideVerbose );