Skip to content

Commit

Permalink
Fix macOS 13+ recovery and installer detection
Browse files Browse the repository at this point in the history
  • Loading branch information
vit9696 committed May 7, 2023
1 parent f07e333 commit d3ed12a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
3 changes: 3 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Lilu Changelog
==============
#### v1.6.5
- Fixed macOS 13+ recovery and installer detection

#### v1.6.4
- Added AMD IGPU detection

Expand Down
20 changes: 15 additions & 5 deletions Lilu/Sources/kern_start.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

#include <IOKit/IOLib.h>
#include <IOKit/IORegistryEntry.h>
#include <IOKit/IODeviceTreeSupport.h>

#include <mach/mach_types.h>

OSDefineMetaClassAndStructors(PRODUCT_NAME, IOService)
Expand Down Expand Up @@ -274,11 +276,19 @@ bool Configuration::getBootArguments() {

allowDecompress = !checkKernelArgument(bootargLowMem);

installOrRecovery |= checkKernelArgument("rp0");
installOrRecovery |= checkKernelArgument("rp");
installOrRecovery |= checkKernelArgument("container-dmg");
installOrRecovery |= checkKernelArgument("root-dmg");
installOrRecovery |= checkKernelArgument("auth-root-dmg");
auto entry = IORegistryEntry::fromPath("/chosen", gIODTPlane);
if (entry) {
installOrRecovery = entry->getProperty("boot-ramdmg-extents") != nullptr;
entry->release();
}

if (!installOrRecovery && getKernelVersion() < KernelVersion::Ventura) {
installOrRecovery |= checkKernelArgument("rp0");
installOrRecovery |= checkKernelArgument("rp");
installOrRecovery |= checkKernelArgument("container-dmg");
installOrRecovery |= checkKernelArgument("root-dmg");
installOrRecovery |= checkKernelArgument("auth-root-dmg");
}

safeMode = checkKernelArgument("-x");

Expand Down

0 comments on commit d3ed12a

Please sign in to comment.