O'Reilly logo

Building Embedded Linux Systems, 2nd Edition by Gilad Ben-Yossef, Jon Masters, Karim Yaghmour, Philippe Gerum

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6. Root Filesystem Content

Michael Opdenacker

One of the last operations conducted by the Linux kernel during system startup is mounting the root filesystem. The Linux kernel itself doesn’t dictate any filesystem structure, but user space applications do expect to find files with specific names in specific directory structures. Therefore, it is useful to follow the de facto standards that have emerged in Linux systems.

In this chapter, we will start by discussing the basic root filesystem structure. Then, we will explain how and where to install the system libraries, the kernel modules, kernel images, device nodes, main system applications, and custom applications. Finally, we will discuss how to configure the system initialization scripts.

At the end of this chapter, you will have a fully functional root filesystem for your target. In the following chapters, we will talk about how you can place this root filesystem on an actual filesystem type on a storage device for use in your target.

Basic Root Filesystem Structure

The “official” rules to build a root filesystem are contained in the Filesystem Hierarchy Standard (FHS) introduced in Chapter 1. The document is less than 30 pages long and is fairly easy to read. If you are looking for answers or clarifications regarding how to build a root filesystem, the FHS, along with related standards documentation from the Linux Foundation, are probably the best places to start.

Each of the top-level directories in the root filesystem has ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required