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

learn more… | top users | synonyms

0
votes
0answers
4 views

How to use sysfs_open_bus function [migrated]

I am trying to use "sysfs_open_bus" function defined as extern in "lisysfs.h" as extern struct sysfs_bus *sysfs_open_bus(const char *name); so I think it makes sense that "nm -D -l libsysfs.so" ...
1
vote
1answer
37 views

Allow non-root user go get network traffic statistics

I know that I can use cat /sys/class/net/eth0/statistics/rx_bytes to see the amount of received bytes. Sadly I only can run this command as root. When I am another user, I get cat: ...
2
votes
0answers
73 views

Is it possible to get network interface index not via /sys?

So what I'm looking for is an interface index (or name) but the real one. if_nametoindex(3) and ioctl(2) don't seem to help me here. Now the only way I found how to do this is via /sys. Let me ...
2
votes
1answer
79 views

Getting information from sysfs

I'm creating a script for polling information about network interfaces. For this I get some data from /sysfs. Everything went fine until I wanted to clarify all possible states of an interface (Which ...
6
votes
1answer
46 views

How do I know what decompression algorithms are compiled-in into the linux kernel?

If /proc/config.gz is unavailable, how do I know what decompression algorithms the running kernel is capable of using on a compressed cpio initramfs? Is the gzip algorithm always available, even when ...
3
votes
1answer
55 views

How do I find out what filesystem drivers are compiled-in into the linux kernel?

On a running linux system, what is a portable (among linux distributions) way to find out what filesystems the current kernel has compiled-in (not through modules) support for? Consider for example ...
0
votes
0answers
45 views

Best Practices for Configuring/Reading Sensor Devices

I have a gadget with a number of environmental sensors attached via an I2C bus, and would like to be able configure and read these sensors via an unprivileged application. Unfortunately, there ...
1
vote
1answer
91 views

Accessing GPIO after kernel boots

my rootfs.cpio has only following files: [root@localhost extract]# ls dev init tmp dev has console only. init is cross-compiled from the program given at the end: Then I make a my image and ...
1
vote
1answer
156 views

USB modalias. Meaning of numeric values

For the USB modaliases, I know that the values corresponding to the device's vendor and product ids can be found here: http://www.linux-usb.org/usb.ids Which online resources and/or kernel source ...
6
votes
1answer
1k views

Difference between /dev and /sys/class?

What is the difference between the device representation in /dev between the one in /sys/class? Is one prefered over the other? Is there something one offers and the other doesn't?
0
votes
0answers
56 views

Best way to implement a system configuration driver for Linux

Is there a standard architecture for a driver that allows to read an set system configuration for an embedded Linux system? System configuration means for example hardware calibration values, revision ...
2
votes
4answers
2k views

Unable to write to a GPIO pin despite file permissions on /sys/class/gpio/gpio18/value

This is on a Raspberry Pi. Here's the output of sudo ls -lL /sys/class/gpio/gpio18: -rwxrwx--- 1 root gpio 4096 Mar 8 10:50 active_low -rwxrwx--- 1 root gpio 4096 Mar 8 10:52 ...
0
votes
1answer
744 views

/sys/class filesystem on Linux

On Linux (Ubuntu 11.10 on a ARM processor in my case) I was looking for a way to measure CPU temperature. I found out that a cat /sys/class/thermal/thermal_zone0/temp did the trick. Now I wonder: ...
2
votes
3answers
440 views

How to find out easily whether a block device (or a part of it) is mounted somehow

I want to know what the easiest way is to determine (without root privilege) whether a block device (say sdb) or any part of it is mounted (and which part of it). Checking /proc/mounts for sdb is not ...
3
votes
1answer
619 views

Kernel recognizes USB device but then I can't find it in /sys or /dev

When I connect my Samsung 390G (a cheap cell phone!) to Ubuntu 13.04, dmesg seems to indicate that the storage device thereon is recognizable: [Sun Dec 29 01:26:10 2013] scsi16 : usb-storage ...
2
votes
2answers
547 views

Kernel module parameters vs /sys/class/… explanation

I was making (my first) kernel module to play with the gpio pins of my pandaboard and interrupts. Already "built-in", I noticed you can do (briefly) cd /sys/class/gpio echo 138 > export # a file ...
6
votes
2answers
299 views

Which of proc, sys etc. should be bind-mounted (or not) when chrooting into a “replacement” distribution?

This answer to another question basically boils down to chrooting into another Linux distribution in order to mainly use that as a replacement to its too restricted (but irreplaceable) parent. The ...
3
votes
1answer
115 views

Finding a char device in /sys using a Bash script?

I have one of these and I am trying to write a Bash script for finding the device path in /sys. My approach goes something like this: start in /sys/modules/usbled since this is the name of the ...
3
votes
1answer
131 views

Using Bash to write to a device in /sys?

I have one of these: Basically, it's a USB device with three LEDs (red, green, and blue). The Linux kernel has supported this device through the usbled module for quite some time now. However, I ...
4
votes
2answers
145 views

Can you identify transport via sysfs?

I'm writing a script, and I'm interested in being able to identify the transport class (fc - "fibre channel", scsi, iscsi, etc.) for a given block device. I can retrieve this information via ls -l ...
2
votes
1answer
196 views

CONFIG_GPIO_SYSFS makes /sys/class/leds disappear

I have an embedded Linux board I'm working on, with a button and a couple LEDs. By default, I can control the LEDs via /sys/class/leds/redled/brightness However, I have no way to monitor the ...
8
votes
3answers
3k views

Why does rsync fail to copy files from /sys in Linux?

I have a bash script which uses rsync to backup files in Archlinux. I noticed that rsync failed to copy a file from /sys, while cp worked just fine: # rsync /sys/class/net/enp3s1/address /tmp ...
2
votes
0answers
953 views

How to retrieve sysfs devpath of a USB flash drive given its corresponding partition sysfs path?

I have a USB flash drive connected to a hub. Its storage device partition devpath in sysfs is /devices/pci0000:00/0000:00:12.2/usb6/6-1/6-1.2/6-1.2:1.0/host10/target10:0:0/10:0:0:0/block/sdb/sdb1. I ...
1
vote
2answers
396 views

Is there a generic approach to automatically make some sysfs controls ch{own,mod} user-accessible?

My current primary question motivator: $ ls -l /sys/devices/platform/samsung total 0 -rw-r--r-- 1 root root 4096 27. jaan 14:17 battery_life_extender drwxr-xr-x 3 root root 0 19. jaan 18:40 leds ...
6
votes
3answers
2k views

How does systemd-tmpfiles work?

I'm trying to change the value of /sys/bus/usb/devices/4-3/power/wakeup at every boot (4-3 according to my lsusb, it's the keyboard ID). The default value is: # cat ...
1
vote
0answers
278 views

Settings value in /sys/devices/platform/i8042/serio1/serio2/speed as no effect

I'm following this tutorial to ajust the TrackPoint speed for my Lenovo T420. However, setting a value in /sys/devices/platform/i8042/serio1/serio2/speed has no effect. The trackpoint is unaffected ...
14
votes
4answers
462 views

How do I learn what I can do with /proc and /sys

I'd like to know more about the advanced uses of the /proc and /sys virtual filesystems, but I don't know where to begin. Can anyone suggest any good sources to learn from? Also, since I think sys has ...