Patch for mdev (fwd)
Denys Vlasenko
vda.linux at googlemail.com
Thu May 8 21:39:50 UTC 2008
On Wednesday 07 May 2008 15:01, Andrej Gelenberg wrote:
> Hi,
>
> in new kernel 2.6.25 block devices are in /sys/class/block too. It makeed me
> trouble whith initram. I have wrote small patch, that fix it. Patch is for
> version with mdev patch already.
- /* http://kernel.org/doc/pending/hotplug.txt says that only
- * "/sys/block/..." is for block devices. "sys/bus" etc is not! */
- type = (strncmp(&path[5], "block/", 6) == 0 ? S_IFBLK : S_IFCHR);
+ // in kernel 2.6.25 block devices are in /sys/class/block and in /sys/block
+ if ( strncmp(&path[5], "block/", 6) && strncmp(&path[5], "class/block/", 12) )
+ // wenn first or second strncmp return 0 (aslo path match block or class/block)
+ // value of expresion will be false (0)
+ {
+ type = S_IFCHR;
+ }
+ else
+ {
+ type = S_IFBLK;
+ }
You deleted the comment exactly why? You hate documentation? ;)
--
vda
More information about the busybox
mailing list