MacBook-Pro-2:macOS-patcher-script mwirth$ date Mon Jun 17 17:48:27 PDT 2019 MacBook-Pro-2:macOS-patcher-script mwirth$ sudo ./macOS\ Patcher.sh -v Password: + [[ -v == *\-\m\o\d\e\r\n\-\p\r\e\l\i\n\k\e\d\k\e\r\n\e\l* ]] + Path_Variables + script_path='./macOS Patcher.sh' + directory_path=. + resources_path=./resources + Check_Environment + echo '\033[38;5;113m> Checking system environment.\033[0m' > Checking system environment. + '[' -d '/Install *.app' ']' + '[' '!' -d '/Install *.app' ']' + environment=system + Checked system environment. + Check_Root + echo '\033[38;5;113m> Checking for root permissions.\033[0m' > Checking for root permissions. + [[ system == \i\n\s\t\a\l\l\e\r ]] ++ whoami + [[ root == \r\o\o\t ]] + [[ system == \s\y\s\t\e\m ]] + root_check=passed + Root permissions check passed. ++ whoami + [[ ! root == \r\o\o\t ]] + Check_Resources + echo '\033[38;5;113m> Checking for resources.\033[0m' > Checking for resources. + [[ -d ./resources ]] + resources_check=passed + Resources check passed. + [[ ! -d ./resources ]] + [[ -d ./resources/prelinkedkernel-modern ]] + Input_Operation + echo '\033[38;5;75m/ What operation would you like to run?\033[0m' / What operation would you like to run? + echo '\033[38;5;75m/ Input an operation number.\033[0m' / Input an operation number. + echo '\033[38;5;75m/ 1 - Patch installer\033[0m' / 1 - Patch installer + echo '\033[38;5;75m/ 2 - Patch update\033[0m' / 2 - Patch update + Input_On + stty echo + read -e -p '/ ' operation / 1 + Input_Off + stty -echo + [[ 1 == \1 ]] + Input_Installer + echo '\033[38;5;75m/ What installer would you like to use?\033[0m' / What installer would you like to use? + echo '\033[38;5;75m/ Input an installer path.\033[0m' / Input an installer path. + Input_On + stty echo + read -e -p '/ ' installer_application_path / /Volumes/Archives/MacOS Installers/Mojave 10.14/14.5.02/Install macOS Mojave.app + Input_Off + stty -echo + installer_sharedsupport_path='/Volumes/Archives/MacOS Installers/Mojave 10.14/14.5.02/Install macOS Mojave.app/Contents/SharedSupport' + Check_Installer_Stucture + Output_Off hdiutil attach '/Volumes/Archives/MacOS Installers/Mojave 10.14/14.5.02/Install macOS Mojave.app/Contents/SharedSupport/InstallESD.dmg' -mountpoint /tmp/InstallESD -nobrowse + [[ 1 == \1 ]] + hdiutil attach '/Volumes/Archives/MacOS Installers/Mojave 10.14/14.5.02/Install macOS Mojave.app/Contents/SharedSupport/InstallESD.dmg' -mountpoint /tmp/InstallESD -nobrowse Checksumming Protective Master Boot Record (MBR : 0)… Protective Master Boot Record (MBR :: verified CRC32 $FC0054DD Checksumming GPT Header (Primary GPT Header : 1)… GPT Header (Primary GPT Header : 1): verified CRC32 $C5A79AF2 Checksumming GPT Partition Data (Primary GPT Table : 2)… GPT Partition Data (Primary GPT Tabl: verified CRC32 $AD387529 Checksumming (Apple_Free : 3)… (Apple_Free : 3): verified CRC32 $00000000 Checksumming EFI System Partition (C12A7328-F81F-11D2-BA4B-00A0C93EC93B : 4)… ... EFI System Partition (C12A7328-F81F-: verified CRC32 $B54B659C Checksumming disk image (Apple_HFS : 5)… ................................................................................................................ disk image (Apple_HFS : 5): checksum failed with error 5. ......................................................................................................................................... calculated CRC32 $E04CC91A, expected CRC32 $4CED6C46 hdiutil: attach failed - Input/output error + echo '\033[38;5;113m> Checking installer structure.\033[0m' > Checking installer structure. + [[ -e /tmp/InstallESD/BaseSystem.dmg ]] + [[ -e /Volumes/Archives/MacOS Installers/Mojave 10.14/14.5.02/Install macOS Mojave.app/Contents/SharedSupport/BaseSystem.dmg ]] + installer_images_path='/Volumes/Archives/MacOS Installers/Mojave 10.14/14.5.02/Install macOS Mojave.app/Contents/SharedSupport' + Checked installer structure. + echo '\033[38;5;113m> Mounting installer disk images.\033[0m' > Mounting installer disk images. + Output_Off hdiutil attach '/Volumes/Archives/MacOS Installers/Mojave 10.14/14.5.02/Install macOS Mojave.app/Contents/SharedSupport/BaseSystem.dmg' -mountpoint '/tmp/Base System' -nobrowse + [[ 1 == \1 ]] + hdiutil attach '/Volumes/Archives/MacOS Installers/Mojave 10.14/14.5.02/Install macOS Mojave.app/Contents/SharedSupport/BaseSystem.dmg' -mountpoint '/tmp/Base System' -nobrowse expected CRC32 $EB262EFD /dev/disk3 GUID_partition_scheme /dev/disk3s1 Apple_HFS /private/tmp/Base System + Mounted installer disk images. + Check_Installer_Version + echo '\033[38;5;113m> Checking installer version.\033[0m' > Checking installer version. ++ defaults read '/tmp/Base System/System/Library/CoreServices/SystemVersion.plist' ProductVersion + installer_version=10.14.5 ++ defaults read '/tmp/Base System/System/Library/CoreServices/SystemVersion.plist' ProductVersion ++ cut -c-5 + installer_version_short=10.14 + Checked installer version. + Check_Installer_Support + echo '\033[38;5;113m> Checking installer support.\033[0m' > Checking installer support. + [[ 10.14 == \1\0\.\1[2-3] ]] + [[ 10.14.5 == \1\0\.\1\4\.[4-5] ]] + Installer support check passed. + Installer_Variables + [[ '' == \1 ]] + installer_prelinkedkernel_path=./resources/prelinkedkernel + [[ 10.14 == \1\0\.\1[2-4] ]] + installer_prelinkedkernel=10.14 + [[ 10.14.5 == \1\0\.\1\2\.[1-3] ]] + [[ 10.14.5 == \1\0\.\1\4\.[1-3] ]] + [[ 10.14.5 == \1\0\.\1\2\.[4-6] ]] + [[ 10.14.5 == \1\0\.\1\3\.[4-6] ]] + [[ 10.14.5 == \1\0\.\1\4\.[4-5] ]] + installer_prelinkedkernel=10.14.4 + Input_Volume + echo '\033[38;5;75m/ What volume would you like to use?\033[0m' / What volume would you like to use? + echo '\033[38;5;75m/ Input a volume name.\033[0m' / Input a volume name. + for volume_path in '/Volumes/*' + volume_name=Archives + [[ ! Archives == com.apple* ]] + echo '\033[38;5;75m/ Archives\033[0m' + sort -V / Archives + for volume_path in '/Volumes/*' + volume_name='Memex 2' + [[ ! Memex 2 == com.apple* ]] + echo '\033[38;5;75m/ Memex 2\033[0m' + sort -V / Memex 2 + for volume_path in '/Volumes/*' + volume_name=S1 + [[ ! S1 == com.apple* ]] + echo '\033[38;5;75m/ S1\033[0m' + sort -V / S1 + for volume_path in '/Volumes/*' + volume_name=SSD + [[ ! SSD == com.apple* ]] + echo '\033[38;5;75m/ SSD\033[0m' + sort -V / SSD + Input_On + stty echo + read -e -p '/ ' installer_volume_name / S1 + Input_Off + stty -echo + installer_volume_path=/Volumes/S1 + Create_Installer + echo '\033[38;5;113m> Restoring installer disk image.\033[0m' > Restoring installer disk image. + Output_Off asr restore -source '/Volumes/Archives/MacOS Installers/Mojave 10.14/14.5.02/Install macOS Mojave.app/Contents/SharedSupport/BaseSystem.dmg' -target /Volumes/S1 -noprompt -noverify -erase + [[ 1 == \1 ]] + asr restore -source '/Volumes/Archives/MacOS Installers/Mojave 10.14/14.5.02/Install macOS Mojave.app/Contents/SharedSupport/BaseSystem.dmg' -target /Volumes/S1 -noprompt -noverify -erase Validating target...done Validating source...done Retrieving scan information...done Validating sizes...done Restoring ....10....20....30....40....50....60....70....80....90....100 Restored target device is /dev/disk1s2. Remounting target volume...done + Restored installer disk image. + echo '\033[38;5;113m> Renaming installer volume.\033[0m' > Renaming installer volume. + Output_Off diskutil rename '/Volumes/macOS Base System' S1 + [[ 1 == \1 ]] + diskutil rename '/Volumes/macOS Base System' S1 Volume on disk1s2 renamed to S1 + bless --folder /Volumes/S1/System/Library/CoreServices --label S1 + Renamed installer volume. + echo '\033[38;5;113m> Copying installer packages.\033[0m' > Copying installer packages. + rm /Volumes/S1/System/Installation/Packages + cp -R /tmp/InstallESD/Packages /Volumes/S1/System/Installation/ cp: /tmp/InstallESD/Packages: No such file or directory + Copied installer packages. + echo '\033[38;5;113m> Copying installer disk images.\033[0m' > Copying installer disk images. + cp '/Volumes/Archives/MacOS Installers/Mojave 10.14/14.5.02/Install macOS Mojave.app/Contents/SharedSupport/BaseSystem.dmg' /Volumes/S1/ + cp '/Volumes/Archives/MacOS Installers/Mojave 10.14/14.5.02/Install macOS Mojave.app/Contents/SharedSupport/BaseSystem.chunklist' /Volumes/S1/ + [[ -e /Volumes/Archives/MacOS Installers/Mojave 10.14/14.5.02/Install macOS Mojave.app/Contents/SharedSupport/AppleDiagnostics.dmg ]] + cp '/Volumes/Archives/MacOS Installers/Mojave 10.14/14.5.02/Install macOS Mojave.app/Contents/SharedSupport/AppleDiagnostics.dmg' /Volumes/S1/ + cp '/Volumes/Archives/MacOS Installers/Mojave 10.14/14.5.02/Install macOS Mojave.app/Contents/SharedSupport/AppleDiagnostics.chunklist' /Volumes/S1/ + Copied installer disk images. + echo '\033[38;5;113m> Unmounting installer disk images.\033[0m' > Unmounting installer disk images. + Output_Off hdiutil detach /tmp/InstallESD + [[ 1 == \1 ]] + hdiutil detach /tmp/InstallESD hdiutil: detach failed - No such file or directory + Output_Off hdiutil detach '/tmp/Base System' + [[ 1 == \1 ]] + hdiutil detach '/tmp/Base System' "disk3" ejected. + Unmounted installer disk images. + echo '\033[38;5;113m> Replacing installer utilities menu.\033[0m' > Replacing installer utilities menu. + cp ./resources/InstallerMenuAdditions.plist '/Volumes/S1/System/Installation/CDIS/macOS Installer.app/Contents/Resources' + Replacing installer utilities menu. + Patch_Installer + [[ 10.14 == \1\0\.\1[3-4] ]] + Patch_Supported + echo '\033[38;5;113m> Patching installer app.\033[0m' > Patching installer app. + cp -R '/Volumes/S1/System/Installation/CDIS/macOS Installer.app' '/Volumes/S1/tmp/macOS Installer-original.app' + cp -R './resources/macOS Installer.app' '/Volumes/S1/tmp/macOS Installer-patched.app' + cp '/Volumes/S1/tmp/macOS Installer-original.app/Contents/Resources/X.tiff' '/Volumes/S1/tmp/macOS Installer-patched.app/Contents/Resources/' + cp '/Volumes/S1/tmp/macOS Installer-original.app/Contents/Resources/OSXTheme.car' '/Volumes/S1/tmp/macOS Installer-patched.app/Contents/Resources/' + cp '/Volumes/S1/tmp/macOS Installer-original.app/Contents/Resources/ReleaseNameTheme.car' '/Volumes/S1/tmp/macOS Installer-patched.app/Contents/Resources/' + cp '/Volumes/S1/tmp/macOS Installer-original.app/Contents/Resources/InstallerMenuAdditions.plist' '/Volumes/S1/tmp/macOS Installer-patched.app/Contents/Resources/' + rm -R '/Volumes/S1/System/Installation/CDIS/macOS Installer.app' + cp -R '/Volumes/S1/tmp/macOS Installer-patched.app' '/Volumes/S1/System/Installation/CDIS/macOS Installer.app' + Patched installer app. + echo '\033[38;5;113m> Patching installer framework.\033[0m' > Patching installer framework. + rm -R /Volumes/S1/System/Library/PrivateFrameworks/OSInstaller.framework + cp -R ./resources/OSInstaller.framework /Volumes/S1/System/Library/PrivateFrameworks/ + Patched installer framework. + [[ 10.14 == \1\0\.\1\4 ]] + echo '\033[38;5;113m> Patching system migration frameworks.\033[0m' > Patching system migration frameworks. + rm -R /Volumes/S1/System/Library/PrivateFrameworks/SystemMigration.framework + rm -R /Volumes/S1/System/Library/PrivateFrameworks/SystemMigrationUtils.framework + cp -R ./resources/SystemMigration.framework /Volumes/S1/System/Library/PrivateFrameworks/ + cp -R ./resources/SystemMigrationUtils.framework /Volumes/S1/System/Library/PrivateFrameworks/ + Patched system migration frameworks. + echo '\033[38;5;113m> Patching graphics driver.\033[0m' > Patching graphics driver. + cp -R /Volumes/S1/System/Library/Frameworks/Quartz.framework /Volumes/S1/tmp/Quartz-original.framework + cp -R ./resources/Quartz.framework /Volumes/S1/tmp/Quartz-patched.framework + rm -R /Volumes/S1/tmp/Quartz-patched.framework/Versions/A/Frameworks/QuickLookUI.framework + cp -R /Volumes/S1/tmp/Quartz-original.framework/Versions/A/Frameworks/QuickLookUI.framework /Volumes/S1/tmp/Quartz-patched.framework/Versions/A/Frameworks/ + rm -R /Volumes/S1/System/Library/Frameworks/Quartz.framework + cp -R /Volumes/S1/tmp/Quartz-patched.framework /Volumes/S1/System/Library/Frameworks/Quartz.framework + Patched graphics driver. + Patch_Unsupported + [[ 10.14 == \1\0\.\1\2 ]] + echo '\033[38;5;113m> Patching installer package.\033[0m' > Patching installer package. + cp /Volumes/S1/System/Installation/Packages/OSInstall.mpkg /Volumes/S1/tmp cp: /Volumes/S1/System/Installation/Packages/OSInstall.mpkg: No such file or directory + pkgutil --expand /Volumes/S1/tmp/OSInstall.mpkg /Volumes/S1/tmp/OSInstall Could not open package for expansion: /Volumes/S1/tmp/OSInstall.mpkg + sed -i '' 's/cpuFeatures\[i\] == "VMM"/1 == 1/' /Volumes/S1/tmp/OSInstall/Distribution sed: /Volumes/S1/tmp/OSInstall/Distribution: No such file or directory + sed -i '' 's/nonSupportedModels.indexOf(currentModel)>= 0/1 == 0/' /Volumes/S1/tmp/OSInstall/Distribution sed: /Volumes/S1/tmp/OSInstall/Distribution: No such file or directory + sed -i '' 's/boardIds.indexOf(boardId)== -1/1 == 0/' /Volumes/S1/tmp/OSInstall/Distribution sed: /Volumes/S1/tmp/OSInstall/Distribution: No such file or directory + pkgutil --flatten /Volumes/S1/tmp/OSInstall /Volumes/S1/tmp/OSInstall.mpkg Could not open directory: /Volumes/S1/tmp/OSInstall + cp /Volumes/S1/tmp/OSInstall.mpkg /Volumes/S1/System/Installation/Packages + Patched installer package. + echo '\033[38;5;113m> Patching input drivers.\033[0m' > Patching input drivers. + cp -R ./resources/patch/LegacyUSBInjector.kext /Volumes/S1/System/Library/Extensions + Patched input drivers. + echo '\033[38;5;113m> Patching platform support check.\033[0m' > Patching platform support check. + rm /Volumes/S1/System/Library/CoreServices/PlatformSupport.plist + Patched platform support check. + echo '\033[38;5;113m> Patching kernel cache.\033[0m' > Patching kernel cache. + rm /Volumes/S1/System/Library/PrelinkedKernels/prelinkedkernel + cp ./resources/prelinkedkernel/10.14.4/prelinkedkernel /Volumes/S1/System/Library/PrelinkedKernels + chflags uchg /Volumes/S1/System/Library/PrelinkedKernels/prelinkedkernel + Patched kernel cache. + echo '\033[38;5;113m> Patching System Integrity Protection.\033[0m' > Patching System Integrity Protection. + cp -R ./resources/patch/SIPManager.kext /Volumes/S1/System/Library/Extensions + Patched System Integrity Protection. + echo '\033[38;5;113m> Copying patcher utilities.\033[0m' > Copying patcher utilities. + cp -R ./resources/patch /Volumes/S1/usr/ + cp ./resources/cmds/patch.sh /Volumes/S1/usr/bin/patch + cp ./resources/cmds/restore.sh /Volumes/S1/usr/bin/restore + chmod +x /Volumes/S1/usr/bin/patch + chmod +x /Volumes/S1/usr/bin/restore + Copied patcher utilities. + Repair_Permissions + echo '\033[38;5;113m> Repairing permissions.\033[0m' > Repairing permissions. + Repair '/Volumes/S1/System/Installation/CDIS/macOS Installer.app' + chown -R 0:0 '/Volumes/S1/System/Installation/CDIS/macOS Installer.app' + chmod -R 755 '/Volumes/S1/System/Installation/CDIS/macOS Installer.app' + [[ '' == \1 ]] + Repair /Volumes/S1/System/Installation/Packages/OSInstall.mpkg + chown -R 0:0 /Volumes/S1/System/Installation/Packages/OSInstall.mpkg chown: /Volumes/S1/System/Installation/Packages/OSInstall.mpkg: Not a directory + chmod -R 755 /Volumes/S1/System/Installation/Packages/OSInstall.mpkg chmod: /Volumes/S1/System/Installation/Packages/OSInstall.mpkg: Not a directory + Repair /Volumes/S1/System/Library/Extensions/LegacyUSBInjector.kext + chown -R 0:0 /Volumes/S1/System/Library/Extensions/LegacyUSBInjector.kext + chmod -R 755 /Volumes/S1/System/Library/Extensions/LegacyUSBInjector.kext + Repair /Volumes/S1/System/Library/Extensions/SIPManager.kext + chown -R 0:0 /Volumes/S1/System/Library/Extensions/SIPManager.kext + chmod -R 755 /Volumes/S1/System/Library/Extensions/SIPManager.kext + Repair /Volumes/S1/usr/patch + chown -R 0:0 /Volumes/S1/usr/patch + chmod -R 755 /Volumes/S1/usr/patch + Repair /Volumes/S1/usr/bin/patch + chown -R 0:0 /Volumes/S1/usr/bin/patch + chmod -R 755 /Volumes/S1/usr/bin/patch + Repair /Volumes/S1/usr/bin/restore + chown -R 0:0 /Volumes/S1/usr/bin/restore + chmod -R 755 /Volumes/S1/usr/bin/restore + Repaired permissions. + [[ 1 == \2 ]] + End + [[ 1 == \1 ]] + echo '\033[38;5;113m> Removing temporary files.\033[0m' > Removing temporary files. + Output_Off rm -R /Volumes/S1/tmp/OSInstall.mpkg /Volumes/S1/tmp/Quartz-original.framework /Volumes/S1/tmp/Quartz-patched.framework '/Volumes/S1/tmp/macOS Installer-original.app' '/Volumes/S1/tmp/macOS Installer-patched.app' + [[ 1 == \1 ]] + rm -R /Volumes/S1/tmp/OSInstall.mpkg /Volumes/S1/tmp/Quartz-original.framework /Volumes/S1/tmp/Quartz-patched.framework '/Volumes/S1/tmp/macOS Installer-original.app' '/Volumes/S1/tmp/macOS Installer-patched.app' + Removed temporary files. + echo '\033[38;5;75m/ Thank you for using macOS Patcher.\033[0m' / Thank you for using macOS Patcher. + Input_On + stty echo + exit MacBook-Pro-2:macOS-patcher-script mwirth$ date Mon Jun 17 18:17:45 PDT 2019 MacBook-Pro-2:macOS-patcher-script mwirth$