[yocto] busybox and mdev, how does it really work?

Hans Beckérus hans.beckerus at gmail.com
Tue Jan 21 03:10:16 PST 2014


On Tue, Jan 21, 2014 at 11:23 AM, Anders Darander <anders at chargestorm.se> wrote:
> * Hans Beckérus <hans.beckerus at gmail.com> [140121 11:05]:
>> Things looked ok for a while, /dev was populated properly after boot
>> and all necessary file systems / mount points were created.
>> We were using an ext2 fs in RAM for mounting /.
>> Now, we made a change to instead use a CPIO image compressed using xz
>> and enabled the support in kernel to handle this.
>> This is when our problems started :( Suddenly our system booted with
>> just a very minimalistic /dev folder, containing basically only a few
>> of the devices probed at boot time.
>
>> So, the questions now are:
>
>> - how was /dev populated before when there was no /etc/init.d/mdev?
>
> I haven't checked poky-tiny, or more specifically the kernel
> configurations for it. But based on the description that I cited above,
> I'd guess that poky-tiny has
>         CONFIG_DEVTMPFS=y
>         CONFIG_DEVTMPFS_MOUNT=y
> enabled.
>
Indeed  (from our .config):

CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y

> That would mean the the kernel itself were managing /dev for you when
> you were using ext2. Unfortunately, CONFIG_DEVTMPFS_MOUNT do only
> automount devmptfs on /dev if you're not in an initramfs (or initrd).
>
Sounds reasonable. But, when moving from ext2.gz to cpio.xz, we still
did not add any init script for mounting /dev, yet it is still created
and populated? But only with a very limited set of devices.
I guess there is a difference when the kernel mounts the cpio.xz image
compared to expanding the ext2.gz in RAM with respect to how /dev is
handled. But I am only guessing here.

> Thus, you should add a simple initscript which mounts devtmpfs on /dev.
> Thereafter, you should be fine.
>
Well, using the one that came from busybox-mdev rendered our /dev
completely useless :(
As I said, if I reduce the script to perform only 'mdev -s', then it
works a lot better. So mounting /dev again seems like a bad idea.

> Regarding your other questions on mdev, it's been a little while since I
> used mdev. Let us know if the ideas above is enough, or if you want to
> dig more into mdev.
>
mdev as a device manager I think we have under control, the confusion
is more in our current system behavior at boot.

> Cheers,
> Anders
>
> --
> Anders Darander
> ChargeStorm AB / eStorm AB



More information about the yocto mailing list