Skip to content

Commit 6aba6b9

Browse files
authored
Merge pull request #3 from ym2008/master
Update Lilu to 1.2.0, Add support for High Sierra
2 parents 3e45a6e + 8fceffb commit 6aba6b9

File tree

4 files changed

+18
-17
lines changed

4 files changed

+18
-17
lines changed

AzulPatcher4600.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@
328328
MODULE_NAME = net.coderobe.macos.AzulPatcher4600;
329329
MODULE_START = "$(PRODUCT_NAME)_kern_start";
330330
MODULE_STOP = "$(PRODUCT_NAME)_kern_stop";
331-
MODULE_VERSION = 1.1.4;
331+
MODULE_VERSION = 1.2.0;
332332
OTHER_CFLAGS = (
333333
"-mmmx",
334334
"-msse",
@@ -372,7 +372,7 @@
372372
MODULE_NAME = net.coderobe.macos.AzulPatcher4600;
373373
MODULE_START = "$(PRODUCT_NAME)_kern_start";
374374
MODULE_STOP = "$(PRODUCT_NAME)_kern_stop";
375-
MODULE_VERSION = 1.1.4;
375+
MODULE_VERSION = 1.2.0;
376376
OTHER_CFLAGS = (
377377
"-mmmx",
378378
"-msse",

genericPatcher/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<key>OSBundleLibraries</key>
4242
<dict>
4343
<key>as.vit9696.Lilu</key>
44-
<string>1.1.1</string>
44+
<string>1.2.0</string>
4545
<key>com.apple.kpi.bsd</key>
4646
<string>12.0.0</string>
4747
<key>com.apple.kpi.dsep</key>

genericPatcher/kern_patchset.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ static const char* kextPaths[] {
2020
};
2121

2222
static KernelPatcher::KextInfo kextList[] {
23-
{ "com.apple.driver.AppleIntelFramebufferAzul", &kextPaths[0], 1, true, {}, KernelPatcher::KextInfo::Unloaded },
23+
{ "com.apple.driver.AppleIntelFramebufferAzul", &kextPaths[0], 1, {true,true}, {}, KernelPatcher::KextInfo::Unloaded },
2424
};
2525

2626
template <typename T,unsigned S>
@@ -35,7 +35,7 @@ bool PatchSet::init() {
3535
}, this);
3636

3737
if(error != LiluAPI::Error::NoError) {
38-
SYSLOG("coderobe.AzulPatcher4600: failed to register onPatcherLoad method %d", error);
38+
SYSLOG("coderobe.AzulPatcher4600", "failed to register onPatcherLoad method %d", error);
3939
return false;
4040
}
4141

@@ -50,37 +50,37 @@ void PatchSet::processKext(KernelPatcher& patcher, size_t index, mach_vm_address
5050
for(size_t i = 0; i < kextListSize; i++) {
5151
if(kextList[i].loadIndex == index) {
5252
if(!(progressState & ProcessingState::EverythingDone) && !strcmp(kextList[i].id, kextList[0].id)) {
53-
SYSLOG("coderobe.AzulPatcher4600: found %s", kextList[i].id);
53+
SYSLOG("coderobe.AzulPatcher4600", "found %s", kextList[i].id);
5454

5555
// Disable port 0204
5656
const uint8_t find[] = {0x02, 0x04, 0x09, 0x00, 0x00, 0x04, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00};
5757
const uint8_t replace[] = {0xff, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00};
5858
KextPatch kext_patch {
5959
{&kextList[i], find, replace, sizeof(find), 2},
60-
KernelVersion::Sierra, KernelVersion::Sierra
60+
KernelVersion::HighSierra, KernelVersion::HighSierra
6161
};
6262
applyPatches(patcher, index, &kext_patch, 1);
63-
SYSLOG("coderobe.AzulPatcher4600: disabled port 0204");
63+
SYSLOG("coderobe.AzulPatcher4600", "disabled port 0204");
6464

6565
// 9MB cursor bytes, 2 ports only
6666
const uint8_t find1[] = {0x06, 0x00, 0x26, 0x0a, 0x01, 0x03, 0x03, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x30, 0x01, 0x00, 0x00, 0x60, 0x00};
6767
const uint8_t replace1[] = {0x06, 0x00, 0x26, 0x0a, 0x01, 0x03, 0x02, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x30, 0x01, 0x00, 0x00, 0x90, 0x00};
6868
KextPatch kext_patch1 {
6969
{&kextList[i], find1, replace1, sizeof(find1), 2},
70-
KernelVersion::Sierra, KernelVersion::Sierra
70+
KernelVersion::HighSierra, KernelVersion::HighSierra
7171
};
7272
applyPatches(patcher, index, &kext_patch1, 1);
73-
SYSLOG("coderobe.AzulPatcher4600: 9MB cursor byte patch (2 ports only) applied");
73+
SYSLOG("coderobe.AzulPatcher4600", "9MB cursor byte patch (2 ports only) applied");
7474

7575
// HDMI audio
7676
const uint8_t find2[] = {0x01, 0x05, 0x09, 0x00, 0x00, 0x04, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00};
7777
const uint8_t replace2[] = {0x01, 0x05, 0x12, 0x00, 0x00, 0x08, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00};
7878
KextPatch kext_patch2 {
7979
{&kextList[i], find2, replace2, sizeof(find2), 2},
80-
KernelVersion::Sierra, KernelVersion::Sierra
80+
KernelVersion::HighSierra, KernelVersion::HighSierra
8181
};
8282
applyPatches(patcher, index, &kext_patch2, 1);
83-
SYSLOG("coderobe.AzulPatcher4600: HDMI audio patch applied");
83+
SYSLOG("coderobe.AzulPatcher4600", "HDMI audio patch applied");
8484
progressState |= ProcessingState::EverythingDone;
8585
}
8686
}
@@ -94,7 +94,7 @@ void PatchSet::applyPatches(KernelPatcher& patcher, size_t index, const KextPatc
9494
auto &patch = patches[p];
9595
if (patch.patch.kext->loadIndex == index) {
9696
if (patcher.compatibleKernel(patch.minKernel, patch.maxKernel)) {
97-
SYSLOG("coderobe.AzulPatcher4600: patching %s (%ld/%ld)...", patch.patch.kext->id, p+1, patchNum);
97+
SYSLOG("coderobe.AzulPatcher4600", "patching %s (%ld/%ld)...", patch.patch.kext->id, p+1, patchNum);
9898
patcher.applyLookupPatch(&patch.patch);
9999
patcher.clearError();
100100
}

genericPatcher/kern_start.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,15 @@ static const char *bootargBeta[] {
2727
PluginConfiguration ADDPR(config) {
2828
xStringify(PRODUCT_NAME),
2929
parseModuleVersion(xStringify(MODULE_VERSION)),
30+
LiluAPI::AllowNormal | LiluAPI::AllowInstallerRecovery,
3031
bootargOff,
31-
sizeof(bootargOff)/sizeof(bootargOff[0]),
32+
arrsize(bootargOff),
3233
bootargDebug,
33-
sizeof(bootargDebug)/sizeof(bootargDebug[0]),
34+
arrsize(bootargDebug),
3435
bootargBeta,
35-
sizeof(bootargBeta)/sizeof(bootargBeta[0]),
36+
arrsize(bootargBeta),
3637
KernelVersion::Yosemite,
37-
KernelVersion::Sierra,
38+
KernelVersion::HighSierra,
3839
[]() {
3940
patchset.init();
4041
}

0 commit comments

Comments
 (0)