2

Quote from https://www.kernel.org/doc/Documentation/sysfs-rules.txt:

[...] It is planned to merge all three classification directories into one place at /sys/subsystem, following the layout of the bus directories. All buses and classes, including the converted block subsystem, will show up there.

The devices belonging to a subsystem will create a symlink in the "devices" directory at /sys/subsystem/<name>/devices.

If /sys/subsystem exists, /sys/bus, /sys/class and /sys/block can be ignored. If it does not exist, you always have to scan all three places, as the kernel is free to move a subsystem from one place to the other, as long as the devices are still reachable by the same subsystem name.

Well, when I try to learn the layout of the /sys filesystem of Linux kernel, I see no /sys/subsystem directory in my Ubuntu OS (I use Ubuntu 14.04).

I did a quick Google search and only found an LKML discussion about the directory unification, but I don't see anything else beside Kay Sievers' note. (A git log on Documentation/sysfs-rules.txt also shows it's by him, too.)

My question is, do I miss anything? Why is the directory not available? Or is the directory merge never actually happened in kernel development and is the document wrong?

0

I think the key part of the document you quoted from is here:

If /sys/subsystem exists, /sys/bus, /sys/class and /sys/block can be ignored. If it does not exist, you always have to scan all three places, as the kernel is free to move a subsystem from one place to the other, as long as the devices are still reachable by the same subsystem name.

Whilst looking for other references of the /sys/subsystem directory, I found the following comment in the file 99-systemd.rules.in

We need a hardware independent way to identify network devices. We use the /sys/subsystem path for this. Current vanilla kernels don't actually support that hierarchy right now, however upcoming kernels will....

So I imagine that it will be included in later kernels.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.