Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [sysfs]

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

1
vote
0answers
22 views

Reading system information (/sys/class/dmi/id) without sudo

I am trying to get a unique system identifier. During research I stumbled on the system serial number which is exactly what I need (also present on the computer case). The serial number is written in ...
0
votes
0answers
15 views

access to sysfs data inside kernel module

I need battery properties for a custom kernel module. this data is mounted in sys/class/power_supply .I know all the discussions about why one should not read/write files from kernel and a solution ...
0
votes
0answers
12 views

Mismatch in USB devices listed by lsusb and sys filesystem

I work on a Ubuntu 18.04 LTS PC. I have a need to find out the USB device name that matches a particular USB device ID. When I run the lsusb command to list USB device interfaces, here is the output I ...
0
votes
0answers
47 views

Sysfs, HID device under virtual subsystem

I have a USB headset device which when attached gets detected under /sys/devices/virtual subtree. Basically, I want to use the hidrawX node but due to the wrong subsystem type I am unable to configure ...
1
vote
0answers
25 views

Some USB devices will automatically reconnect after I unbind it, how to disable it long time?

I'm trying to disable my two USB keyboard on my linux system, the first one can unbind long time until I unplug then plugin and the number lock light is off during this time. But the other one can not ...
0
votes
0answers
15 views

Can /sys be sanitized for use with linux namespaces (i.e. via systemd-nspawn)?

The tool systemd-nspawn is descriped as allowing this: systemd-nspawn - Spawn a command or OS in a light-weight container systemd-nspawn may be used to run a command or OS in a light-weight ...
2
votes
0answers
70 views

is there any tool to show hierarchy of devices in Linux?

I want to see a tree-like structure of all devices in Linux. In Windows, I can use Device Manager with "show by connection". BSD systems report such data to dmesg in format "child at parent" and have ...
0
votes
0answers
27 views

unload a module from another module

currently I seek for a way to unload a certain module from another kernel module. One way i think about is usage of call_usermodehelper. So basically an userspace program is prepared doing i.e. echo ...
2
votes
0answers
58 views

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: ...
0
votes
1answer
185 views

Driver development vs sysfs access vs mmap for GPIOs

I believe I could not fully understand the benefits of writing device drivers in embedded systems for some specific devices, such as GPIO, when there are alternative ways of doing the same job. You ...
1
vote
2answers
130 views

Can user space programs provide/implement sysfs or procfs files to pass data to and from a program?

Kernel space device drivers usually implement directories and file that show through /sys or /proc. Can the long running user space programs do this as well? I have a daemon or long running program ...
0
votes
1answer
39 views

After I unbind the Trackpoint driver (psmouse), the driver re-bound when I press it. What causes this?

For background information, see Manual driver binding and unbinding. I can unbind the Trackpoint driver on my Thinkpad: $ cd /sys/bus/serio/drivers/psmouse/ $ ls -l total 0 --w-------. 1 root root ...
3
votes
1answer
454 views

Why can't tree fully list /sys/class/hwmon? And how could I do that?

If I understand correctly, in Linux, everything is a path, right down to each piece of hardware. I am trying to get information about how my sensors are structured, so I thought I would just use tree ...
10
votes
1answer
991 views

Debian: cannot remove symlink in /sys/: operation not permitted

I ran some commands without completely understanding them while trying to get screen brightness working and now I'm stuck with a nasty symlink in '/sys/class/backlight/asus_laptop' that I am trying to ...
0
votes
0answers
82 views

Why both “/sys/devices/cpu” and “/sys/devices/system/cpu”?

Under /sys/devices, whys is there both /sys/devices/cpu and /sys/devices/system/cpu rather than just one or the other?
3
votes
0answers
69 views

