mirror of
https://github.com/NixOS/nixos-hardware
synced 2024-11-08 03:59:40 +01:00
19 lines
385 B
Bash
19 lines
385 B
Bash
|
#!/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"
|
||
|
|