Course contentsShow
← Embedded Systems & Computer Architecture
Lesson 801 of 93611. Introduction to Embedded LinuxFree lesson

Anatomy of an Embedded Linux Root Filesystem

Identify the essential directory hierarchy and standard files required by the Linux kernel to boot into a functional user space.

In this lesson, you will learn how the filesystem hierarchy provides the fundamental structure necessary for the Linux kernel to transition from a raw binary state into a functional, user-accessible operating system.

When the kernel finishes executing its initialization routines, it looks for the root filesystem (often specified via the root= boot argument) to find the first executable program. To reach a shell or start your application suite, the filesystem must adhere to a minimal structural standard.

Essential Directory Hierarchy

While a full-blown desktop Linux distribution contains thousands of files, an embedded root filesystem relies on a core set of directories defined by the Filesystem Hierarchy Standard (FHS):

  • /bin and /sbin: Contain essential binaries (e.g., init, sh, ls, mount) required for booting and system recovery.
  • /etc: Holds static configuration files like fstab, inittab (or service manager configurations), and networking settings.
  • /dev: Populated by udev or mdev to provide node access to hardware drivers.
  • /proc and /sys: Mount points for virtual filesystems that provide an interface to kernel data structures and device information.
  • /lib and /lib64: Houses the shared libraries (like libc) required by the binaries in /bin and /sbin.

The Lifecycle Requirement

The most critical file in this structure is the initial user-space process, typically located at /sbin/init or /bin/init. Once the kernel mounts the root filesystem, it attempts to execute this file. Without a valid binary at this location, the kernel will panic with a "No init found" error.

To create a minimal functional environment, you need at least this structure:

/
├── bin/      # Basic shell and utilities (often busybox)
├── dev/      # Empty, will be populated by the kernel/init
├── etc/      # Minimal configuration files
├── lib/      # Dynamic linker and shared libraries
├── proc/     # Mount point for procfs
├── sbin/     # Init binary
└── sys/      # Mount point for sysfs

In embedded systems, we frequently use BusyBox to consolidate these utilities into a single multi-call binary, which populates the /bin and /sbin directories with symlinks, keeping the total filesystem footprint small while maintaining full POSIX compatibility.

Key Takeaway: A functional root filesystem must provide an /sbin/init binary, essential shared libraries, and the standard mount points for virtual filesystems to bridge the gap between kernel hardware management and user-space application execution.