0%

制作iso

fetch-macOS.py

生成一个BigSurInstaller.dmg

python3 fetch-macOS.py
hdiutil create -o BigSurInstaller.dmg -size 14g -layout GPTSPUD -fs HFS+J
sudo /Applications/Install\ macOS\ Big\ Sur.app/Contents/Resources/createinstallmedia --volume /Volumes/install_build --nointeraction
hdiutil detach -force "/Volumes/Install macOS Big Sur"
mv BigSurInstaller.dmg BigSurInstaller.iso

下载一个OpenCore-v10.iso

KVM-Opencore

OpenCore-v10.isoBigSurInstaller.iso上传到pve

新建虚拟机,配置如下

编辑 vim.tiny /etc/pve/qemu-server/101.conf

args: -device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" -smbios type=2 -device usb-kbd,bus=ehci.0,port=2 -cpu host,kvm=on,vendor=GenuineIntel,+kvm_pv_unhalt,+kvm_pv_eoi,+hypervisor,+invtsc

终端输入

echo "options kvm ignore_msrs=Y" >> /etc/modprobe.d/kvm.conf && update-initramfs -k all -u
echo 1 > /sys/module/kvm/parameters/ignore_msrs

将opencore放进efi

disk2s1 是opencorev10.iso disk0s1是安装BigSur的硬盘EFI分区

sudo dd if=/dev/disk2s1 of=/dev/disk0s1

直通设置

硬盘直通

qm set 592 -scsi2 /dev/disk/by-id/ata-ST3000DM001-1CH166_Z1F41BLC

显卡直通

加载vfio模块

编辑 /etc/modules

vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd

屏蔽gpu驱动

echo "blacklist radeon" >> /etc/modprobe.d/blacklist.conf 
echo "blacklist nouveau" >> /etc/modprobe.d/blacklist.conf
echo "blacklist nvidia" >> /etc/modprobe.d/blacklist.conf

开启IOMMU

编辑 /etc/kernel/cmdline (编辑/etc/default/grub里的GRUB_CMDLINE_LINUX_DEFAULT没有启作用)

lspci -nn找到显卡的vendor_id, device_id

intremap=no_x2apic_optout intel_iommu=on vfio-pci.ids=<vendor_id>:<device_id>,<vendor_id>:<device_id> disable_vga=1

例如

intremap=no_x2apic_optout intel_iommu=on vfio-pci.ids=10de:1287,10de:0e0f disable_vga=1

更新、重启

update-initramfs -u -k all
pve-efiboot-tool refresh
reboot

验证

# kernel参数
cat /proc/cmdline
# IOMMU
dmesg |grep -E "DMAR|IOMMU"
# vfio
dmesg |grep -i vfio
# vfio-pci Kernel driver in use: vfio-pci
lspci -nnk
# IOMMU groups
find /sys/kernel/iommu_groups/ -type l

设置

显卡插上显示器,此时如果显示器没有信号,插拔一下显示器

OSK值

ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc

视频

https://www.bilibili.com/video/BV1N54y1k7aw/

下载images

镜像列表

镜像地址

备份

备份数据

adb backup -f all -all -apk -nosystem

备份apk

for APP in $(adb shell pm list packages -3)
do
APP=$( echo ${APP} | sed "s/^package://")
adb backup -f ${APP}.backup ${APP}
done

刷机

adb reboot bootloader
./flash-all.sh

root

先安装翻墙软件(如果是在大陆)和magisk manager

# 安装翻墙软件
adb install io.github.trojan_gfw.igniter.apk
# 安装magisk manager
adb install com.topjohnwu.magisk.apk

手机上打开magisk manager,选择测试通道

NOTE: 很关键,就当前而言,稳定通道无法开机,会去到bootloader,显示错误信息slot unbootable load error,嗯~我试过了

如果在flash-all.sh刷机那一步去掉了-w,也就是不删除数据,而之前又安装有magisk和一些不兼容modules,可能开机会一直循环在谷歌图标那里,这是相关issues. issues里提到删除/data/adb/modules文件夹,我没有TWRP,所以直接在谷歌图标循环的时候,adb shell, su进去删除的,但是没有用.嗯~我也试过了,所以才备份数据重新刷机的.

magisk manager界面,最新显示无法获取,请检查自己的网络环境,可能需要翻墙

解压image-walleye-rp1a.201005.004.zip,找到boot.img,放到手机上/sdcard/Download

adb push boot.img /sdcard/Download

magisk manager界面,点 Magisk旁边的安装,选择选择并修补一个文件,选中boot.img,点开始

将生成的magisk_patched.img拉回电脑

adb pull /sdcard/Download/magisk_patched.img

重启到bootloader,刷入magisk_patched.img

