[busybox] problems with mdev -s

Rich Mahn rich at lat.com
Tue May 6 13:02:20 PDT 2008


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 and are identical to
those when the problem doesn't occur.

Observations:

   1.  The mdev patch of May 2 does not have any effect on the problem.

   2.  The problem occurs ONLY when all of the following are true:
       A.  Busybox 1.10.1
       B.  Linux kernel 2.6.25+
       C.  Busybox has CONFIG_FEATURE_MDEV_CONF turned on.

   3.  In all cases, both with and without the problem, the 'mkdev' program
       works fine creating both character and block devices.

I have tried the following combinations and they work correctly:

   1.  Linux 2.6.24.4
       Busybox 1.10.1 without patches
       CONFIG_FEATURE_MDEV_CONF=y

   2.  Linux 2.6.24.4
       Busybox 1.10.1 with patches
       CONFIG_FEATURE_MDEV_CONF=y

   3.  Linux 2.6.24.4
       Busybox 1.10.1 without patches
       CONFIG_FEATURE_MDEV_CONF not set

   4.  Linux 2.6.24.4
       Busybox 1.10.1 with patches
       CONFIG_FEATURE_MDEV_CONF not set

   5.  Linux 2.6.24.4
       Busybox 1.9.1
       CONFIG_FEATURE_MDEV_CONF=y

   6.  Linux 2.6.25
       Busybox 1.9.1
       CONFIG_FEATURE_MDEV_CONF=y

   7.  Linux 2.6.25.1
       Busybox 1.9.1
       CONFIG_FEATURE_MDEV_CONF=y

   8.  Linux 2.6.25
       Busybox 1.10.1 with patches
       CONFIG_FEATURE_MDEV_CONF not set

   9.  Linux 2.6.25.1
       Busybox 1.10.1 with patches
       CONFIG_FEATURE_MDEV_CONF not set

   10. Linux 2.6.25
       Busybox 1.10.1 without patches
       CONFIG_FEATURE_MDEV_CONF not set

   11. Linux 2.6.25.1
       Busybox 1.10.1 without patches
       CONFIG_FEATURE_MDEV_CONF not set

The following combinations exhibit the problem:

   1.  Linux 2.6.25
       Busybox 1.10.1 with patches
       CONFIG_FEATURE_MDEV_CONF=y

   2.  Linux 2.6.25.1
       Busybox 1.10.1 with patches
       CONFIG_FEATURE_MDEV_CONF=y

   3.  Linux 2.6.25
       Busybox 1.10.1 without patches
       CONFIG_FEATURE_MDEV_CONF=y

   4.  Linux 2.6.25.1
       Busybox 1.10.1 without patches
       CONFIG_FEATURE_MDEV_CONF=y


In all the cases where CONFIG_FEATURE_MDEV_CONF is set, there is a
null /etc/mdev.conf file.


I am somewhat baffled at this.  I suppose that it is possible that
Linux is somehow changing things, but it seems more likely to be a
busybox problem.


Another (possibly irrelevent) piece of information:

    In Linux 2.6.25 and all the devices in the /sys/block directory
are symbolic links that resolve to the appropriate places in the
/sys/device structure.



The obvious workaround is to use a configuration that works correctly.
There are many of them and it is a very consistent problem.


I'm not sure where to go from here.  I'm posting this assuming that that
is the best way to get the ball rolling.

Thanks for listening, and thanks for busybox.

rich


More information about the busybox mailing list