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

Anders Darander anders at chargestorm.se
Tue Jan 21 04:41:24 PST 2014


* Hans Beckérus <hans.beckerus at gmail.com> [140121 13:12]:

> On Tue, Jan 21, 2014 at 12:10 PM, Hans Beckérus <hans.beckerus at gmail.com> wrote:
> > 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.

I'm running a slow build of poky-tiny on an overloaded machine... Maybe
I can get back to those question in a while.

> Another thing, You say CONFIG_DEVTMPFS_MOUNT does *not* automount /dev
> if using the initrd scheme?
> But I think it did when using the compressed ext2 file system? How
> come /dev was mounted and populated automatically in the ext2 case but
> when we changed to cpio.xz things seem to break?

This one can I at least answer.

It's because that's how devmtpfs is implemented in the kernel. 

"This option does not affect initramfs based booting, here the devtmpfs
filesystem always needs to be mounted manually after the roots is
mounted." quote taken from the help text of CONFIG_DEVMTPFS_MOUNT, see
your kernel tree or e.g.
http://cateee.net/lkddb/web-lkddb/DEVTMPFS_MOUNT.html

Cheers,
Anders

-- 
Anders Darander
ChargeStorm AB / eStorm AB



More information about the yocto mailing list