Using udev

If you are using udev, you must perform some additional steps after making the NFS-mounted filesystem your new root filesystem, in order to ensure that the embedded system recognizes the devices available to it. These steps include explicitly remounting /proc in order to track process, device, and system status.

Mounting /dev Using udev

UNIX and Linux devices are typically accessed through files in the /dev directory. These files are referred to as device-special files; they tell the kernel how to contact each device attached to the system. One disadvantage of Linux’s use of the traditional /dev device structure is that /dev must have an entry for every device that might possibly be installed on the system. This arrangement is confusing, wasteful of disk space, and not very flexible in terms of adding new devices to your Linux system.

Linux distributions from TimeSys use the Linux Device Filesystem, known as udev. udev is a special, in-memory filesystem designed to eliminate the need for pre-existing entries in the /dev directory. Unlike its predecessor, devfs, udev runs in userspace, and provides a userspace API to access information about current system devices.

If you use chroot to change the root filesystem and your kernel is configured to use the Linux Device filesystem, the /dev directory is not repopulated automatically. Thus, the directory must be manually populated by explicitly mounting the /dev directory, as in the following example:

# mount -t sysfs /sys /sys

Mounting /proc Using udev

Much as UNIX and Linux access devices through entries in the /dev directory, Linux uses an in-memory filesystem known as /proc to track process, device, and system status. This filesystem is automatically created in memory as part of the Linux initialization process, and it is mounted on the physical directory /proc during system startup.

As with the /dev filesystem, discussed in the previous section, once you use chroot to change the root filesystem, the mounted version of /proc is no longer visible, since it is associated with an inode in your initial RAM disk. You must explicitly remount the /proc filesystem after changing the root filesystem to ensure that new and existing processes are both logging to and interacting with the same /proc filesystem. To remount the /proc filesystem, issue the following command:

# mount -t proc /proc /proc