您现在的位置是: 网站首页 >系统软件 系统软件

黑苹果Big Sur进入桌面紫屏问题

admin2020年12月24日 21:02 Mac 3282人已围观

# 黑苹果Big Sur进入桌面紫屏问题 ## 关闭SIP OpenCore引导的BigSur(参考 [disabling-sip](https://dortania.github.io/OpenCore-Install-Guide/troubleshooting/troubleshooting.html#disabling-sip)) - 修改`config.pdist`文件中的`NVRAM -> Block -> 7C436110-AB2A-4BBB-A880-FE41995C9F82` -> `csr-active-config`,将其值设为`FF0F0000`(仅适用于BigSur) ```bash # 其他版本: 00000000 - SIP completely enabled (0x0). 03000000 - Disable kext signing (0x1) and filesystem protections (0x2). FF030000 - Disable all flags in macOS High Sierra (0x3ff). FF070000 - Disable all flags in macOS Mojave and in macOS Catalina (0x7ff) as Apple introduced a value for executable policy. FF0F0000 - Disable all flags in macOS Big Sur (0xfff) which has another new flag for authenticated root. ``` - 重启,从OpenCore的启动菜单中进入Recovery,打开实用工具-终端,执行下面两句命令: ```bash csrutil disable csrutil authenticated-root disable ``` (若无此步,在创建启动快照时会出现“Operation not permitted”问题) - 进入系统,在终端执行`csrutil status`和`csrutil authenticated-root status`,返回结果都为`disabled`,确认已关闭。(若失败,则再次重启,在OpenCore的启动项处选择Reset NVRAM) ## 生成EDID - 下载 [patch-edid.rb](https://gist.github.com/adaugherity/7435890) 2020年12月24日文件名`patch-edid.rb`,其内容为 ```ruby #!/usr/bin/ruby # Create display override file to force Mac OS X to use RGB mode for Display # see http://embdev.net/topic/284710 require 'base64' data=`ioreg -l -d0 -w 0 -r -c AppleDisplay` edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten productids=data.scan(/DisplayProductID.*?([0-9]+)/i).flatten displays = [] edids.each_with_index do |edid, i| disp = { "edid_hex"=>edid, "vendorid"=>vendorids[i].to_i, "productid"=>productids[i].to_i } displays.push(disp) end # Process all displays if displays.length > 1 puts "Found %d displays! You should only install the override file for the one which" % displays.length puts "is giving you problems.","\n" elsif displays.length == 0 puts "No display data found! Are any external displays connected?" end displays.each do |disp| # Retrieve monitor model from EDID display descriptor i = disp["edid_hex"].index('000000fc00') if i.nil? monitor_name = "Display" else # The monitor name is stored in (up to) 13 bytes of text following 00 00 00 fc 00. # If the name is shorter than 13 bytes, it is terminated with a newline (0a) and then padded with spaces. monitor_name = [disp["edid_hex"][i + 10, 26].to_s].pack("H*") monitor_name.rstrip! # remove trailing newline/spaces end puts "Found display '#{monitor_name}': vendor ID=#{disp["vendorid"]} (0x%x), product ID=#{disp["productid"]} (0x%x)" % [disp["vendorid"], disp["productid"]] puts "Raw EDID data:\n#{disp["edid_hex"]}" bytes=disp["edid_hex"].scan(/../).map{|x|Integer("0x#{x}")}.flatten puts "Setting color support to RGB 4:4:4 only" bytes[24] &= ~(0b11000) puts "Number of extension blocks: #{bytes[126]}" puts "removing extension block" bytes = bytes[0..127] bytes[126] = 0 bytes[127] = (0x100-(bytes[0..126].reduce(:+) % 256)) % 256 puts puts "Recalculated checksum: 0x%x" % bytes[127] puts "new EDID:\n#{bytes.map{|b|"%02X"%b}.join}" Dir.mkdir("DisplayVendorID-%x" % disp["vendorid"]) rescue nil filename = "DisplayVendorID-%x/DisplayProductID-%x" % [disp["vendorid"], disp["productid"]] puts "Output file: #{Dir.pwd}/#{filename}" f = File.open(filename, 'w') f.write '<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0">' f.write " <dict> <key>DisplayProductName</key> <string>#{monitor_name} - forced RGB mode (EDID override)</string> <key>IODisplayEDID</key> <data>#{Base64.encode64(bytes.pack('C*'))}</data> <key>DisplayVendorID</key> <integer>#{disp["vendorid"]}</integer> <key>DisplayProductID</key> <integer>#{disp["productid"]}</integer> </dict> </plist>" f.close puts "\n" end # displays.each ``` - 打开终端,运行`patch-edid.rb`,直接将该文件拉到终端回车即可 - 运行完成后,会在用户目录下生成文件夹`DisplayVendorID-xxx`(命令结果会有显示具体路径) ## 挂载Volume 在BigSur之前都没有的操作(参考 [writing-to-the-macos-system-partition](https://dortania.github.io/OpenCore-Install-Guide/troubleshooting/troubleshooting.html#writing-to-the-macos-system-partition)) - 确认 live volume 名称`disk*s*`,在终端执行`mount`,在返回结果里找到挂载点`/`的设备名,去掉最后两位。 - 挂载`disk*s*`,创建一个挂载目录,可创建在任意有写入权限的位置,例如:`/Users/用户名/mntdisk*s*`,以下以这个目录为例`sudo mount -o nobrowse -t apfs /dev/diskNsM /path/to/mntpoint` - 复制文件夹`DisplayVendorID-xxx`到`/Users/用户名/mnt*s*/System/Library/Displays/Contents/Resources/Overrides`,若已存在同名文件夹,选择合并即可;若已存在同名文件,则覆盖。`sudo cp -r /Users/xcp/Downloads/DisplayVendorID-5e3 /Users/xcp/mnt3s5/System/Library/Displays/Contents/Resources/Overrides` - 创建snapshot,并且下次从之启动`sudo bless --folder /path/to/mntpoint/System/Library/CoreServices --bootefi --create-snapshot` ## 综合脚本 ```bash #!/bin/bash # 针对显示器修复紫屏问题 # repair_purple_screen.sh # 进入用户家目录 cd ${HOME} which wget if [ $? -ne 0 ]; then # 安装homebrew,为了使用brew工具 /usr/bin/ruby -e "$(curl -fsSL http://raw.githubusercontent.com/Homebrew/install/master/install)" # 安装wget brew install wget fi # 下载patch-edid.rb脚本 rm -rf patch-edid.rb wget https://gist.githubusercontent.com/adaugherity/7435890/raw/00ff3ead17ae77d2f1c376e90831c037b7dea7ed/patch-edid.rb # 运行脚本 file_path=$(/usr/bin/ruby patch-edid.rb | grep "Output" | awk -F": " '{print $2}' | awk -F"/DisplayProductID" '{print $1}') echo $file_path # 获取磁盘名称呢个 disk_name=$(mount | grep "on / (" | awk '{print $1}'| awk -F"/" '{print $3}') echo $disk_name # 可以得到:disk1s5s1 disk_name=${disk_name%??} echo $disk_name # 创建挂载点 mkdir mnt$disk_name # 挂载 echo "duoyi" | sudo -S mount -o nobrowse -t apfs /dev/$disk_name mnt$disk_name # 复制文件 echo "duoyi" | sudo -S cp -r $file_path mnt$disk_name/System/Library/Displays/Contents/Resources/Overrides # 创建snapshot echo "duoyi" | sudo -S bless --folder mnt$disk_name/System/Library/CoreServices --bootefi --create-snapshot # 取消挂载 umount mnt$disk_name echo "finish..." ``` ## 重启完成 可在系统报告中查看是否已经强制启用RGB输出。每次系统更新后需要重新复制一次`DisplayVendorID-xxx`。 > 参考[黑苹果独显外接显示器紫屏解决办法](https://wumingbin.com/2019/09/24/黑苹果独显外接显示器紫屏解决办法/) > 参考[解决mac BigSur外接显示器发白、发黄、字体发虚 (OpenCore关闭SIP和Read-Only System)](https://blog.csdn.net/baidu_33340703/article/details/108905711)

很赞哦! (6)

文章交流

  • emoji
0人参与,0条评论

当前用户

未登录,点击   登录

站点信息

  • 建站时间:网站已运行2077天
  • 系统信息:Linux
  • 后台程序:Python: 3.8.10
  • 网站框架:Django: 3.2.6
  • 文章统计:256 篇
  • 文章评论:60 条
  • 腾讯分析网站概况-腾讯分析
  • 百度统计网站概况-百度统计
  • 公众号:微信扫描二维码,关注我们
  • QQ群:QQ加群,下载网站的学习源码
返回
顶部
标题 换行 登录
网站