mirror of
https://github.com/NixOS/nixos-hardware
synced 2024-11-23 11:29:42 +01:00
99ed0bc663
Extracted from my system configs. There's still a few issues with this machine: 1. Audio is a lost cause. Will probably need to bribe an Apple or Cirrus engineer for the datasheet. 2. The thunderbolt module will oops upon system resume, and subsequently refuse to work until next reboot. 3. The d3cold state needs to be disabled on the NVME controller for it to wake up. 4. The Bluetooth UART (/dev/ttyS0) is created and then deleted by udev in early boot. I am yet to figure out why. Hack around it by reloading the 8250_dw module, causing it to be re-created.
18 lines
385 B
Bash
Executable file
18 lines
385 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
driver_path=/sys/bus/pci/devices/0000:01:00.0
|
|
|
|
if [[ ! -e "$driver_path" ]]; then
|
|
echo "$driver_path does not exist, exiting..."
|
|
exit 1
|
|
fi
|
|
|
|
driver=$(basename $(readlink "$driver_path/driver"))
|
|
|
|
if [[ "$driver" -ne "nvme" ]]; then
|
|
echo "$driver_path is not an NVME device, got $driver, exiting..."
|
|
exit 1
|
|
fi
|
|
|
|
echo 0 > "$driver_path/d3cold_allowed"
|
|
|