Score:0

What is the proper way to edit files in the /sys filesystem and have them stick

br flag

I was able to get my BlueTooth mouse to stop lagging with the command:

echo 300 > /sys/devices/pci0000:00/0000:00:14.0/usb1/1-14/power/autosuspend

However, I believe that this change will be lost upon reboot.

I understand the concept of the /sys directory being an abstraction of the hardware on the computer and by writing to this pretend file I am actually changing some runtime? kernel? parameter.

I am also aware of commands like sysctl that work on this system, and .rules files that I think would be used to persistently set such values, but have not been able to figure out how to actually implement it after hours of searching. I am probably totally off track for all I know.

Any advice would be appreciated. Thanks

David avatar
cn flag
Why ask the question when you have not rebooted to see if this even happens?
Score:0
tj flag

echo 300 > /sys/devices/pci0000:00/0000:00:14.0/usb1/1-14/power/autosuspend

However I believe that this change will be lost upon reboot.

I would create a .rules file for udev to automatically set the value when the device is added. E.g., file /etc/udev/rules.d/90-bluetooth-mouse-autosuspend.rules containing:

ACTION=="add", \
DEVPATH=="/devices/pci0000:00/0000:00:14.0/usb1/1-14", \
ATTR{power/autosuspend}="300"

Now reboot and check if the value is set to "300":

$ cat /sys/devices/pci0000:00/0000:00:14.0/usb1/1-14/power/autosuspend
300

Note that this rule will be applied to that specific USB port even if you plug in a different device other than the mouse. It is probably a better idea to check output of udevadm info -a -p /devices/pci0000:00/0000:00:14.0/usb1/1-14 for ATTR{product}=="xxx" and/or ATTR{serial}=="xxx" that you can include in the /etc/udev/rules.d/90-bluetooth-mouse-autosuspend.rules file. This will ensure the rule matches only your bluetooth mouse.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.