[Toybox] /sys/block going away?
Rob Landley
rob at landley.net
Thu Apr 13 23:50:42 PDT 2023
Sorry, traveling and I packed the wrong laptop charger. (Well, adapter.) Got a
charge but not a new charger yet. Planning to catch up this weekend...
On 4/12/23 12:51, enh via Toybox wrote:
> i didn't really
> understand https://www.phoronix.com/news/Linux-6.4-Drop-Old-Sysfs-Layout
I have had so many YEARS of arguments with Greg KH about all that stuff. The
kernel went into the "throwing things overboard to stay airborne" stage of
community collapse a year or so back, not surprising that's accelerating...
> but i do see that toybox has a couple of references to /sys/block...
>
> the one in external/toybox/toys/other/nbd_client.c seems like it could trivially
> change to /sys/class/block, but external/toybox/toys/pending/mdev.c says
> ```
> // Entries in /sys/class/block aren't char devices, so skip 'em. (We'll
> // get block devices out of /sys/block.)
> if(!strcmp(node->name, "block")) return 0;
> ```
I need to redo mdev completely. It's a thing I created for busybox back in 2005
(based on a shell script I did which Frank Sorenson ported to C) that populated
/dev from /sys, and then solar at gentoo helped design a config file format for it
which got extended a couple times, then devtmpfs happened and half of what mdev
did was no longer necessary but the OTHER half was still needed, and then there
was a patch to hardwire uid/gid knowledge into the kernel for various dev nodes
but it only SORT of got applied, and plus there was the whole hotplug firmware
loading plumbing (which was actually the incentive for the license cleanup that
aggroed Bruce Perens for the whole "thou shalt be GPLv3 I command it" thing) and
never DID get properly merged, which resulted in the kernel adding a whole
second mechanism for early firmware loading which was completely unnecessary if
you could run a loader out of initramfs...
Ahem. It's a pile of pending research to get the design right, which hasn't come
up because if you DON'T hotplug anything (and thus don't have to respond to
devices asynchronously showing up) then devtmpfs and an init script are
generally good enough?
But yeah, we can traverse /sys/class/block for the block devices. /sys/block
turned into a symlink something like 15 years ago? (Greg KH and Kay Sievers
broke the sysfs ABI _THREE_TIMES_ while I was maintaining mdev for busybox.
Which was not a very long time!)
Rob
More information about the Toybox
mailing list