mirror of
https://github.com/luchina-gabriel/OSX-PROXMOX.git
synced 2026-09-25 20:47:01 +00:00
Compare commits
8
Commits
b3d2b2b9f4
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
209f6df3a4 | ||
|
|
252186c717 | ||
|
|
e1888a949b | ||
|
|
0294682ed3 | ||
|
|
aa97b72f31 | ||
|
|
28ededa7b8 | ||
|
|
e0433f28d4 | ||
|
|
d06f2af3fa |
@@ -1,163 +0,0 @@
|
||||
[device "ehci"]
|
||||
driver = "ich9-usb-ehci1"
|
||||
multifunction = "on"
|
||||
bus = "pcie.0"
|
||||
addr = "1d.7"
|
||||
|
||||
[device "uhci-1"]
|
||||
driver = "ich9-usb-uhci1"
|
||||
multifunction = "on"
|
||||
bus = "pcie.0"
|
||||
addr = "1d.0"
|
||||
masterbus = "ehci.0"
|
||||
firstport = "0"
|
||||
|
||||
[device "uhci-2"]
|
||||
driver = "ich9-usb-uhci2"
|
||||
multifunction = "on"
|
||||
bus = "pcie.0"
|
||||
addr = "1d.1"
|
||||
masterbus = "ehci.0"
|
||||
firstport = "2"
|
||||
|
||||
[device "uhci-3"]
|
||||
driver = "ich9-usb-uhci3"
|
||||
multifunction = "on"
|
||||
bus = "pcie.0"
|
||||
addr = "1d.2"
|
||||
masterbus = "ehci.0"
|
||||
firstport = "4"
|
||||
|
||||
[device "ehci-2"]
|
||||
driver = "ich9-usb-ehci2"
|
||||
multifunction = "on"
|
||||
bus = "pcie.0"
|
||||
addr = "1a.7"
|
||||
|
||||
[device "uhci-4"]
|
||||
driver = "ich9-usb-uhci4"
|
||||
multifunction = "on"
|
||||
bus = "pcie.0"
|
||||
addr = "1a.0"
|
||||
masterbus = "ehci-2.0"
|
||||
firstport = "0"
|
||||
|
||||
[device "uhci-5"]
|
||||
driver = "ich9-usb-uhci5"
|
||||
multifunction = "on"
|
||||
bus = "pcie.0"
|
||||
addr = "1a.1"
|
||||
masterbus = "ehci-2.0"
|
||||
firstport = "2"
|
||||
|
||||
[device "uhci-6"]
|
||||
driver = "ich9-usb-uhci6"
|
||||
multifunction = "on"
|
||||
bus = "pcie.0"
|
||||
addr = "1a.2"
|
||||
masterbus = "ehci-2.0"
|
||||
firstport = "4"
|
||||
|
||||
# FIXME: Remove this audio0 device at the next possible time
|
||||
# see: https://pve.proxmox.com/pipermail/pve-devel/2019-July/038417.html
|
||||
# https://pve.proxmox.com/pipermail/pve-devel/2019-July/038428.html
|
||||
[device "audio0"]
|
||||
driver = "ich9-intel-hda"
|
||||
bus = "pcie.0"
|
||||
addr = "1b.0"
|
||||
|
||||
|
||||
[device "ich9-pcie-port-1"]
|
||||
driver = "pcie-root-port"
|
||||
x-speed = "16"
|
||||
x-width = "32"
|
||||
multifunction = "on"
|
||||
bus = "pcie.0"
|
||||
addr = "1c.0"
|
||||
port = "1"
|
||||
chassis = "1"
|
||||
|
||||
[device "ich9-pcie-port-2"]
|
||||
driver = "pcie-root-port"
|
||||
x-speed = "16"
|
||||
x-width = "32"
|
||||
multifunction = "on"
|
||||
bus = "pcie.0"
|
||||
addr = "1c.1"
|
||||
port = "2"
|
||||
chassis = "2"
|
||||
|
||||
[device "ich9-pcie-port-3"]
|
||||
driver = "pcie-root-port"
|
||||
x-speed = "16"
|
||||
x-width = "32"
|
||||
multifunction = "on"
|
||||
bus = "pcie.0"
|
||||
addr = "1c.2"
|
||||
port = "3"
|
||||
chassis = "3"
|
||||
|
||||
[device "ich9-pcie-port-4"]
|
||||
driver = "pcie-root-port"
|
||||
x-speed = "16"
|
||||
x-width = "32"
|
||||
multifunction = "on"
|
||||
bus = "pcie.0"
|
||||
addr = "1c.3"
|
||||
port = "4"
|
||||
chassis = "4"
|
||||
|
||||
##
|
||||
# Example PCIe switch with two downstream ports
|
||||
#
|
||||
#[device "pcie-switch-upstream-port-1"]
|
||||
# driver = "x3130-upstream"
|
||||
# bus = "ich9-pcie-port-4"
|
||||
# addr = "00.0"
|
||||
#
|
||||
#[device "pcie-switch-downstream-port-1-1"]
|
||||
# driver = "xio3130-downstream"
|
||||
# multifunction = "on"
|
||||
# bus = "pcie-switch-upstream-port-1"
|
||||
# addr = "00.0"
|
||||
# port = "1"
|
||||
# chassis = "5"
|
||||
#
|
||||
#[device "pcie-switch-downstream-port-1-2"]
|
||||
# driver = "xio3130-downstream"
|
||||
# multifunction = "on"
|
||||
# bus = "pcie-switch-upstream-port-1"
|
||||
# addr = "00.1"
|
||||
# port = "1"
|
||||
# chassis = "6"
|
||||
|
||||
|
||||
|
||||
[device "pcidmi"]
|
||||
driver = "i82801b11-bridge"
|
||||
bus = "pcie.0"
|
||||
addr = "1e.0"
|
||||
|
||||
[device "pci.0"]
|
||||
driver = "pci-bridge"
|
||||
bus = "pcidmi"
|
||||
addr = "1.0"
|
||||
chassis_nr = "1"
|
||||
|
||||
[device "pci.1"]
|
||||
driver = "pci-bridge"
|
||||
bus = "pcidmi"
|
||||
addr = "2.0"
|
||||
chassis_nr = "2"
|
||||
|
||||
[device "pci.2"]
|
||||
driver = "pci-bridge"
|
||||
bus = "pcidmi"
|
||||
addr = "3.0"
|
||||
chassis_nr = "3"
|
||||
|
||||
[device "pci.3"]
|
||||
driver = "pci-bridge"
|
||||
bus = "pcidmi"
|
||||
addr = "4.0"
|
||||
chassis_nr = "4"
|
||||
+3
-1
@@ -1,4 +1,6 @@
|
||||
macOS/VM Crash when try connect in WiFi [for BCM94360, in macOS Sonoma or Sequoia]
|
||||
macOS/VM Crash when try connect in WiFi [for BCM94360, in macOS Sonoma, Sequoia or Tahoe]
|
||||
|
||||
FOR PVE v7 ONLY
|
||||
|
||||
1. Run osx-setup and choose option '200 - Add Promox VE NO Subscription repository'
|
||||
|
||||
+312
@@ -0,0 +1,312 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# apply-wifi-reset-bus.sh
|
||||
#
|
||||
# Forca secondary bus reset (hot reset no link) em placas WiFi PCIe usadas em
|
||||
# passthrough VFIO, e persiste a configuracao via regra udev.
|
||||
#
|
||||
# Contexto: em varios chips Intel (AX210 8086:2725 e afins) o FLR completa sem
|
||||
# erro mas nao devolve o card a um estado carregavel de firmware. Sintoma: a
|
||||
# placa funciona no primeiro "qm start" depois do boot do host e falha em todos
|
||||
# os starts seguintes -- o driver do guest nao atacha. O secondary bus reset
|
||||
# resolve porque faz hot reset no link PCIe.
|
||||
#
|
||||
# Uso: sudo ./apply-wifi-reset-bus.sh [--all-vendors]
|
||||
#
|
||||
# --all-vendors lista placas de rede sem fio de qualquer fabricante
|
||||
# (por padrao filtra apenas Intel, vendor 0x8086)
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
PCI_DEVICES=/sys/bus/pci/devices
|
||||
RULES_DIR=/etc/udev/rules.d
|
||||
FILTER_VENDOR=0x8086
|
||||
VENDOR_LABEL="Intel"
|
||||
|
||||
[[ "${1:-}" == "--all-vendors" ]] && { FILTER_VENDOR=""; VENDOR_LABEL="qualquer fabricante"; }
|
||||
|
||||
# ---------------------------------------------------------------- aparencia --
|
||||
if [[ -t 1 ]]; then
|
||||
B=$'\e[1m'; R=$'\e[31m'; G=$'\e[32m'; Y=$'\e[33m'; C=$'\e[36m'; Z=$'\e[0m'
|
||||
else
|
||||
B=""; R=""; G=""; Y=""; C=""; Z=""
|
||||
fi
|
||||
|
||||
info() { printf '%s\n' "$*"; }
|
||||
ok() { printf '%s\n' "${G}✓${Z} $*"; }
|
||||
warn() { printf '%s\n' "${Y}!${Z} $*"; }
|
||||
err() { printf '%s\n' "${R}✗${Z} $*" >&2; }
|
||||
head1() { printf '\n%s\n' "${B}$*${Z}"; }
|
||||
die() { err "$*"; exit 1; }
|
||||
|
||||
# --------------------------------------------------------- estado / cleanup --
|
||||
SYSPATH=""
|
||||
ORIG_METHOD=""
|
||||
RESTORE_NEEDED=0
|
||||
|
||||
cleanup() {
|
||||
if (( RESTORE_NEEDED )) && [[ -n "$SYSPATH" && -n "$ORIG_METHOD" ]]; then
|
||||
warn "Restaurando reset_method original (${ORIG_METHOD}) apos falha."
|
||||
printf '%s\n' "$ORIG_METHOD" > "$SYSPATH/reset_method" 2>/dev/null || true
|
||||
fi
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
# ------------------------------------------------------------ pre-requisitos --
|
||||
(( EUID == 0 )) || die "Rode como root (sudo $0)."
|
||||
|
||||
for bin in lspci udevadm; do
|
||||
command -v "$bin" >/dev/null 2>&1 \
|
||||
|| die "Comando '$bin' nao encontrado. Instale pciutils / systemd-udev."
|
||||
done
|
||||
|
||||
[[ -d "$PCI_DEVICES" ]] || die "$PCI_DEVICES nao existe. Este script e para Linux."
|
||||
|
||||
# ------------------------------------------------------------- enumeracao ----
|
||||
# Classe PCI 0x0280 = Network controller (wireless). Ethernet e 0x0200.
|
||||
declare -a SLOTS=() NAMES=() DRIVERS=() METHODS=()
|
||||
|
||||
for dev in "$PCI_DEVICES"/*/; do
|
||||
slot=$(basename "$dev")
|
||||
[[ -r "$dev/vendor" && -r "$dev/class" ]] || continue
|
||||
|
||||
vendor=$(<"$dev/vendor")
|
||||
[[ -z "$FILTER_VENDOR" || "$vendor" == "$FILTER_VENDOR" ]] || continue
|
||||
|
||||
class=$(<"$dev/class")
|
||||
[[ "${class:0:6}" == "0x0280" ]] || continue
|
||||
|
||||
name=$(lspci -Dnn -s "$slot" 2>/dev/null | cut -d' ' -f2- || true)
|
||||
[[ -n "$name" ]] || name="(descricao indisponivel)"
|
||||
|
||||
if [[ -L "$dev/driver" ]]; then
|
||||
driver=$(basename "$(readlink -f "$dev/driver")")
|
||||
else
|
||||
driver="(nenhum)"
|
||||
fi
|
||||
|
||||
if [[ -r "$dev/reset_method" ]]; then
|
||||
method=$(<"$dev/reset_method")
|
||||
else
|
||||
method="(indisponivel)"
|
||||
fi
|
||||
|
||||
SLOTS+=("$slot"); NAMES+=("$name"); DRIVERS+=("$driver"); METHODS+=("$method")
|
||||
done
|
||||
|
||||
(( ${#SLOTS[@]} )) || die "Nenhuma placa WiFi PCIe de ${VENDOR_LABEL} encontrada.
|
||||
Se a placa e de outro fabricante, rode com --all-vendors."
|
||||
|
||||
# ------------------------------------------------------------------- menu ----
|
||||
head1 "Placas WiFi PCIe detectadas (${VENDOR_LABEL})"
|
||||
printf '\n'
|
||||
printf ' %-3s %-15s %-11s %-14s %s\n' "#" "SLOT" "DRIVER" "RESET_METHOD" "DISPOSITIVO"
|
||||
printf ' %-3s %-15s %-11s %-14s %s\n' "---" "---------------" "-----------" "--------------" "-----------"
|
||||
for i in "${!SLOTS[@]}"; do
|
||||
marker=""
|
||||
[[ "${METHODS[$i]}" == "bus" ]] && marker=" ${G}(ja em bus)${Z}"
|
||||
printf ' %-3s %-15s %-11s %-14s %s%s\n' \
|
||||
"$((i+1))" "${SLOTS[$i]}" "${DRIVERS[$i]}" "${METHODS[$i]}" "${NAMES[$i]:0:60}" "$marker"
|
||||
done
|
||||
printf '\n'
|
||||
|
||||
if (( ${#SLOTS[@]} == 1 )); then
|
||||
prompt="Selecione a placa [1] (Enter aceita, q sai): "
|
||||
default_choice=1
|
||||
else
|
||||
prompt="Selecione a placa [1-${#SLOTS[@]}] (q sai): "
|
||||
default_choice=""
|
||||
fi
|
||||
|
||||
choice=""
|
||||
while true; do
|
||||
read -r -p "$prompt" choice || die "Entrada interrompida."
|
||||
[[ "$choice" == "q" || "$choice" == "Q" ]] && { info "Cancelado."; exit 0; }
|
||||
[[ -z "$choice" && -n "$default_choice" ]] && choice="$default_choice"
|
||||
if [[ "$choice" =~ ^[0-9]+$ ]] && (( choice >= 1 && choice <= ${#SLOTS[@]} )); then
|
||||
break
|
||||
fi
|
||||
err "Opcao invalida."
|
||||
done
|
||||
|
||||
IDX=$((choice-1))
|
||||
SLOT="${SLOTS[$IDX]}"
|
||||
SYSPATH="$PCI_DEVICES/$SLOT"
|
||||
NAME="${NAMES[$IDX]}"
|
||||
CURRENT="${METHODS[$IDX]}"
|
||||
RULE_FILE="$RULES_DIR/99-pci-reset-bus-${SLOT//[:.]/-}.rules"
|
||||
|
||||
head1 "Placa selecionada"
|
||||
info " Slot : $SLOT"
|
||||
info " Dispositivo : $NAME"
|
||||
info " Driver atual : ${DRIVERS[$IDX]}"
|
||||
info " reset_method : $CURRENT"
|
||||
info " Regra udev : $RULE_FILE"
|
||||
|
||||
# -------------------------------------------------------- validacoes previas --
|
||||
[[ -w "$SYSPATH/reset_method" ]] \
|
||||
|| die "$SYSPATH/reset_method nao existe ou nao e gravavel.
|
||||
Este kernel nao expoe controle de reset para esse dispositivo."
|
||||
|
||||
head1 "Verificacoes"
|
||||
|
||||
# Estado atual x persistencia: 'bus' setado na mao nao sobrevive ao reboot.
|
||||
RULE_EXISTS=0
|
||||
[[ -f "$RULE_FILE" ]] && RULE_EXISTS=1
|
||||
|
||||
if [[ "$CURRENT" == "bus" ]]; then
|
||||
if (( RULE_EXISTS )); then
|
||||
ok "Ja esta em 'bus' E a regra udev ja existe."
|
||||
info " Conteudo atual de $RULE_FILE:"
|
||||
sed 's/^/ /' "$RULE_FILE"
|
||||
printf '\n'
|
||||
read -r -p "Reescrever a regra e revalidar mesmo assim? [s/N] " again
|
||||
[[ "$again" =~ ^[sSyY]$ ]] || { info "Nada a fazer. Saindo."; exit 0; }
|
||||
else
|
||||
warn "Ja esta em 'bus', mas NAO ha regra udev para este dispositivo."
|
||||
warn "Isso indica que o valor foi setado a mao e sera perdido no proximo"
|
||||
warn "reboot do host. O script vai criar a regra para tornar permanente."
|
||||
fi
|
||||
else
|
||||
info " reset_method atual: '$CURRENT' -> sera forcado para 'bus'."
|
||||
fi
|
||||
|
||||
# Aviso sobre VMs em execucao: mexer no reset de um device em uso por uma VM
|
||||
# ligada pode derrubar o dispositivo dentro dela.
|
||||
if command -v qm >/dev/null 2>&1; then
|
||||
running=$(qm list 2>/dev/null | awk 'NR>1 && $3=="running" {print $1}' | tr '\n' ' ' || true)
|
||||
if [[ -n "${running// }" ]]; then
|
||||
warn "VMs em execucao: ${running}"
|
||||
warn "Se alguma usa $SLOT em passthrough, desligue-a antes de continuar."
|
||||
fi
|
||||
fi
|
||||
|
||||
printf '\n'
|
||||
read -r -p "Aplicar o patch em ${SLOT}? [s/N] " confirm
|
||||
[[ "$confirm" =~ ^[sSyY]$ ]] || { info "Cancelado."; exit 0; }
|
||||
|
||||
# A partir daqui mexemos no sistema.
|
||||
ORIG_METHOD="$CURRENT"
|
||||
RESTORE_NEEDED=1
|
||||
|
||||
# --------------------------------- passo 1: descobrir metodos disponiveis ----
|
||||
head1 "1/5 Consultando metodos de reset suportados"
|
||||
|
||||
AVAILABLE=""
|
||||
if printf 'default\n' > "$SYSPATH/reset_method" 2>/dev/null; then
|
||||
AVAILABLE=$(<"$SYSPATH/reset_method")
|
||||
info " Metodos disponiveis: $AVAILABLE"
|
||||
else
|
||||
warn "Kernel nao aceitou 'default'; pulando a checagem previa."
|
||||
fi
|
||||
|
||||
if [[ -n "$AVAILABLE" ]] && ! grep -qw "bus" <<<"$AVAILABLE"; then
|
||||
die "O dispositivo $SLOT nao suporta secondary bus reset.
|
||||
Metodos disponiveis: $AVAILABLE
|
||||
Isso normalmente significa que ele nao esta sozinho no root port PCIe.
|
||||
Um bus reset ali afetaria dispositivos vizinhos, entao o kernel nao oferece."
|
||||
fi
|
||||
ok "Secondary bus reset ('bus') e suportado."
|
||||
|
||||
# ---------------------------------------- passo 2: escrever a regra udev -----
|
||||
head1 "2/5 Gravando a regra udev"
|
||||
|
||||
if (( RULE_EXISTS )); then
|
||||
BACKUP="${RULE_FILE}.bak.$(date +%Y%m%d%H%M%S)"
|
||||
cp -a "$RULE_FILE" "$BACKUP"
|
||||
info " Backup do arquivo anterior: $BACKUP"
|
||||
fi
|
||||
|
||||
cat > "$RULE_FILE" <<RULE_EOF
|
||||
# Gerado por apply-wifi-reset-bus.sh em $(date -Is)
|
||||
#
|
||||
# $NAME
|
||||
#
|
||||
# O FLR neste dispositivo completa sem erro mas nao o devolve a um estado
|
||||
# carregavel de firmware entre execucoes da VM. Forca secondary bus reset,
|
||||
# que faz hot reset no link PCIe.
|
||||
SUBSYSTEM=="pci", KERNEL=="$SLOT", ATTR{reset_method}="bus"
|
||||
RULE_EOF
|
||||
|
||||
ok "Regra gravada em $RULE_FILE"
|
||||
sed 's/^/ /' "$RULE_FILE"
|
||||
|
||||
# ----------------------------------------------- passo 3: recarregar udev ----
|
||||
head1 "3/5 Recarregando o udev"
|
||||
|
||||
udevadm control --reload
|
||||
ok "Regras recarregadas."
|
||||
|
||||
# ------------------------------ passo 4: validar que a REGRA e quem aplica ---
|
||||
head1 "4/5 Validando"
|
||||
|
||||
# Zera para o default antes do trigger. Se depois do trigger o valor virar
|
||||
# 'bus', a prova e de que foi a regra que aplicou -- e nao um valor residual.
|
||||
if printf 'default\n' > "$SYSPATH/reset_method" 2>/dev/null; then
|
||||
pre=$(<"$SYSPATH/reset_method")
|
||||
info " Antes do trigger : $pre"
|
||||
if [[ "$pre" == "bus" ]]; then
|
||||
warn "Valor default ja e 'bus'; a validacao nao consegue isolar o efeito"
|
||||
warn "da regra, mas a regra esta gravada corretamente."
|
||||
fi
|
||||
else
|
||||
warn "Nao foi possivel zerar para default; validacao sera menos conclusiva."
|
||||
fi
|
||||
|
||||
udevadm trigger --action=add "$SYSPATH"
|
||||
udevadm settle --timeout=10 || true
|
||||
|
||||
FINAL=$(<"$SYSPATH/reset_method")
|
||||
info " Depois do trigger: $FINAL"
|
||||
|
||||
if [[ "$FINAL" != "bus" ]]; then
|
||||
err "A regra nao surtiu efeito. reset_method continua '$FINAL'."
|
||||
printf '\n'
|
||||
info "Fallback: use um servico systemd, que roda mais tarde no boot e nao"
|
||||
info "depende da janela do evento 'add' do udev:"
|
||||
cat <<'FALLBACK_EOF'
|
||||
|
||||
cat > /etc/systemd/system/pci-reset-bus.service <<'EOF'
|
||||
[Unit]
|
||||
Description=Forca secondary bus reset no dispositivo PCI
|
||||
After=sysinit.target
|
||||
Before=pve-guests.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/bin/sh -c 'echo bus > /sys/bus/pci/devices/SLOT_AQUI/reset_method'
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable pci-reset-bus.service
|
||||
|
||||
FALLBACK_EOF
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ok "reset_method = bus, aplicado pela regra udev."
|
||||
|
||||
# --------------------------------------------------------- passo 5: final ----
|
||||
RESTORE_NEEDED=0
|
||||
|
||||
head1 "5/5 Concluido"
|
||||
printf '\n'
|
||||
ok "Patch aplicado em ${B}${SLOT}${Z} (${NAME})"
|
||||
printf '\n'
|
||||
info "${Y}Falta o teste definitivo: reinicie o host.${Z}"
|
||||
info "O valor de reset_method nao persiste sozinho -- ele volta ao default a"
|
||||
info "cada boot. O que persiste e a regra udev, e so um reboot prova que ela"
|
||||
info "esta sendo aplicada cedo o bastante."
|
||||
printf '\n'
|
||||
info "Depois do reboot, confirme com:"
|
||||
printf '\n'
|
||||
info " ${C}cat /sys/bus/pci/devices/${SLOT}/reset_method${Z} # esperado: bus"
|
||||
printf '\n'
|
||||
info "Se voltar '${AVAILABLE:-flr bus}', o evento 'add' do udev disparou cedo"
|
||||
info "demais no boot; nesse caso troque pelo servico systemd (o script mostra"
|
||||
info "o modelo quando a validacao falha)."
|
||||
printf '\n'
|
||||
info "Para reverter: ${C}rm ${RULE_FILE} && udevadm control --reload${Z}"
|
||||
printf '\n'
|
||||
@@ -0,0 +1,91 @@
|
||||
# Disable screensaver
|
||||
defaults -currentHost write com.apple.screensaver idleTime 0
|
||||
|
||||
# Disable transparency and motion effects
|
||||
defaults write com.apple.universalaccess reduceTransparency -bool true
|
||||
defaults write com.apple.universalaccess reduceMotion -bool true
|
||||
|
||||
# Disable Dock animations
|
||||
defaults write com.apple.dock launchanim -bool false
|
||||
defaults write com.apple.dock autohide-delay -float 0
|
||||
defaults write com.apple.dock autohide-time-modifier -float 0
|
||||
defaults write com.apple.dock expose-animation-duration -float 0.1
|
||||
defaults write com.apple.dock no-glass -bool true
|
||||
defaults write com.apple.dock no-bouncing -bool true
|
||||
defaults write com.apple.dock magnification -bool false
|
||||
defaults write com.apple.dock show-recents -bool false
|
||||
defaults write com.apple.dock mineffect -string "scale"
|
||||
defaults write com.apple.dock springboard-show-duration -float 0
|
||||
defaults write com.apple.dock springboard-hide-duration -float 0
|
||||
defaults write com.apple.dock springboard-page-duration -float 0
|
||||
defaults write com.apple.dock workspaces-swoosh-animation-off -bool true
|
||||
defaults write com.apple.dock minimize-to-application -bool true
|
||||
defaults write com.apple.dock slow-motion-allowed -bool false
|
||||
defaults write com.apple.dock missioncontrol-animation-duration -float 0.1
|
||||
defaults write com.apple.dock workspaces-edge-delay -float 0
|
||||
defaults write com.apple.dock springboard-blur-radius -int 0
|
||||
|
||||
# Disable general window and system animations
|
||||
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false
|
||||
defaults write NSGlobalDomain NSWindowResizeTime -float 0.001
|
||||
defaults write -g NSMenuAnimationDuration -float 0
|
||||
defaults write -g NSPopUpMenuAnimationDuration -float 0
|
||||
defaults write -g NSComboBoxAnimationDuration -float 0
|
||||
defaults write -g NSToolbarAnimationDuration -float 0
|
||||
defaults write -g NSToolbarFullScreenAnimationDuration -float 0
|
||||
defaults write -g NSSheetAnimationEnabled -bool false
|
||||
defaults write -g NSWindowAnimationsEnabled -bool false
|
||||
defaults write -g NSViewAnimationsEnabled -bool false
|
||||
defaults write -g NSScrollAnimationEnabled -bool false
|
||||
defaults write -g NSUseAnimatedFocusRing -bool false
|
||||
defaults write -g NSScrollViewRubberbanding -bool false
|
||||
defaults write -g NSOverlayScrollerHideDelay -float 0
|
||||
defaults write -g QLPanelAnimationDuration -float 0
|
||||
defaults write -g NSWindowSupportsAutomaticFullScreen -bool false
|
||||
defaults write -g NSFullScreenAnimationDuration -float 0
|
||||
defaults write NSGlobalDomain com.apple.springing.enabled -bool false
|
||||
|
||||
# Disable Finder animations
|
||||
defaults write com.apple.finder DisableAllAnimations -bool true
|
||||
defaults write com.apple.finder AnimateInfoPanes -bool false
|
||||
defaults write com.apple.finder AnimateSnapToGrid -bool false
|
||||
|
||||
# GPU / Rendering — Switch to software renderer
|
||||
sudo defaults write /Library/Preferences/com.apple.windowserver UseMetal -bool false
|
||||
sudo defaults write /Library/Preferences/com.apple.windowserver UseOpenGL -bool false
|
||||
sudo defaults write /Library/Preferences/com.apple.windowserver HardwareAccelerated -bool false
|
||||
sudo defaults write /Library/Preferences/com.apple.windowserver EnableShadows -bool false
|
||||
sudo defaults write /Library/Preferences/com.apple.CoreDisplay useMetal -bool false
|
||||
sudo defaults write /Library/Preferences/com.apple.CoreDisplay useIOP -bool false
|
||||
defaults write com.apple.CoreAnimation useSoftwareRenderer -bool true
|
||||
defaults write com.apple.opengl ForceSoftwareRenderer -bool true
|
||||
defaults write com.apple.CoreImage CISoftwareRenderer -bool true
|
||||
defaults write com.apple.screencapture disable-shadow -bool true
|
||||
defaults write com.apple.GPU gpuSwitchingPolicy -int 0
|
||||
|
||||
# Disable Spotlight indexing
|
||||
sudo mdutil -a -i off
|
||||
|
||||
# Disable crash reporter, auto update, Time Machine
|
||||
defaults write com.apple.CrashReporter DialogType -string "none"
|
||||
defaults write com.apple.SoftwareUpdate AutomaticCheckEnabled -bool false
|
||||
defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true
|
||||
|
||||
# Disable Siri
|
||||
defaults write com.apple.assistant.support "Assistant Enabled" -bool false
|
||||
|
||||
# Other optimizations
|
||||
defaults write com.apple.spotlight AnimationDuration -float 0
|
||||
defaults write -g CGFontRenderingFontSmoothingDisabled -bool true
|
||||
defaults write com.apple.frameworks.diskimages skip-verify -bool true
|
||||
defaults write com.apple.frameworks.diskimages skip-verify-locked -bool true
|
||||
defaults write com.apple.frameworks.diskimages skip-verify-remote -bool true
|
||||
defaults write com.apple.mail DisableReplyAnimations -bool true
|
||||
defaults write com.apple.mail DisableSendAnimations -bool true
|
||||
defaults write -g NSDocumentSaveNewDocumentsToCloud -bool false
|
||||
defaults write com.apple.finder WarnOnEmptyTrash -bool false
|
||||
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
|
||||
defaults write -g userMenuExtraStyle -int 1
|
||||
|
||||
# Apply changes
|
||||
killall Dock && killall Finder && killall SystemUIServer
|
||||
@@ -144,7 +144,14 @@ If you see an Apple logo and the bar doesn’t move on your external display, yo
|
||||
In some environments it is necessary to segment the IOMMU Groups to be able to pass the GPU to the VM.
|
||||
|
||||
1. Add the content `pcie_acs_override=downstream,multifunction pci=nommconf` in the file `/etc/default/grub` at the end of the line `GRUB_CMDLINE_LINUX_DEFAULT`;
|
||||
2. After changing the grub file, run the command `update-grub` and reboot your PVE.
|
||||
2. Some environments, add de content `pcie_port_pm=off` in the file `/etc/default/grub` at the end of the line `GRUB_CMDLINE_LINUX_DEFAULT`;
|
||||
3. After changing the grub file, run the command `update-grub` and reboot your PVE.
|
||||
|
||||
Some environments, you need create a `/etc/modprobe.d/vfio-pci.conf` with content:
|
||||
`options vfio-pci ids=XXXX:XXXX,XXXX:XXXX disable_vga=on`
|
||||
|
||||
More Information of Passthrough
|
||||
[Proxmox Docs](https://pve.proxmox.com/wiki/PCI(e)_Passthrough#_host_device_passthrough)
|
||||
|
||||
---
|
||||
|
||||
|
||||
+1
-1
@@ -74,7 +74,7 @@ REPO_DIR="/root/OSX-PROXMOX"
|
||||
# storage on its own, so checking it out here would just duplicate ~96 MB.
|
||||
clone_latest_only() {
|
||||
git clone --depth 1 --filter=blob:none --sparse "$REPO_URL" "$REPO_DIR" &&
|
||||
git -C "$REPO_DIR" sparse-checkout set tools
|
||||
git -C "$REPO_DIR" sparse-checkout set tools Patches
|
||||
}
|
||||
|
||||
log_message "Downloading OSX-PROXMOX repository (latest version only)..."
|
||||
|
||||
@@ -930,6 +930,128 @@ remove_subscription_notice() {
|
||||
read -n 1 -sp "Press any key to return to menu..."
|
||||
}
|
||||
|
||||
# Function to append parameters to the end of the kernel command line, covering
|
||||
# both bootloaders used by Proxmox VE: GRUB (/etc/default/grub) and systemd-boot
|
||||
# (/etc/kernel/cmdline, used when the root filesystem is ZFS)
|
||||
apply_kernel_cmdline_params() {
|
||||
local logname="$1"; shift
|
||||
local params=("$@")
|
||||
local logfile="${LOGDIR}/${logname}.log"
|
||||
local stamp=$(date '+%Y%m%d%H%M%S')
|
||||
local handled=0 changed=0 failed=0 boot_mode="Legacy BIOS"
|
||||
local p current append ok
|
||||
[[ -d /sys/firmware/efi ]] && boot_mode="UEFI"
|
||||
display_and_log "Applying '${params[*]}' to the kernel command line (firmware: ${boot_mode})" "$logfile"
|
||||
|
||||
# GRUB - the parameters are appended to the end of GRUB_CMDLINE_LINUX_DEFAULT
|
||||
if [[ -f /etc/default/grub ]] && command -v update-grub >/dev/null 2>&1; then
|
||||
handled=1
|
||||
if ! grep -Eq '^[[:space:]]*GRUB_CMDLINE_LINUX_DEFAULT=' /etc/default/grub; then
|
||||
display_and_log "GRUB: GRUB_CMDLINE_LINUX_DEFAULT not found in /etc/default/grub, skipping" "$logfile"
|
||||
else
|
||||
current=$(grep -E '^[[:space:]]*GRUB_CMDLINE_LINUX_DEFAULT=' /etc/default/grub | head -n 1)
|
||||
append=""
|
||||
for p in "${params[@]}"; do
|
||||
if grep -Eq "(^|[[:space:]])${p}([[:space:]\"]|\$)" <<< "$current"; then
|
||||
display_and_log "GRUB: ${p} is already set in /etc/default/grub, skipping it" "$logfile"
|
||||
else
|
||||
append="${append} ${p}"
|
||||
fi
|
||||
done
|
||||
if [[ -z "$append" ]]; then
|
||||
display_and_log "GRUB: nothing to add to GRUB_CMDLINE_LINUX_DEFAULT" "$logfile"
|
||||
else
|
||||
cp /etc/default/grub "/etc/default/grub.bak-${stamp}" || log_and_exit "GRUB: failed to back up /etc/default/grub" "$logfile"
|
||||
sed -i -E \
|
||||
-e "s/^([[:space:]]*GRUB_CMDLINE_LINUX_DEFAULT=\")(.*)(\"[[:space:]]*)\$/\1\2${append}\3/" \
|
||||
-e "s/^([[:space:]]*GRUB_CMDLINE_LINUX_DEFAULT=\")[[:space:]]+/\1/" \
|
||||
/etc/default/grub
|
||||
ok=1
|
||||
for p in "${params[@]}"; do
|
||||
grep -Eq "^[[:space:]]*GRUB_CMDLINE_LINUX_DEFAULT=.*${p}" /etc/default/grub || ok=0
|
||||
done
|
||||
if ((ok == 1)); then
|
||||
display_and_log "GRUB: $(grep -E '^[[:space:]]*GRUB_CMDLINE_LINUX_DEFAULT=' /etc/default/grub | head -n 1)" "$logfile"
|
||||
if update-grub >>"$logfile" 2>&1; then
|
||||
changed=1
|
||||
display_and_log "GRUB: /etc/default/grub updated and update-grub completed" "$logfile"
|
||||
else
|
||||
failed=1
|
||||
cp "/etc/default/grub.bak-${stamp}" /etc/default/grub
|
||||
display_and_log "GRUB: update-grub failed, /etc/default/grub restored from backup" "$logfile"
|
||||
fi
|
||||
else
|
||||
failed=1
|
||||
cp "/etc/default/grub.bak-${stamp}" /etc/default/grub
|
||||
display_and_log "GRUB: unable to edit GRUB_CMDLINE_LINUX_DEFAULT (unexpected quoting), file restored from backup" "$logfile"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# systemd-boot - hosts booting with proxmox-boot-tool read the cmdline from /etc/kernel/cmdline
|
||||
if [[ -f /etc/kernel/cmdline ]] && command -v proxmox-boot-tool >/dev/null 2>&1; then
|
||||
handled=1
|
||||
current=$(head -n 1 /etc/kernel/cmdline)
|
||||
append=""
|
||||
for p in "${params[@]}"; do
|
||||
if grep -Eq "(^|[[:space:]])${p}([[:space:]]|\$)" <<< "$current"; then
|
||||
display_and_log "systemd-boot: ${p} is already set in /etc/kernel/cmdline, skipping it" "$logfile"
|
||||
else
|
||||
append="${append} ${p}"
|
||||
fi
|
||||
done
|
||||
if [[ -z "$append" ]]; then
|
||||
display_and_log "systemd-boot: nothing to add to /etc/kernel/cmdline" "$logfile"
|
||||
else
|
||||
cp /etc/kernel/cmdline "/etc/kernel/cmdline.bak-${stamp}" || log_and_exit "systemd-boot: failed to back up /etc/kernel/cmdline" "$logfile"
|
||||
sed -i -E "1s/[[:space:]]*\$/${append}/" /etc/kernel/cmdline
|
||||
ok=1
|
||||
for p in "${params[@]}"; do
|
||||
grep -Eq "${p}" /etc/kernel/cmdline || ok=0
|
||||
done
|
||||
if ((ok == 1)); then
|
||||
display_and_log "systemd-boot: $(head -n 1 /etc/kernel/cmdline)" "$logfile"
|
||||
if proxmox-boot-tool refresh >>"$logfile" 2>&1; then
|
||||
changed=1
|
||||
display_and_log "systemd-boot: /etc/kernel/cmdline updated and proxmox-boot-tool refresh completed" "$logfile"
|
||||
else
|
||||
failed=1
|
||||
cp "/etc/kernel/cmdline.bak-${stamp}" /etc/kernel/cmdline
|
||||
display_and_log "systemd-boot: proxmox-boot-tool refresh failed, /etc/kernel/cmdline restored from backup" "$logfile"
|
||||
fi
|
||||
else
|
||||
failed=1
|
||||
cp "/etc/kernel/cmdline.bak-${stamp}" /etc/kernel/cmdline
|
||||
display_and_log "systemd-boot: unable to edit /etc/kernel/cmdline, file restored from backup" "$logfile"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if ((handled == 0)); then
|
||||
display_and_log "No supported bootloader configuration found (/etc/default/grub or /etc/kernel/cmdline). Nothing was changed." "$logfile"
|
||||
fi
|
||||
if ((changed == 1)); then
|
||||
display_and_log "Parameters applied. A reboot is required for them to take effect." "$logfile"
|
||||
fi
|
||||
if ((failed == 1)); then
|
||||
display_and_log "One or more steps failed, check ${logfile}" "$logfile"
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
# Function to apply the pcie_port_pm=off fix to the kernel command line
|
||||
apply_pcie_port_pm_off() {
|
||||
apply_kernel_cmdline_params "apply-pcie-port-pm-off" "pcie_port_pm=off"
|
||||
read -n 1 -sp "Press any key to return to menu..."
|
||||
}
|
||||
|
||||
# Function to apply the PCIe ACS override fix to the kernel command line
|
||||
apply_pcie_acs_override() {
|
||||
apply_kernel_cmdline_params "apply-pcie-acs-override" "pcie_acs_override=downstream,multifunction" "pci=nommconf"
|
||||
read -n 1 -sp "Press any key to return to menu..."
|
||||
}
|
||||
|
||||
# Function to configure network bridge
|
||||
configure_network_bridge() {
|
||||
local logfile="${LOGDIR}/configure-network-bridge.log"
|
||||
@@ -1479,6 +1601,8 @@ main_menu() {
|
||||
echo " 203 - Remove Proxmox subscription notice"
|
||||
echo " 204 - Add new bridge (macOS in cloud)"
|
||||
echo " 205 - Customize OpenCore config.plist"
|
||||
echo " 206 - Apply pcie_port_pm=off (kernel command line)"
|
||||
echo " 207 - Apply pcie_acs_override + pci=nommconf (kernel command line)"
|
||||
echo
|
||||
echo " 0 - Quit (or ENTER)"
|
||||
echo
|
||||
@@ -1495,6 +1619,8 @@ main_menu() {
|
||||
203) remove_subscription_notice ;;
|
||||
204) configure_network_bridge ;;
|
||||
205) customize_opencore_config ;;
|
||||
206) apply_pcie_port_pm_off ;;
|
||||
207) apply_pcie_acs_override ;;
|
||||
*) echo "Invalid option"; read -n 1 -s ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user