Questions tagged [sysfs]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
39 views

What does this linux kernel panic message: sysfs: cannot create duplicate filename mean?

[1.503917] NET: Registered protocol family 17 [ 1.504612] libphy: mdiobus_find: mii bus [igb_enet_mii_bus] found 1.504711] sysfs: cannot create duplicate filename '/kernel/marvell/...
0
votes
1answer
19 views

What does the /sys/class/block/*/hidden file mean?

Block devices(but not partitions) exposed to userspace through sysfs have a file called hidden, but it doesn't appear documented anywhere? What does it mean?
0
votes
0answers
38 views

How to get connected block devices on Linux

What APIs/interfaces are available for this? I think I want sysfs, but according to what various kernel documentation exists, that interface can be summed up as "you're not allowed to use any of this, ...
1
vote
1answer
35 views

What are BSDs' equivalents to /proc and /sys?

The amount of information that can be gathered in linux using the procfs and sysfs which are normally mounted at /proc and /sys is quite substantial. Being not on a FreeBSD install I am amazed to ...
0
votes
1answer
266 views

“echo: write error: invalid argument” writing to sysfs

From the instructions for setting up bcache: echo cset.uuid > /sys/block/bcache0/bcache/attach What happens: root@gentooserver ~ # echo 45511b33-6bb8-42d5-a255-3de1749f8dda > /sys/block/...
0
votes
0answers
21 views

Is it possible to create a symlnk to a file created by sysfs_create_group?

If I were to use sysfs_create_link, I have the first parameter (the destination directory for the symlink), but I am missing the 2nd parameter's kobject. I have created a group with ...
0
votes
0answers
27 views

How can I dynamically remove or retrigger the probing of an EEPROM via sysFS?

I am wondering what the proper way is to remove EEPROMs dynamically. An alternate approach that will also work is telling the device to re-do the probe. I tried just echoing it to delete_device, but ...
0
votes
0answers
20 views

How to raise android kernel poll frequency for power supply values in sysfs?

I'm new to the linux kernel and I'm trying to understand how the process of updating battery state values on sysfs (/sys/class/power_supply/battery) happens. Currently I believe the sampling period ...
0
votes
0answers
46 views

sysfs folder symbolic link behavior

I encountered this behavior that I can't explain. In the sysfs, there is a symbolic link but it looks impossible to me: me@test:/sys/block/sde$ ll ... lrwxrwxrwx 1 root root 0 Oct 1 2019 device -...
10
votes
1answer
1k views

“cd” into /sys/kernel/debug/tracing causes permission change

I've faced a really strange issue today, and am totally helpless about it. Some of the servers I manage are monitored with Nagios. Recently I saw a disk usage probe failing with this error: DISK ...
0
votes
0answers
36 views

Group ownership changes by itself on restart

I changed window managers and now need to be able to change /sys/class/backlight/intel_backlight/brightness (because the new wm cannot change screen brightness natively). I created a user group ...
2
votes
0answers
168 views

How to provide user access to /sys/class/backlight/acpi_video0/brightness programmatically (udev?)

I control backlight through /sys/class/backlight/acpi_video0/brightness with a script (via sudo) that provides a simple script to increment/decrement, set, retrieve and restore last backlight setting ...
1
vote
0answers
406 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
265 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 ...
1
vote
0answers
109 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
152 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 ...
2
votes
0answers
70 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
25 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
153 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 ...
2
votes
0answers
248 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
510 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 ...
2
votes
2answers
513 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
58 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
744 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
1k 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 ...
3
votes
0answers
92 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
34 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
390 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
203 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
566 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
603 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
2k 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
78 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
47 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
501 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
2k 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
112 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
469 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
2k 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
561 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
193 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
433 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
728 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
317 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
341 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
81 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 ...
6
votes
1answer
2k 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
247 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
235 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