14 lines
732 B
Text
14 lines
732 B
Text
# Try to catch USB flash drives and set them as non-rotational. Probably no impact whatsoever : /
|
|
# c.f. https://mpdesouza.com/blog/kernel-adventures-are-usb-sticks-rotational-devices/
|
|
|
|
# Device is already marked as non-rotational, skip over it
|
|
ATTR{queue/rotational}=="0", GOTO="skip"
|
|
|
|
# Device has some sort of queue support, likely to be an HDD actually
|
|
ATTRS{queue_type}!="none", GOTO="skip"
|
|
|
|
# Flip the rotational bit on this removable device and give audible signs of having caught a match
|
|
ATTR{removable}=="1", SUBSYSTEM=="block", SUBSYSTEMS=="usb", ACTION=="add|change", ATTR{queue/rotational}="0"
|
|
#ATTR{removable}=="1", SUBSYSTEM=="block", SUBSYSTEMS=="usb", ACTION=="add|change", RUN+="/bin/beep -f 70 -r 2"
|
|
|
|
LABEL="skip"
|