[busybox] problems with mdev -s
Bernhard Fischer
rep.dot.nop at gmail.com
Fri May 9 08:36:25 PDT 2008
On Fri, May 09, 2008 at 11:21:34AM -0400, Rich Mahn wrote:
>
>On Tuesday 06 May 2008 22:02, Rich Mahn wrote:
>> > The problem:
>> > With certain configurations, when 'mdev -s' is run, all devices
>> > created are character devices, including those which should be block
>> > devices. This is easily reproducible.
>> >
>> > More details:
>> > The devices created are correct WRT permissions, major and minor
>> > numbers. However, when the problem occurs, all new devices are
>> > character devices. Devices that already exist are not changed--if
>> > they are already block devices they staay that way. Adding printf
>> > statements in mdev.c shows that the correct values are being sent to
>> > the system call 'mknod' appear to be correct
>
>> Wow. if this is true that mknod have correct arguments,
>> then I can't see what I can fix. But I'm doubtful.
>> Can you show me these debug printouts added, and their output?
>
>
>Same problem with Busybox 1.10.2. Same patch fixes it. Caused by
>linux 2.6.25 placing same block devices that are in /sys/block into
>/sys/class/block as well. Here's my version of the patch fix for 1.10.2
>
>rich
>
>
>--- util-linux/mdev.c~
>+++ util-linux/mdev.c
>@@ -72,8 +72,10 @@
> /* Determine device name, type, major and minor */
> device_name = bb_basename(path);
> /* 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);
>+ * "/sys/block/..." is for block devices. "sys/bus" etc is not!
>+ * linux 2.6.25 also places these in "/sys/class/block/..." */
>+ type = (strncmp(&path[5], "block/", 6) == 0 ? S_IFBLK :
>+ (strncmp(&path[5], "class/block/", 12) == 0 ? S_IFBLK : S_IFCHR));
compare the size of this to the size of the fix on trunk.
More information about the busybox
mailing list