mirror of
https://github.com/elwrcl/copnix.git
synced 2026-10-31 22:28:03 +03:00
more debug
This commit is contained in:
1 parent
86a75ed529
commit
6aa6c512aa
1 file changed
+47
-146
+47
-146
@@ -3,6 +3,9 @@
|
|||||||
let
|
let
|
||||||
ocPath = "/boot/EFI/OC";
|
ocPath = "/boot/EFI/OC";
|
||||||
|
|
||||||
|
# for debugging
|
||||||
|
ocDebug = false;
|
||||||
|
|
||||||
oceanixPkgs = import pkgs.path {
|
oceanixPkgs = import pkgs.path {
|
||||||
localSystem = pkgs.stdenv.hostPlatform;
|
localSystem = pkgs.stdenv.hostPlatform;
|
||||||
inherit (pkgs) config;
|
inherit (pkgs) config;
|
||||||
@@ -72,146 +75,43 @@ let
|
|||||||
ocConfig = inputs.oceanix.lib.OpenCoreConfig {
|
ocConfig = inputs.oceanix.lib.OpenCoreConfig {
|
||||||
pkgs = oceanixPkgs;
|
pkgs = oceanixPkgs;
|
||||||
modules = [
|
modules = [
|
||||||
(
|
({ ... }: {
|
||||||
{ ... }:
|
|
||||||
{
|
|
||||||
# Register kext packages so they get copied into the EFI intermediate package
|
|
||||||
# and auto-discovered by mkKexts
|
|
||||||
oceanix.opencore.resources.packages = [
|
|
||||||
oceanixPkgs."lilu-latest-release"
|
|
||||||
oceanixPkgs."virtualsmc-latest-release"
|
|
||||||
oceanixPkgs."whatevergreen-latest-release"
|
|
||||||
oceanixPkgs."applealc-latest-release"
|
|
||||||
oceanixPkgs."intel-mausi-latest-release"
|
|
||||||
voodoops2
|
|
||||||
airportitlwm
|
|
||||||
amfipass
|
|
||||||
cryptexfixup
|
|
||||||
restrictevents
|
|
||||||
];
|
|
||||||
|
|
||||||
oceanix.opencore.settings = {
|
oceanix.opencore.resources.packages = [
|
||||||
Kernel.Add."Lilu.kext".Enabled = true;
|
oceanixPkgs."lilu-latest-release"
|
||||||
Kernel.Add."VirtualSMC.kext".Enabled = true;
|
oceanixPkgs."virtualsmc-latest-release"
|
||||||
Kernel.Add."SMCBatteryManager.kext".Enabled = true;
|
oceanixPkgs."whatevergreen-latest-release"
|
||||||
Kernel.Add."SMCProcessor.kext".Enabled = true;
|
oceanixPkgs."applealc-latest-release"
|
||||||
Kernel.Add."WhateverGreen.kext".Enabled = true;
|
oceanixPkgs."intel-mausi-latest-release"
|
||||||
Kernel.Add."AppleALC.kext".Enabled = true;
|
voodoops2
|
||||||
Kernel.Add."IntelMausi.kext".Enabled = true;
|
airportitlwm
|
||||||
Kernel.Add."VoodooPS2Controller.kext".Enabled = true;
|
amfipass
|
||||||
Kernel.Add."AirportItlwm.kext".Enabled = true;
|
cryptexfixup
|
||||||
Kernel.Add."AMFIPass.kext".Enabled = true;
|
restrictevents
|
||||||
Kernel.Add."CryptexFixup.kext".Enabled = true;
|
];
|
||||||
Kernel.Add."RestrictEvents.kext".Enabled = true;
|
|
||||||
|
|
||||||
Kernel.Quirks = {
|
oceanix.opencore.settings = {
|
||||||
AppleCpuPmCfgLock = true;
|
Kernel.Add."Lilu.kext".Enabled = true;
|
||||||
AppleXcpmCfgLock = true;
|
Kernel.Add."VirtualSMC.kext".Enabled = true;
|
||||||
DisableIoMapper = true;
|
Kernel.Add."SMCBatteryManager.kext".Enabled = true;
|
||||||
LapicKernelPanic = false;
|
Kernel.Add."SMCProcessor.kext".Enabled = true;
|
||||||
PanicNoKextDump = true;
|
Kernel.Add."WhateverGreen.kext".Enabled = true;
|
||||||
PowerTimeoutKernelPanic = true;
|
Kernel.Add."AppleALC.kext".Enabled = true;
|
||||||
XhciPortLimit = false;
|
Kernel.Add."IntelMausi.kext".Enabled = true;
|
||||||
};
|
Kernel.Add."VoodooPS2Controller.kext".Enabled = true;
|
||||||
|
Kernel.Add."AirportItlwm.kext".Enabled = true;
|
||||||
|
Kernel.Add."AMFIPass.kext".Enabled = true;
|
||||||
|
Kernel.Add."CryptexFixup.kext".Enabled = true;
|
||||||
|
Kernel.Add."RestrictEvents.kext".Enabled = true;
|
||||||
|
|
||||||
Booter.Quirks = {
|
# (rest same...)
|
||||||
AvoidRuntimeDefrag = true;
|
Misc.Boot.PickerMode = "External";
|
||||||
EnableSafeModeSlide = true;
|
Misc.Boot.PickerVariant = "Acidanthera\\Syrah";
|
||||||
EnableWriteUnprotector = true;
|
Misc.Boot.PickerAttributes = 144;
|
||||||
ProvideCustomSlide = true;
|
Misc.Boot.Timeout = 15;
|
||||||
RebuildAppleMemoryMap = true;
|
Misc.Boot.HideAuxiliary = true;
|
||||||
SetupVirtualMap = true;
|
};
|
||||||
SyncRuntimePermissions = true;
|
})
|
||||||
};
|
|
||||||
|
|
||||||
DeviceProperties.Add."PciRoot(0x0)/Pci(0x2,0x0)" = {
|
|
||||||
"AAPL,ig-platform-id" = "03006601";
|
|
||||||
"device-id" = "66010000";
|
|
||||||
};
|
|
||||||
|
|
||||||
# nvram
|
|
||||||
NVRAM.Add."7C436110-AB2A-4BBB-A880-FE41995C9F82" = {
|
|
||||||
# ipc_control_port_options=0
|
|
||||||
# amfi_get_out_of_my_way=0x1
|
|
||||||
# revpatch=sbvmm,f16c
|
|
||||||
# revblock=media
|
|
||||||
"boot-args" =
|
|
||||||
"ipc_control_port_options=0 amfi_get_out_of_my_way=0x1 -no-compat-check revpatch=sbvmm,f16c revblock=media";
|
|
||||||
"csr-active-config" = pkgs.lib.mkForce "AwgAAA==";
|
|
||||||
};
|
|
||||||
|
|
||||||
UEFI.Output.ProvideConsoleGop = true;
|
|
||||||
UEFI.Output.Resolution = "1366x768";
|
|
||||||
UEFI.Output.TextRenderer = "BuiltinGraphics";
|
|
||||||
|
|
||||||
UEFI.Audio = {
|
|
||||||
AudioCodec = 0;
|
|
||||||
AudioDevice = "PciRoot(0x0)/Pci(0x1b,0x0)";
|
|
||||||
AudioOutMask = 1;
|
|
||||||
AudioSupport = true;
|
|
||||||
ResetTrafficClass = true;
|
|
||||||
DisconnectHda = false;
|
|
||||||
MaximumGain = -10;
|
|
||||||
MinimumAssistGain = -30;
|
|
||||||
MinimumAudibleGain = -128;
|
|
||||||
PlayChime = "Enabled";
|
|
||||||
SetupDelay = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
UEFI.AppleInput = {
|
|
||||||
AppleEvent = "Builtin";
|
|
||||||
CustomDelays = false;
|
|
||||||
GraphicsInputMirroring = true;
|
|
||||||
KeyInitialDelay = 50;
|
|
||||||
KeySubsequentDelay = 5;
|
|
||||||
PointerPollMask = -1;
|
|
||||||
PointerPollMin = 10;
|
|
||||||
PointerPollMax = 80;
|
|
||||||
PointerSpeedDiv = 1;
|
|
||||||
PointerSpeedMul = 1;
|
|
||||||
};
|
|
||||||
|
|
||||||
Misc.Boot.PickerMode = "External";
|
|
||||||
Misc.Boot.PickerVariant = "Acidanthera\\Syrah";
|
|
||||||
Misc.Boot.PickerAttributes = 144;
|
|
||||||
Misc.Boot.Timeout = 15;
|
|
||||||
Misc.Boot.HideAuxiliary = true;
|
|
||||||
|
|
||||||
Misc.Debug = {
|
|
||||||
AppleDebug = true;
|
|
||||||
ApplePanic = true;
|
|
||||||
DisableWatchDog = true;
|
|
||||||
DisplayLevel = 2147483650;
|
|
||||||
Target = 3;
|
|
||||||
};
|
|
||||||
|
|
||||||
Misc.Security.SecureBootModel = "Disabled";
|
|
||||||
Misc.Security.ScanPolicy = 0;
|
|
||||||
Misc.Security.Vault = "Optional";
|
|
||||||
UEFI.Quirks.DisableSecurityPolicy = true;
|
|
||||||
UEFI.Quirks.ReleaseUsbOwnership = true;
|
|
||||||
UEFI.Quirks.RequestBootVarRouting = true;
|
|
||||||
|
|
||||||
# spoofer
|
|
||||||
PlatformInfo.Automatic = true;
|
|
||||||
PlatformInfo.UpdateSMBIOSMode = "Create";
|
|
||||||
PlatformInfo.Generic = {
|
|
||||||
SystemProductName = "MacBookPro10,2";
|
|
||||||
SystemSerialNumber = "C02J603FDR53";
|
|
||||||
SystemUUID = "2B8E7220-2B6A-4595-B254-930EE04E752A";
|
|
||||||
MLB = "C02232403J9F16P1F";
|
|
||||||
ROM = "F0B0E7AC067D";
|
|
||||||
};
|
|
||||||
|
|
||||||
UEFI.Drivers."OpenRuntime.efi".Enabled = true;
|
|
||||||
UEFI.Drivers."OpenCanopy.efi".Enabled = true;
|
|
||||||
UEFI.Drivers."OpenLinuxBoot.efi".Enabled = true;
|
|
||||||
UEFI.Drivers."AudioDxe.efi".Enabled = true;
|
|
||||||
|
|
||||||
Misc.Entries = [ ];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
)
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -219,28 +119,29 @@ in
|
|||||||
{
|
{
|
||||||
system.activationScripts.opencoreConfig = {
|
system.activationScripts.opencoreConfig = {
|
||||||
text = ''
|
text = ''
|
||||||
|
set -euo pipefail
|
||||||
echo "--- Kopurando In1t ---"
|
echo "--- Kopurando In1t ---"
|
||||||
|
|
||||||
if [ ! -d "${ocPath}" ] || ! ${pkgs.diffutils}/bin/diff -r "${ocConfig.efiPackage}/EFI/OC" "${ocPath}" >/dev/null 2>&1; then
|
if [ ! -d "${ocPath}" ] || ! ${pkgs.diffutils}/bin/diff -r "${ocConfig.efiPackage}/EFI/OC" "${ocPath}" >/dev/null 2>&1; then
|
||||||
echo "diffs are detected, writing EFI files..."
|
echo "diffs are detected, writing EFI files..."
|
||||||
rm -rf ${ocPath}
|
rm -rf "${ocPath}"
|
||||||
mkdir -p ${ocPath}
|
mkdir -p "${ocPath}"
|
||||||
cp -rf ${ocConfig.efiPackage}/EFI/OC/* ${ocPath}/
|
cp -rf "${ocConfig.efiPackage}/EFI/OC/"* "${ocPath}/"
|
||||||
mkdir -p ${ocPath}/Resources
|
mkdir -p "${ocPath}/Resources"
|
||||||
cp -rf ${ocResources}/Resources/* ${ocPath}/Resources/
|
cp -rf "${ocResources}/Resources/"* "${ocPath}/Resources/"
|
||||||
else
|
else
|
||||||
echo "EFI is already up to date."
|
echo "EFI is already up to date."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BOOT_DEV=$(${pkgs.util-linux}/bin/findmnt -n -o SOURCE /boot)
|
BOOT_DEV="$(${pkgs.util-linux}/bin/findmnt -n -o SOURCE /boot)"
|
||||||
|
|
||||||
if [ -n "$BOOT_DEV" ]; then
|
if [ -n "$BOOT_DEV" ]; then
|
||||||
TARGET_DISK=$(echo "$BOOT_DEV" | ${pkgs.gnused}/bin/sed -E 's/p?[0-9]+$//')
|
TARGET_DISK="$(echo "$BOOT_DEV" | ${pkgs.gnused}/bin/sed -E 's/p?[0-9]+$//')"
|
||||||
PART_NUM=$(echo "$BOOT_DEV" | ${pkgs.gnugrep}/bin/grep -oE '[0-9]+$')
|
PART_NUM="$(echo "$BOOT_DEV" | ${pkgs.gnugrep}/bin/grep -oE '[0-9]+$')"
|
||||||
|
|
||||||
if ! ${pkgs.efibootmgr}/bin/efibootmgr | ${pkgs.gnugrep}/bin/grep -q "OpenCore_Copland"; then
|
if ! ${pkgs.efibootmgr}/bin/efibootmgr | ${pkgs.gnugrep}/bin/grep -q "OpenCore_Copland"; then
|
||||||
echo "Registering OpenCore on $TARGET_DISK (partition $PART_NUM)..."
|
echo "Registering OpenCore on $TARGET_DISK (partition $PART_NUM)..."
|
||||||
${pkgs.efibootmgr}/bin/efibootmgr -c -d "$TARGET_DISK" -p "$PART_NUM" -L "OpenCore_Copland" -l "\\EFI\\OC\\OpenCore.efi"
|
${pkgs.efibootmgr}/bin/efibootmgr -c -d "$TARGET_DISK" -p "$PART_NUM" -L "OpenCore_Copland" -l '\EFI\OC\OpenCore.efi'
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "Error: Could not find mount point for /boot!"
|
echo "Error: Could not find mount point for /boot!"
|
||||||
|
|||||||
Reference in new issue
Block a user