Questions tagged [sysfs]

Sysfs is a Linux filesystem, normally mounted on /sys, which provides information about hardware and kernel components.

The Linux sysfs filesystem, normally mounted on /sys, is a communication interface between applications and the kernel. It provides information about kernel components, and through the kernel about hardware. Some entries in /sys are writable, allowing configuration and software-initiated events such as shutting down some components. It was created as a companion to , which focuses on process-related information.

External links

153 questions
4
votes
1 answer

sysfs block size count

Is the file located under: /sys/block//size Constantly referencing to 512 byte block count, or is there any special cases where the block count changes? I'm curious because: thinkpad :: /sys/block/sdf % cat queue/physical_block_size …
3
votes
1 answer

Why does folder hierarchy in /sys/bus/platform/devices change on reboot?

I'm using conky to show a status of my CPU temperatures, and overall I'm satisfied, except for one thing: Every time I reboot, the temperature status breaks! Looking at conky's stderr I see this: conky: can't open…
feuGene
  • 131
2
votes
1 answer

How to give Sysfs attribute write permissions?

I want to write a driver to pass some info to a device, and to do so I've made a sysfs entry. It works fine, but the problem is that I don't have the permissions to write to it unless I am logged in as admin. I'd like it to have open read and write…
J Amos
  • 23
2
votes
1 answer

Reading from sysfs returns EINVAL

box101:~ # cat /sys/class/net/eno1/carrier cat: /sys/class/net/eno1/carrier: Invalid argument What the...? OK, so what does strace say? ... open("/sys/class/net/eno1/carrier", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=4096, ...}) =…
0
votes
1 answer

Easy and elegant way to toggle values in /sys/

What I really want is a NOT and write. I have files that are either 1 or 0, like /sys/class/leds/platform::mute/brightness /sys/class/leds/platform::micmute/brightness What I want is a way to turn the 1's to 0's and flush that result to the file.…
Evan Carroll
  • 30,763
  • 48
  • 183
  • 315