Linux permanently hung after running a grep command on “/sys/*” directory

I ran the command: sudo grep -r -i RETP /sys/* On two systems: Oracle Linux 7.5 server (256 GB RAM, 2 Intel® Xeon® Gold 6142 Processor) and on my desktop PC with Ubuntu 18.04 (16 GB RAM, Core i5-...
1
vote
0answers
29 views

Can I somehow identify the physical machine from inside an OpenVZ container?

I am using some VPSes in OpenVZ containers. As I can see, our hosting provider somes moves them between his physical machines. It also means unwaited (and unexpected) reboots. I have no technical ...
1
vote
0answers
240 views

Do Linux cpufreq governers temporarily change sysfs's scaling_max_freq?

The linux documentation of the variable sysfs scaling_max_freq reports Maximum frequency the CPUs belonging to this policy are allowed to be running at (in kHz). This attribute is read-...
0
votes
0answers
144 views

find all block devices (hdds and ssds) using sysfs

Cant figure how to enumerate all physical disks, like hdds, ssds, NVMes and maybe flashdrives connected to machine and filter out all these loop devices, ram disks, cdrom and floppies. I've checked ...
1
vote
1answer
361 views

How to find sysfs directory for a specific device?

I have an input class device (accelerometer) bound to a driver which exposes sysfs attributes that I need to access from userland. Using a udev rule, I have provided an alias that unambiguously ...
5
votes
1answer
464 views

What is firmware timeout?

I found a file /sys/class/firmware/timeout, and this file contains just one word 60. Is this timeout related to bootloader like GRUB timeout? What is the practical use of it?
1
vote
1answer
1k views

/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed: Invalid argument [duplicate]

I was stuck when trying to write to a system file to change the cpu frequency: $ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed <unsupported> $ echo 1600000 | sudo tee /sys/...
1
vote
0answers
66 views

What is ctrl in sysfs network interface?

cat /sys/devices/platform/macb/net/eth0/ctrl and the output is 43, and this number changes everytime I want to read. I know sysfs is the virtual file system from the kernel that is exported to user-...
2
votes
1answer
42 views

File doesn't seem to be regular but is listed as such

From what I understand, on Linux/UNIX files from which you get system info aren't regular files but rather device files and yet I have encountered a file that doesn't seem to be regular (due to its ...
1
vote
0answers
353 views

Changing permissions of /sys/ directory at boot (permanently)

I'm building a system, using buildroot, that will have a webpage to control a raspberry's GPIO pins, using php. To do so, I'm writing (and reading) the kernel files located in /sys/class/gpio/.. the ...
2
votes
1answer
1k views

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 ...
0
votes
1answer
80 views

Tail-ing /sys/devices/platform/applesmc.768/light not working

Once upon a time, I cast this shellspell, # tail -f /sys/devices/platform/applesmc.768/light and it does produce, (0,0) Those file I read is light sensor abstraction file of Macbook Pro. ...
3
votes
1answer
2k views

How do you read and write from a specific address of an EEPROM from sysFS

I have a 24CS02 EEPROM on my I2C bus. I can successfully read it and have successfully written to the beginning of the EEPROM (ie from /sys/bus/i2c/devices/1-0050/eeprom). I am wondering if/how to ...
2
votes
0answers
359 views

Change device name in /sys/class

I would like to know if there is a way to rename device under sysfs? For example, I have a class regulator with severals devices under it # ls /sys/class/regulator/ regulator.0 regulator.11 ...
0
votes
1answer
1k views

Unable to export specific gpio pins. How to check what uses GPIO pins and how to access register?

I use an i.mx6 board (yocto(jethro)) and am configuring a device tree. I changed a dts file and put the dtb file in a boot partition. I set GPIO4_IO19 in dts file as follows. &iomuxc { pinctrl-...
1
vote
1answer
455 views

Current Resources for Linux Kernel Driver development [closed]

I'm learning about Linux kernel driver development for work, but I'm struggling to find a good resource that is relevant to recent kernels. I have read Linux Device Drivers 3rd edition, but that is ...
3
votes
1answer
139 views

Sysfs LCD backlight as thermal device

I have Compaq CQ60-120ec notebook. I discovered that there is a directory /sys/class/thermal/cooling_device2. The type said LCD. I tried to control the cooling device, and it dimmed my backlight on ...
1
vote
1answer
313 views

Find a kernel module behind virtual network interface by info from sysfs/procfs

I'd like to find kernel module which is behind virtual network interface (e.g interfaces using veth, dummy kernel modules, NOT physical NIC). It's easy with ethtool: $ ethtool -i ltp_ns_veth2 |grep ...
1
vote
1answer
527 views

modify sysfs thermal trip points

I'd like to modify thermal trip points on linux sysfs because it is set to a low value. I'v read here that you cannot modify critical trip point to avoid serious damages but here I am going to modify ...
0
votes
1answer
244 views

Symlink to /sys/bus/spi/devices

I'm trying to port a certain software from one linux device to another. My software has a lot of lines pointing to /sys/bus/spi/devices/spi3.0. In the Linux device I'm porting to, that folder does not ...
1
vote
0answers
277 views

Udev notification if and only if I plug external monitor

I want to send a notification to my application if and only if the user plugs an external monitor (i.e. the connector becames connected). My output of command udevadm info -a -p /sys/class/drm/card1-...
1
vote
0answers
65 views

Following a Virtual File?

I'm writing a kernel module to collect some data and printing it out to a file in /sys. I know these files are virtual files, and my understanding is that they are essentially generated every time you ...
4
votes
1answer
1k views

unmount sys/fs/cgroup/systemd after chroot, without rebooting

Background: I am exploring how to copy an ordinary LVM-on-LUKS Debian 9 ("Stretch") installation from a thumb drive (the "source drive") onto a ZFS-formatted drive (the "target drive") in order to ...
3
votes
0answers
221 views

GPIO in unprivileged LXC container

I currently try to get GPIO-access into an unprivileged LXC application container. In future this container shall execute an application. But for now (while development) I just start a normal bash in ...
4
votes
1answer
200 views

Mounting only a specific part of sysfs

I wonder if it is possible to mount only part of sysfs for usage in chroot. Example I would require only /sys/class/gpio and rest is not required. mount -t sysfs sys/some/folder /mnt/temp_sys
1
vote
2answers
62 views

reboot reverts back to original

I'm trying to do is simply change the below settings permanently but I am rebooting however this settings is back to the previous setting! /sys/block/*/queue/rq_affinity 2 /sys/block/*/queue/...
1
vote
1answer
885 views

Permission denied on sysfs files

I'm messing around with my raspberry pi, and currently I'm trying to change the color of one of the LEDs on the board executing a shell script and its arguments: pi@raspberrypi:~/morpheus/scripts $ ...
1
vote
1answer
143 views

How come I can only pipe positive integers into this file?

If I pipe a string consisting only of a positive integer into /sys/class/backlight/intel_backlight/brightness, it works. But if I pipe a string containing anything else I've tried, I get an error ...
4
votes
2answers
2k views

How to map /sys/bus/usb/devices to /dev/video*?

I am using a library (librealsense) that only outputs the bus and port number as such (9.1). It uses libusb internally. The issue is from this identifier in libusb I want to know what physical device ...
2
votes
1answer
975 views

Recover from rm -rf /proc /sys/ /dev/pts /dev without reboot?

Not a severe issue because it can be fixed with a reboot, but I'm curious to know whether there's a way to restore files (probably not all, but as many as possible) in /proc, /sys, /dev/pts and /dev. ...
2
votes
1answer
284 views

When exactly(and earliest) have all the block devices been enumerated during Linux Boot?

Problem: During The Linux Boot, I want to know a certain instance of time, when all the block devices have been enumerated. I assume the block devices are NOT coming via a network( like iscsi), but ...
1
vote
0answers
308 views

How do I find module implementing net interface, when there is no 'device' at /sys/class/net/eth0?

How do I find module implementing a net interface, when there is no device at /sys/class/net/eth0? ls /sys/class/net/eth0/ addr_assign_type carrier iflink speed addr_len ...
0
votes
1answer
270 views

What is the unit of this value

I was trying to get frequecy from my device at run time. I used this device node sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq It gave me 60000. I tried this one cat /sys/devices/...
8
votes
1answer
2k views

What is securityfs?

While I am studying, I saw security file system which is mounted on /sys/kernel/security . It seems like to operate similar to sysfs or proc file system. Security file system keeps data on memory not ...
1
vote
2answers
483 views

udev for /sys file not working

I'm trying to set group attribute for root@luna:~# ls -l /sys/class/backlight/intel_backlight/brightness -rw-r--r-- 1 root root 4096 Sep 24 08:28 /sys/class/backlight/intel_backlight/brightness I'...