diff --git a/Changelog.md b/Changelog.md index eb2b6b7c..31cd24d3 100644 --- a/Changelog.md +++ b/Changelog.md @@ -12,6 +12,7 @@ OpenCore Changelog - Added `MISC_PWR_MGMT` patch to `AppleXcpmExtraMsrs` quirk (thx @mrmiller) - Added `DevirtualiseMmio` quirk to `Booter` section - Added FileVault 2 user interface protocols formerly in AppleUiSupport +- Improved kernel patch logging to include configuration comments #### v0.0.4 - Fixed kext injection issues with dummy dependencies diff --git a/Docs/Configuration.pdf b/Docs/Configuration.pdf index 84bcd45d..5ba06fd4 100644 Binary files a/Docs/Configuration.pdf and b/Docs/Configuration.pdf differ diff --git a/Docs/Configuration.tex b/Docs/Configuration.tex index 02055059..1588d5dc 100755 --- a/Docs/Configuration.tex +++ b/Docs/Configuration.tex @@ -582,6 +582,7 @@ Add \texttt{.clang\_complete} file with similar content to your UDK root: -Wno-sign-compare -Wno-varargs -Wno-unused-const-variable +-DOC_TARGET_NOOPT=1 \end{lstlisting} \textbf{Warning}: Tool developers modifying \texttt{config.plist} or any other OpenCore diff --git a/Docs/Differences/Differences.pdf b/Docs/Differences/Differences.pdf index 87760d5d..38dfad68 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 0fb1e435..b821b670 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 Sun Aug 11 01:57:12 2019 -%DIF ADD ../Configuration.tex Sat Aug 31 12:31:30 2019 +%DIF ADD ../Configuration.tex Sat Aug 31 22:14:59 2019 \usepackage{lmodern} \usepackage{amssymb,amsmath} @@ -624,7 +624,8 @@ approach could be \href{https://www.sublimetext.com}{Sublime Text} with \href{https://niosus.github.io/EasyClangComplete}{EasyClangComplete} plugin. Add \texttt{.clang\_complete} file with similar content to your UDK root: -\begin{lstlisting}[caption=ECC Configuration, label=eccfile, style=ocbash] +\DIFmodbegin +\begin{lstlisting}[caption=ECC Configuration, label=eccfile, style=ocbash,alsolanguage=DIFcode] -I/UefiPackages/MdePkg -I/UefiPackages/MdePkg/Include -I/UefiPackages/MdePkg/Include/X64 @@ -649,7 +650,9 @@ Add \texttt{.clang\_complete} file with similar content to your UDK root: -Wno-sign-compare -Wno-varargs -Wno-unused-const-variable +%DIF > -DOC_TARGET_NOOPT=1 \end{lstlisting} +\DIFmodend \textbf{Warning}: Tool developers modifying \texttt{config.plist} or any other OpenCore files must ensure that their tool checks for \texttt{opencore-version} NVRAM variable diff --git a/Include/OpenCore.h b/Include/OpenCore.h index e6f76d18..89ae5d9b 100644 --- a/Include/OpenCore.h +++ b/Include/OpenCore.h @@ -33,14 +33,14 @@ /** OpenCore build type reported to log and NVRAM. **/ -#if defined (OC_RELEASE_TARGET) +#if defined (OC_TARGET_RELEASE) #define OPEN_CORE_TARGET "REL" ///< Release. -#elif defined (OC_DEBUG_TARGET) +#elif defined (OC_TARGET_DEBUG) #define OPEN_CORE_TARGET "DBG" ///< Debug with compiler optimisations. -#elif defined (OC_NOOPT_TARGET) +#elif defined (OC_TARGET_NOOPT) #define OPEN_CORE_TARGET "NPT" ///< Debug with no compiler optimisations. #else -#define OPEN_CORE_TARGET "UNK" ///< This one should not happen in public builds. +#error "Unknown target definition" #endif #define OPEN_CORE_IMAGE_PATH L"EFI\\OC\\OpenCore.efi" diff --git a/OpenCorePkg.dsc b/OpenCorePkg.dsc index 72b84242..0b2067b2 100755 --- a/OpenCorePkg.dsc +++ b/OpenCorePkg.dsc @@ -121,12 +121,12 @@ DEFINE OCPKG_BUILD_OPTIONS_GEN = -D DISABLE_NEW_DEPRECATED_INTERFACES $(OCPKG_BUILD_OPTIONS) DEFINE OCPKG_ANAL_OPTIONS_GEN = -DANALYZER_UNREACHABLE='__builtin_unreachable' -DANALYZER_NORETURN='__attribute__((noreturn))' - GCC:DEBUG_*_*_CC_FLAGS = $(OCPKG_BUILD_OPTIONS_GEN) $(OCPKG_ANAL_OPTIONS_GEN) -D OC_DEBUG_TARGET - GCC:NOOPT_*_*_CC_FLAGS = $(OCPKG_BUILD_OPTIONS_GEN) $(OCPKG_ANAL_OPTIONS_GEN) -D OC_NOOPT_TARGET - GCC:RELEASE_*_*_CC_FLAGS = $(OCPKG_BUILD_OPTIONS_GEN) $(OCPKG_ANAL_OPTIONS_GEN) -D OC_RELEASE_TARGET - MSFT:DEBUG_*_*_CC_FLAGS = $(OCPKG_BUILD_OPTIONS_GEN) -D OC_DEBUG_TARGET - MSFT:NOOPT_*_*_CC_FLAGS = $(OCPKG_BUILD_OPTIONS_GEN) -D OC_NOOPT_TARGET - MSFT:RELEASE_*_*_CC_FLAGS = $(OCPKG_BUILD_OPTIONS_GEN) -D OC_RELEASE_TARGET - XCODE:DEBUG_*_*_CC_FLAGS = $(OCPKG_BUILD_OPTIONS_GEN) $(OCPKG_ANAL_OPTIONS_GEN) -D OC_DEBUG_TARGET - XCODE:NOOPT_*_*_CC_FLAGS = $(OCPKG_BUILD_OPTIONS_GEN) $(OCPKG_ANAL_OPTIONS_GEN) -D OC_NOOPT_TARGET - XCODE:RELEASE_*_*_CC_FLAGS = $(OCPKG_BUILD_OPTIONS_GEN) $(OCPKG_ANAL_OPTIONS_GEN) -D OC_RELEASE_TARGET -Oz -flto + GCC:DEBUG_*_*_CC_FLAGS = -D OC_TARGET_DEBUG=1 $(OCPKG_BUILD_OPTIONS_GEN) $(OCPKG_ANAL_OPTIONS_GEN) + GCC:NOOPT_*_*_CC_FLAGS = -D OC_TARGET_NOOPT=1 $(OCPKG_BUILD_OPTIONS_GEN) $(OCPKG_ANAL_OPTIONS_GEN) + GCC:RELEASE_*_*_CC_FLAGS = -D OC_TARGET_RELEASE=1 $(OCPKG_BUILD_OPTIONS_GEN) $(OCPKG_ANAL_OPTIONS_GEN) + MSFT:DEBUG_*_*_CC_FLAGS = -D OC_TARGET_DEBUG=1 $(OCPKG_BUILD_OPTIONS_GEN) + MSFT:NOOPT_*_*_CC_FLAGS = -D OC_TARGET_NOOPT=1 $(OCPKG_BUILD_OPTIONS_GEN) + MSFT:RELEASE_*_*_CC_FLAGS = -D OC_TARGET_RELEASE=1 $(OCPKG_BUILD_OPTIONS_GEN) + XCODE:DEBUG_*_*_CC_FLAGS = -D OC_TARGET_DEBUG=1 $(OCPKG_BUILD_OPTIONS_GEN) $(OCPKG_ANAL_OPTIONS_GEN) + XCODE:NOOPT_*_*_CC_FLAGS = -D OC_TARGET_NOOPT=1 $(OCPKG_BUILD_OPTIONS_GEN) $(OCPKG_ANAL_OPTIONS_GEN) + XCODE:RELEASE_*_*_CC_FLAGS = -D OC_TARGET_RELEASE=1 $(OCPKG_BUILD_OPTIONS_GEN) $(OCPKG_ANAL_OPTIONS_GEN) -Oz -flto diff --git a/Platform/OpenCore/OpenCoreKernel.c b/Platform/OpenCore/OpenCoreKernel.c index 58382534..342871a9 100644 --- a/Platform/OpenCore/OpenCoreKernel.c +++ b/Platform/OpenCore/OpenCoreKernel.c @@ -255,6 +255,10 @@ OcKernelApplyPatches ( ZeroMem (&Patch, sizeof (Patch)); + if (OC_BLOB_GET (&UserPatch->Comment)[0] != '\0') { + Patch.Comment = OC_BLOB_GET (&UserPatch->Comment); + } + if (OC_BLOB_GET (&UserPatch->Base)[0] != '\0') { Patch.Base = OC_BLOB_GET (&UserPatch->Base); }