I started by Googling for
populating /dev embedded and followed a couple links, and ended up at the
busybox website (
HERE). Based on my reading, it looks like busybox's
mdev command is a popular method for creating the /dev nodes during boot of an embedded device. I haven't done this myself; I just did a bit of searching to try to help you out, so I don't know that this is the *best* way, but it's *one* way; my apologies if this is not what you're looking for
from the busybox command help page:
Quote:
mdev
mdev [-s]
-s Scan /sys and populate /dev during system boot
Called with no options (via hotplug) it uses environment variables to determine which device to add/remove.
The mdev config file contains lines that look like:
hd[a-z][0-9]* 0:3 660
That's device name (with regex match), uid:gid, and permissions.
Optionally, that can be followed (on the same line) by a special character and a command line to run after creating/before deleting the corresponding device(s). The environment variable $MDEV indicates the active device node (which is useful if it's a regex match). For example:
hdc root:cdrom 660 *ln -s $MDEV cdrom
The special characters are @ (run after creating), $ (run before deleting), and * (run both after creating and before deleting). The commands run in the /dev directory, and use system() which calls /bin/sh.
Config file parsing stops on the first matching line. If no config entry is matched, devices are created with default 0:0 660. (Make the last line match .* to override this.)
|