├── .DS_Store ├── Hackintosh_build.sh ├── README.md └── get-clover.sh /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bugprogrammer/hackintosh/ad13aff7cfb01ab1468f7e24a50afc47165ca863/.DS_Store -------------------------------------------------------------------------------- /Hackintosh_build.sh: -------------------------------------------------------------------------------- 1 | #bin/bash 2 | 3 | clear 4 | echo '脚本开始执行。' 5 | echo '正在进行环境检测。' 6 | 7 | os=$(uname -s) 8 | 9 | if [ $os != 'Darwin' ]; then 10 | echo '您的操作系统不是macOS,该脚本只支持macOS' 11 | exit; 12 | fi 13 | echo '您的操作系统是macOS,继续' 14 | xcode-select --install 15 | echo -e "\033[32m请注意您的电脑是否出现弹窗,如出现弹窗,请点击最右侧的安装按钮,安装结束后按回车继续。如果未出现弹窗直接按回车继续: \033[0m" 16 | read n1 17 | 18 | echo -e "\033[32m\n欢迎使用Bugprogrammer的Hackintosh常用kext以及Bootloader编译脚本,请输入序号。 19 | 如需编译多个项目,请按,隔开。输入完成按回车结束输入(如1,3,6回车).如需编译全部请按0:\033[0m" 20 | 21 | cd ~/Desktop 22 | dir=hackintosh_Plugins_$(date +%Y%m%d%H%M%S) 23 | mkdir -p $dir/Release 24 | mkdir -p $dir/Sources 25 | cd $dir/Sources 26 | 27 | buildArray=( 28 | 'Clover,https://github.com/CloverHackyColor/CloverBootloader.git' 29 | 'OpenCore,https://github.com/acidanthera/OpenCorePkg.git' 30 | 'n-d-k-OpenCore,https://github.com/n-d-k/OpenCorePkg.git' 31 | 'AppleSupportPkg,https://github.com/acidanthera/AppleSupportPkg.git' 32 | 'Lilu,https://github.com/acidanthera/Lilu.git' 33 | 'AirportBrcmFixup,https://github.com/acidanthera/AirportBrcmFixup.git' 34 | 'AppleALC,https://github.com/acidanthera/AppleALC.git' 35 | 'ATH9KFixup,https://github.com/chunnann/ATH9KFixup.git' 36 | 'BT4LEContinuityFixup,https://github.com/acidanthera/BT4LEContinuityFixup.git' 37 | 'CPUFriend,https://github.com/PMheart/CPUFriend.git' 38 | 'HibernationFixup,https://github.com/acidanthera/HibernationFixup.git' 39 | 'NoTouchID,https://github.com/al3xtjames/NoTouchID.git' 40 | 'RTCMemoryFixup,https://github.com/acidanthera/RTCMemoryFixup.git' 41 | 'SystemProfilerMemoryFixup,https://github.com/Goldfish64/SystemProfilerMemoryFixup.git' 42 | 'VirtualSMC,https://github.com/acidanthera/VirtualSMC.git' 43 | 'acidanthera_WhateverGreen,https://github.com/acidanthera/WhateverGreen.git' 44 | 'bugprogrammer_WhateverGreen,https://github.com/bugprogrammer/WhateverGreen.git' 45 | 'IntelMausiEthernet,https://github.com/Mieze/IntelMausiEthernet.git' 46 | 'AtherosE2200Ethernet,https://github.com/Mieze/AtherosE2200Ethernet.git' 47 | 'RTL8111,https://github.com/Mieze/RTL8111_driver_for_OS_X.git') 48 | 49 | liluPlugins='AirportBrcmFixup AppleALC ATH9KFixup BT4LEContinuityFixup CPUFriend HibernationFixup 50 | NoTouchID RTCMemoryFixup SystemProfilerMemoryFixup VirtualSMC acidanthera_WhateverGreen bugprogrammer_WhateverGreen' 51 | 52 | bootLoader='OpenCore n-d-k-OpenCore AppleSupportPkg' 53 | 54 | 55 | for(( i=0;i<${#buildArray[@]};i++)) do 56 | echo $[$i+1] ${buildArray[i]%,*}; 57 | done; 58 | 59 | read input 60 | function hackintosh_Build() 61 | { 62 | echo "将要编译"${buildArray[$1]%,*} 63 | 64 | mkdir -p ../Release/${buildArray[$1]%,*}/Release 65 | mkdir -p ../Release/${buildArray[$1]%,*}/Debug 66 | git clone ${buildArray[$1]##*,} ${buildArray[$1]%,*} 67 | cd ${buildArray[$1]%,*} 68 | if [ ${buildArray[$1]%,*} == 'Clover' ]; then 69 | ./buildme 70 | cp -Rf CloverPackage/sym/* ../../Release/${buildArray[$1]%,*}/Release 71 | rm -rf ~/Desktop/$dir/Release/${buildArray[$1]%,*}/Debug 72 | elif [[ $bootLoader =~ ${buildArray[$1]%,*} ]]; then 73 | ./*.tool 74 | cp Binaries/RELEASE/*.zip ../../Release/${buildArray[$1]%,*}/Release 75 | cp Binaries/DEBUG/*.zip ../../Release/${buildArray[$1]%,*}/Debug 76 | else 77 | if [[ $liluPlugins =~ ${buildArray[$1]%,*} ]]; then 78 | if [ ! -e *.kext ]; then 79 | if [ ! -e ~/Desktop/$dir/Sources/Lilu/build/Debug/Lilu.kext ]; then 80 | pushd ~/Desktop/$dir/Sources 81 | git clone https://github.com/acidanthera/Lilu.git && cd Lilu 82 | xcodebuild -configuration Debug 83 | popd 84 | cp -Rf ~/Desktop/$dir/Sources/Lilu/build/Debug/Lilu.kext . 85 | else 86 | cp -Rf ~/Desktop/$dir/Sources/Lilu/build/Debug/Lilu.kext . 87 | fi 88 | fi 89 | fi 90 | xcodebuild -configuration Release 91 | xcodebuild -configuration Debug 92 | if [ -e build/Release/*.zip ]; then 93 | cp -Rf build/Release/*.zip ../../Release/${buildArray[$1]%,*}/Release 94 | cp -Rf build/Debug/*.zip ../../Release/${buildArray[$1]%,*}/Debug 95 | else 96 | cp -Rf build/Release/*.kext ../../Release/${buildArray[$1]%,*}/Release/${buildArray[$1]%,*}-Release.kext 97 | cp -Rf build/Debug/*.kext ../../Release/${buildArray[$1]%,*}/Debug/${buildArray[$1]%,*}-Debug.kext 98 | fi 99 | fi 100 | cd ~/Desktop/$dir/Sources 101 | } 102 | 103 | if [ $input == '0' ]; then 104 | for(( i=0;i<${#buildArray[@]};i++)) do 105 | hackintosh_Build $i 106 | done; 107 | else 108 | inputArray=(`echo $input | tr ',' ' '`) 109 | for(( i=0;i<${#inputArray[@]};i++)) do 110 | hackintosh_Build ${inputArray[i]}-1 111 | done; 112 | fi 113 | 114 | open ~/Desktop/$dir/Release 115 | 116 | echo -e "\033[32m\n编译完成,脚本运行结束!\033[0m" -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # hackintosh 2 | 3 | 建立hackintosh仓库,收集博主用过的或朋友用过的机型的clover配置文件,以方便爱好者使用,分享的所有clover文件均实测通过,不敢保证完美,但可以保证日常使用。三卡(声卡,显卡,网卡)正常,蓝牙正常,usb正常,睡眠唤醒正常,hdmi外接屏正常,电池正常,亮度调节(小太阳)正常,变频正常,触摸板,触屏,指点杆之类的不敢保证。 4 | 5 | 添加自动获取Clover脚本,支持macOS,Windows,Ubuntu。使用请执行get-clover.sh。 6 | 7 | 添加Hackintosh引导器以及常用插件自动编译脚本Hackintosh_build.sh,支持OpenCore,Clover,AppleSupportPkg以及常用Kexts。需要在macOS下执行。 8 | 9 | 更多教程文章,技术分享请访问博主博客www.bugprogrammer.me -------------------------------------------------------------------------------- /get-clover.sh: -------------------------------------------------------------------------------- 1 | #bin/bash 2 | 3 | clear 4 | echo '脚本开始执行。' 5 | echo '正在进行环境检测。' 6 | 7 | os=$(uname -s) 8 | if [ $os == 'Linux' ]; then 9 | echo '检测到您的操作系统是Linux(只支持ubuntu)' 10 | if ! [ -x "$(command -v git)" ]; then 11 | echo '尚未安装git,将自动安装' 12 | sudo apt-get -y install git 13 | fi 14 | 15 | if ! [ -x "$(command -v nautilus)" ]; then 16 | echo '尚未安装nautilus,将自动安装' 17 | sudo apt-get -y install nautilus 18 | fi 19 | elif [ $os == 'Darwin' ]; then 20 | echo '您的操作系统是macOS' 21 | xcode-select --install 22 | echo -e "\033[32m请注意您的电脑是否出现弹窗,如出现弹窗,请点击最右侧的安装按钮,安装结束后按回车继续。如果未出现弹窗直接按回车继续: \033[0m" 23 | #echo '请注意您的电脑是否出现弹窗,如出现弹窗,请点击最右侧的安装按钮,安装结束后按回车继续。如果未出现弹窗直接按回车继续:' 24 | read n1 25 | elif [ $(echo $os | grep 'NT') ]; then 26 | echo '您使用的操作系统是Windows' 27 | fi 28 | echo -e '\n正在获取Bugprogrammer的Hackintosh仓库,请稍后:' 29 | echo '-------------------------------------' 30 | 31 | cd ~ 32 | dir=hackintosh_$(date +%Y%m%d%H%M%S) 33 | git clone https://github.com/bugprogrammer/hackintosh.git $dir 34 | 35 | cd $dir 36 | 37 | echo -e '\nBugprogrammer亲测过的Hackintosh机型Clover下载,此脚本支持如下机型:' 38 | echo '-------------------------------------' 39 | git branch -r | grep -v 'master' | sed 's/origin\///g' | awk '{print NR,$0}' 40 | type=($(git branch -r | grep -v 'master' | sed 's/origin\///g')) 41 | 42 | echo '请输入所需机型序号' 43 | read input 44 | echo '您选择的机型为:'${type[$input-1]}',现在开始下载Clover' 45 | 46 | git checkout ${type[$input-1]} 47 | echo 'Clover下载完成,将自动打开,路径位于' 48 | pwd 49 | if [ $os == 'Linux' ]; then 50 | nautilus . 51 | elif [ $os == 'Darwin' ]; then 52 | open . 53 | elif [ $(echo $os | grep 'NT') ]; then 54 | C:/Windows/explorer . 55 | fi --------------------------------------------------------------------------------