[Filesystems] reduce udev errors by not triggering NVMe rule on partitions

Use new hardware.block.defaultSchedulerRotational for hddScheduler
This commit is contained in:
Antoine Viallon 2025-03-09 20:57:42 +01:00
parent db87939151
commit eeb148bb21
Signed by: aviallon
GPG key ID: 186FC35EDEB25716

View file

@ -68,6 +68,7 @@ in
boot.supportedFilesystems = [ "ntfs" "ext4" "vfat" "exfat" ]; boot.supportedFilesystems = [ "ntfs" "ext4" "vfat" "exfat" ];
hardware.block.defaultSchedulerRotational = mkDefault cfg.hddScheduler;
aviallon.filesystems.udevRules = mkBefore (concatLists [ aviallon.filesystems.udevRules = mkBefore (concatLists [
(optional (!(builtins.isNull cfg.hddScheduler)) (optional (!(builtins.isNull cfg.hddScheduler))
''ACTION!="remove", SUBSYSTEM=="block", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="${cfg.hddScheduler}"'' ''ACTION!="remove", SUBSYSTEM=="block", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="${cfg.hddScheduler}"''
@ -75,8 +76,8 @@ in
(optional (!(builtins.isNull cfg.slowFlashScheduler)) (optional (!(builtins.isNull cfg.slowFlashScheduler))
'' ''
SUBSYSTEM!="block", GOTO="aviallon_slowflash_end" SUBSYSTEM!="block", GOTO="aviallon_slowflash_end"
KERNEL!="sd[a-z]|nvme[0-9]*n[0-9]*|mmcblk[0-9]", GOTO="aviallon_slowflash_end" KERNEL!="sd[a-z]|nvme[0-9]*n[0-9]|mmcblk[0-9]", GOTO="aviallon_slowflash_end"
ATTR{queue/rotational}!="0", GOTO="aviallon_slowflash_end" ATTR{queue/rotational}=="1", GOTO="aviallon_slowflash_end"
ACTION!="remove", ATTR{queue/scheduler}="${cfg.slowFlashScheduler}" ACTION!="remove", ATTR{queue/scheduler}="${cfg.slowFlashScheduler}"