Last edited 10 months ago

OpenSTLinux directory structure

Applicable for STM32MP13x lines  STM32MP15x lines  STM32MP25x lines

This article aims at presenting, as example, the directory structure of the Linux root file system available on STM32 board.

All files and directories are located under the root directory (/), in compliance with the File system Hierarchy Standard.

This root directory corresponds to the Linux root file system (rootfs partition), as defined in Flash partitions. Note also that the user file system (userfs partition), the boot file system (bootfs partition) and the vendor file system (vendorfs partition) can be accessed through the /usr/local mounting point, through the /boot mounting point, and through the /vendor mounting point respectively.

Info white.png Information
In practice, this article uses the release STM32MP15-Ecosystem-former for the STM32MPU Embedded Software distribution as an example to illustrate the Linux directory structure. If you are using a different release, the names of the directories and files might differ.

The directories are shown in green, while the files are in black.

/                            Root directory (rootfs partition)
├── bin                      Essential user binaries (e.g. /bin/cat, /bin/ls, /bin/cp...)
│   └── [...]
├── boot                     Mounting point for the boot file system (bootfs partition): see below
├── dev                      Device files (e.g. /dev/null, /dev/tty0, /dev/video0...)
├── etc                      System-wide configuration files (e.g. /etc/xdg/weston/weston.ini Weston configuration file...)
├── home                     Users' home directories (containing saved files, personal settings...)
├── lib                      Essential system libraries for the binaries in /bin and /sbin (e.g. libncurses.so.*...)
│   ├── modules
│   │   └── 6.6.48          The directory name is the linux version (i.e. 6.6.48)
│   │       ├── kernel       Linux kernel modules
│   │       │   └── [...]
│   │       ├── modules.dep  List of module dependencies (generated by depmod)
│   │       └── [...]
│   └── [...]
├── lost+found
├── media                    Mount points for removable media devices
├── mnt                      Temporarily mounted file systems
├── proc                     Pseudo filesystem providing process and kernel information as files (e.g. /proc/cpuinfo, /proc/version...)
├── root                     Home directory for the root user)
├── run                      Run-time variable data (information about the running system since last boot)
├── sbin                     Essential system binaries (e.g. /sbin/fsck, /sbin/init, /sbin/modprobe...)
├── sys                      Information about devices, drivers, and some kernel features (e.g. /sys/kernel/debug akadebgufs...)
├── tmp                      Temporary files
├── usr                      User utilities and applications
│   ├── bin                  Non-essential user binaries (e.g. /usr/bin/lsusb, /usr/bin/weston...)
│   ├── lib                  Non-essential system libraries for the binaries in /usr/bin and /usr/sbin
│   ├── local                Mounting point for the user file system (userfs partition): see below
│   ├── sbin                 Non-essential system binaries (e.g. /usr/sbin/alsactl, /usr/sbin/weston.sh...)
│   ├── share                Architecture-independent (shared) data
│   └── [...]
├── var                      Variable files
└── vendor                   Mounting point for the vendor file system (vendorfs partition): see below
  • Boot file system mounting point
/boot  bootfs partition
├── stm32mp157f-dk2[*].dtb  Linux kernel device tree blob files → STM32MP157F-DK2
├── stm32mp157f-ev1[*].dtb  Linux kernel device tree blob files → STM32MP157F-EV1
├── [...]
├── uImage                  Linux kernel binary image file (with U-Boot wrapper)
└── [...]
  • User file system mounting point (Example based on STM32MP25x lines More info.png)
/usr/local  userfs partition
├── Cube-M4-examples                                       Examples for STM32CubeMP1 Package running on Arm® Cortex®-M4
│   ├── STM32MP157F-DK2                                    Examples of firmwares running on Arm Cortex-M4 → STM32MP157F-DK2 (see more in STM32CubeMP15 Package)
│   │   ├── Applications
│   │   │   ├── OpenAMP
│   │   |   |    ├── OpenAMP_TTY_echo                      OpenAMP TTY echo application
│   │   │   |    |    ├── fw_cortex_m4.sh                  Script to start/stop this application
│   │   │   |    |    ├── lib
│   │   │   |    |    │   └── firmware
│   │   │   |    |    │       └── OpenAMP_TTY_echo.elf     Firmware for this application
│   │   │   |    |    └── README                           Helper file for this application
│   │   │   │    └── [...]                                 Other OpenAMP applications with the same structure (script, helper file and firmware)
│   │   │   └── [...]                                      Other applications with the same structure (script, helper file and firmware)
│   │   ├── Demonstrations
│   │   │   ├── AI_Character_Recognition                   Artificial intelligence character recognition demonstration
│   │   │        └── lib
│   │   │            └── firmware
│   │   │                └── AI_Character_Recognition.elf  Firmware for this demonstration
│   │   └── Examples
│   │       ├── GPIO
│   │       |    └── GPIO_EXTI                             GPIO EXTI example
│   │       |         ├── fw_cortex_m4.sh                  Script to start/stop this example
│   │       |         ├── lib
│   │       |         │   └── firmware
│   │       |         │       └── GPIO_EXTI.elf            Firmware for this example
│   │       |         └── README                           Helper file for this example
│   │       └── [...]                                      Other examples with the same structure (script, helper file and firmware)
│   └── STM32MP157F-EV1                                    Examples of firmwares running on Arm Cortex-M4 → STM32MP157F-EV1 (see more in STM32CubeMP15 Package)
│       ├── Applications
│       │   └── [...]                                      Applications with the same structure (script, helper file and firmware)
│       ├── Demonstrations
│       │   └── [...]                                      Demonstrations with the same structure (script, helper file and firmware)
│       └── Examples
│           └── [...]                                      Examples with the same structure (script, helper file and firmware)
├── Linux-A7-examples                Examples for Linux® running on Arm® Cortex®-A7
│   ├── GPIO                         GPIO examples
│   │   ├── buttons
│   │   │   ├── button_gpio_exti.sh  Script for this example
│   │   |   └── README.md            Helper file for this example
│   │   └── leds                     Same structure for this example relative to the leds
│   │       └── [...]
│   └── [...]                        Same structure for all the examples
├── demo                             All files needed (e.g. Python scripts, pictures, media files...) for the GTK demo launcher
│   └── [...]
├── lost+found
└── weston-start-at-startup
    └── start_up_demo_launcher.sh    Script to start the GTK demo launcher
  • Vendor file system mounting point
/vendor    vendorfs partition
├── [*].so  Specific vendor libraries (e.g. Vivante libraries OpenGL ES, OpenVG and EGL)
└── [...]