SQUASHME: Fix udev script header
This commit is contained in:
@@ -27,14 +27,18 @@
|
|||||||
services.udev.extraRules = let
|
services.udev.extraRules = let
|
||||||
# To create the device node we need to read the device number from the
|
# To create the device node we need to read the device number from the
|
||||||
# /proc directory, so the module must have been loaded first.
|
# /proc directory, so the module must have been loaded first.
|
||||||
addDevice = pkgs.writeScript "add-amd-uprof-dev.sh"
|
addDevice = pkgs.writeShellScript "add-amd-uprof-dev.sh" ''
|
||||||
"mknod /dev/AMDPowerProfiler -m 666 c $(< /proc/AMDPowerProfiler/device) 0";
|
set -x
|
||||||
removeDevice = pkgs.writeScript "remove-amd-uprof-dev.sh"
|
echo date > /tmp/uprof.log
|
||||||
"rm /dev/AMDPowerProfiler";
|
mknod /dev/AMDPowerProfiler -m 666 c $(< /proc/AMDPowerProfiler/device) 0
|
||||||
|
'';
|
||||||
|
removeDevice = pkgs.writeShellScript "remove-amd-uprof-dev.sh" ''
|
||||||
|
rm /dev/AMDPowerProfiler
|
||||||
|
'';
|
||||||
in
|
in
|
||||||
''
|
''
|
||||||
SUBSYSTEM=="module", DEVPATH=="/module/AMDPowerProfiler", ACTION=="add", RUN+="${addDevice}"
|
KERNEL=="AMDPowerProfiler", SUBSYSTEM=="module", ACTION=="add", RUN+="${addDevice}"
|
||||||
SUBSYSTEM=="module", DEVPATH=="/module/AMDPowerProfiler", ACTION=="remove", RUN+="${removeDevice}"
|
KERNEL=="AMDPowerProfiler", SUBSYSTEM=="module", ACTION=="remove", RUN+="${removeDevice}"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user