Move apple fixes into their own subdirectory too

This commit is contained in:
David Heinemeier Hansson
2026-03-24 20:40:43 +01:00
parent c4c55b5c33
commit e8623fbbf6
5 changed files with 4 additions and 4 deletions
@@ -0,0 +1,12 @@
# Detect MacBook models that need SPI keyboard modules
product_name="$(cat /sys/class/dmi/id/product_name 2>/dev/null)"
if [[ $product_name =~ MacBook[89],1|MacBook1[02],1|MacBookPro13,[123]|MacBookPro14,[123] ]]; then
echo "Detected MacBook with SPI keyboard"
omarchy-pkg-add macbook12-spi-driver-dkms
if [[ $product_name == "MacBook8,1" ]]; then
echo "MODULES=(applespi spi_pxa2xx_platform spi_pxa2xx_pci)" | sudo tee /etc/mkinitcpio.conf.d/macbook_spi_modules.conf >/dev/null
else
echo "MODULES=(applespi intel_lpss_pci spi_pxa2xx_platform)" | sudo tee /etc/mkinitcpio.conf.d/macbook_spi_modules.conf >/dev/null
fi
fi
@@ -0,0 +1,30 @@
# Fix NVMe suspend issues on MacBook models
# This prevents NVMe drives from failing to wake from sleep properly
MACBOOK_MODEL=$(cat /sys/class/dmi/id/product_name 2>/dev/null || true)
if [[ $MACBOOK_MODEL =~ MacBook(8,1|9,1|10,1)|MacBookPro13,[123]|MacBookPro14,[123] ]]; then
echo "Detected MacBook model: $MACBOOK_MODEL"
NVME_DEVICE="/sys/bus/pci/devices/0000:01:00.0/d3cold_allowed"
if [[ -f $NVME_DEVICE ]]; then
echo "Applying NVMe suspend fix..."
cat <<EOF | sudo tee /etc/systemd/system/omarchy-nvme-suspend-fix.service >/dev/null
[Unit]
Description=Omarchy NVMe Suspend Fix for MacBook
[Service]
ExecStart=/bin/bash -c 'echo 0 > /sys/bus/pci/devices/0000\:01\:00.0/d3cold_allowed'
[Install]
WantedBy=multi-user.target
EOF
chrootable_systemctl_enable omarchy-nvme-suspend-fix.service
sudo systemctl daemon-reload
else
echo "Warning: NVMe device not found at expected PCI address (0000:01:00.0)"
echo "This fix may not be needed for this MacBook model"
fi
fi
+35
View File
@@ -0,0 +1,35 @@
# Detect T2 MacBook models using PCI IDs
# Vendor: 106b (Apple), Device IDs: 1801 or 1802 (T2 Security Chip)
if lspci -nn | grep -q "106b:180[12]"; then
echo "Detected MacBook with T2 chip. Installing support items..."
omarchy-pkg-add \
linux-t2 \
linux-t2-headers \
apple-t2-audio-config \
apple-bcm-firmware \
t2fanrd \
tiny-dfr
# Add user to video group (required for tiny-dfr to access /dev/dri devices)
sudo usermod -aG video ${USER}
# Enable T2 services
sudo systemctl enable t2fanrd.service
sudo systemctl enable tiny-dfr.service
echo "apple-bce" | sudo tee /etc/modules-load.d/t2.conf >/dev/null
echo "MODULES+=(apple-bce usbhid hid_apple hid_generic xhci_pci xhci_hcd)" | sudo tee /etc/mkinitcpio.conf.d/apple-t2.conf >/dev/null
cat <<EOF | sudo tee /etc/modprobe.d/brcmfmac.conf >/dev/null
# Fix for T2 MacBook WiFi connectivity issues
options brcmfmac feature_disable=0x82000
EOF
sudo mkdir -p /etc/limine-entry-tool.d
cat <<EOF | sudo tee /etc/limine-entry-tool.d/t2-mac.conf >/dev/null
# Generated by Omarchy installer for T2 Mac support
KERNEL_CMDLINE[default]+=" intel_iommu=on iommu=pt pcie_ports=compat"
EOF
fi