adb reboot bootloader
fastboot flash boot magisk_patched.img
fastboot reboot

恢复备份

adb install <app>.apk
adb restore all

安装 Proxmox VE

有一张ssd盘和3张hdd盘,都是插在raid 控制器上,经过一番google、百度,希望使用zfs,所以要将raid控制器的raid模式改成hba模式.

计划将proxmox安装在ssd盘,3张hdd盘做Striped Vdev ZPool(raid0)

安装macOS

编辑 vim.tiny /etc/pve/qemu-server/101.conf

args: -device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" -smbios type=2 -devi
ce usb-kbd,bus=ehci.0,port=2 -cpu host,kvm=on,vendor=GenuineIntel,+kvm_pv_unhalt,+kvm_pv_eoi,+hypervisor,+invtsc

终端输入

echo "options kvm ignore_msrs=Y" >> /etc/modprobe.d/kvm.conf && update-initramfs -k all -u
echo 1 > /sys/module/kvm/parameters/ignore_msrs

OSK值

ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc

显卡直通

10de:1287,10de:0e0f

加载vfio模块

编辑 /etc/modules

vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd

屏蔽gpu驱动

echo "blacklist radeon" >> /etc/modprobe.d/blacklist.conf 
echo "blacklist nouveau" >> /etc/modprobe.d/blacklist.conf
echo "blacklist nvidia" >> /etc/modprobe.d/blacklist.conf

开启IOMMU

编辑 /etc/kernel/cmdline (编辑/etc/default/grub里的GRUB_CMDLINE_LINUX_DEFAULT没有启作用)

intel_iommu=on vfio-pci.ids=<vendor_id>:<device_id>,<vendor_id>:<device_id> disable_vga=1

更新、重启

update-initramfs -u -k all
pve-efiboot-tool refresh
reboot

验证

# kernel参数
cat /proc/cmdline
# IOMMU
dmesg |grep -E "DMAR|IOMMU"
# vfio
dmesg |grep -i vfio
# vfio-pci Kernel driver in use: vfio-pci
lspci -nnk
# IOMMU groups
find /sys/kernel/iommu_groups/ -type l

下载镜像

https://apps.apple.com/us/app/macos-catalina/id1466841314?l=en-us&mt=12

转换格式

hdiutil create -o ~/Desktop/Catalina.dmg -size 9g -layout GPTSPUD -fs HFS+J
hdiutil attach ~/Desktop/Catalina.dmg -noverify -mountpoint /Volumes/install_build
sudo /Applications/Install\ macOS\ Catalina.app/Contents/Resources/createinstallmedia –volume /Volumes/install_build –nointeraction
hdiutil detach “/Volumes/Install macOS Catalina”
hdiutil convert ~/Desktop/Catalina.dmg -format UDTO -o ~/Desktop/Catalina.cdr
mv ~/Desktop/Catalina.cdr ~/Desktop/Catalina.iso

直通显卡

hypervisor.cpuid.v0 = “FALSE”

第一次设置要重启esxi

直通usb鼠标键盘

lsusb -v | grep -E ‘(^Bus|HID)’

vi /etc/vmware/config

usb.generic.allowHID = “TRUE”
usb.quirks.device0 = “0x24ae:0x2003 allow”
usb.quirks.device1 = “0x413c:0x2107 allow”
usb.quirks.device2 = “0x093a:0x2510 allow”

vi /bootbank/boot.cfg
CONFIG./USB/quirks=0x24ae:0x2003::0xffff:UQ_KBD_IGNORE:0x413c:0x2107::0xffff:UQ_KBD_IGNORE:0x093a:0x2510::0xffff:UQ_KBD_IGNORE

第一次设置要重启esxi

esxi upgrade

vim-cmd /hostsvc/maintenance_mode_enter
esxcli network firewall ruleset set -e true -r httpClient
esxcli software sources profile list -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml | grep ESXi-7.0.0
esxcli software profile update -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml -p ESXi-7.0.0-15843807-standard
reboot
vim-cmd /hostsvc/maintenance_mode_exit

esxcli software sources profile list -d /vmfs/volumes/5c9bf508-925a81c5-8aa9-40623106c271/VMware-ESXi-7.0.0-15843807-depot.zip
esxcli software profile update -p ESXi-7.0.0-15843807-standard -d /vmfs/volumes/5c9bf508-925a81c5-8aa9-40623106c271/VMware-ESXi-7.0.0-15843807-depot.zip –dry-run

esxcli software profile update –allow-downgrades

esxi 挂载upan

/etc/init.d/usbarbitrator stop
esxcli storage core device list | grep -i usb
esxcli storage filesystem list

esxi解锁

https://github.com/shanyungyang/esxi-unlocker