Last edited one month ago

OpenSTLinux directory structure: Difference between revisions

Registered User
mNo edit summary
Registered User
mNo edit summary
 
(24 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<noinclude>{{ApplicableFor
{{ApplicableFor
|MPUs list=STM32MP13x, STM32MP15x
|MPUs list=STM32MP13x, STM32MP15x, STM32MP21x, STM32MP23x, STM32MP25x
|MPUs checklist=STM32MP13x, STM32MP15x
|MPUs checklist=STM32MP13x, STM32MP15x, STM32MP21x, STM32MP23x, STM32MP25x
}}</noinclude>
}}
<noinclude></noinclude>
This article aims at presenting, '''as example''', the directory structure of the Linux root file system available on STM32 board.
This article aims at presenting, '''as example''', the directory structure of the Linux root file system available on STM32 board.


Line 8: Line 9:


This root directory corresponds to the Linux root file system (rootfs partition), as defined in [[STM32 MPU Flash mapping#Flash partitions|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.
This root directory corresponds to the Linux root file system (rootfs partition), as defined in [[STM32 MPU Flash mapping#Flash partitions|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|In practice, this article uses the release '''STM32MP15-Ecosystem-v{{EcosystemRelease/Revision | revision=latest}}''' 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.}}{{UpdateNeededForNewRelease|The trees below shall be updated periodically, even if the information banner specifies that they might not be up-to-date}}


The directories are shown in {{Green|green}}, while the files are in black.
{{info|In practice, this article uses the release '''STM32MP15-Ecosystem-{{EcosystemRelease/Revision | revision=6.1.0}}''' 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.}}{{UpdateNeededForNewRelease|The trees below shall be updated periodically, even if the information banner specifies that they might not be up-to-date}}


  {{Green|/}}                            {{Highlight|'''Root directory (rootfs partition)'''}}
The directories are shown in {{STLightGreen|green}}, while the files are in black.
  ├── {{Green|bin}}                      {{Highlight|Essential user binaries (e.g. ''/bin/cat'', ''/bin/ls'', ''/bin/cp''...)}}
 
  {{STLightGreen|/}}                            {{Highlight|'''Root directory (rootfs partition)'''}}
  ├── {{STLightGreen|bin}}                      {{Highlight|Essential user binaries (e.g. ''/bin/cat'', ''/bin/ls'', ''/bin/cp''...)}}
  │  └── [...]
  │  └── [...]
  ├── {{Green|boot}}                    {{Highlight|Mounting point for the boot file system (bootfs partition): see below}}
  ├── {{STLightGreen|boot}}                    {{Highlight|Mounting point for the boot file system (bootfs partition): see below}}
  ├── {{Green|dev}}                      {{Highlight|Device files (e.g. ''/dev/null'', ''/dev/tty0'', ''/dev/video0''...)}}
  ├── {{STLightGreen|dev}}                      {{Highlight|Device files (e.g. ''/dev/null'', ''/dev/tty0'', ''/dev/video0''...)}}
  ├── {{Green|etc}}                      {{Highlight|System-wide configuration files (e.g. ''/etc/xdg/weston/weston.ini'' Weston configuration file...)}}
  ├── {{STLightGreen|etc}}                      {{Highlight|System-wide configuration files (e.g. ''/etc/xdg/weston/weston.ini'' Weston configuration file...)}}
  ├── {{Green|home}}                    {{Highlight|Users' home directories (containing saved files, personal settings...)}}
  ├── {{STLightGreen|home}}                    {{Highlight|Users' home directories (containing saved files, personal settings...)}}
  ├── {{Green|lib}}                      {{Highlight|Essential system libraries for the binaries in ''/bin'' and ''/sbin'' (e.g. ''libncurses.so.*''...)}}
  ├── {{STLightGreen|lib}}                      {{Highlight|Essential system libraries for the binaries in ''/bin'' and ''/sbin'' (e.g. ''libncurses.so.*''...)}}
  │  ├── {{Green|modules}}
  │  ├── {{STLightGreen|modules}}
  │  │  └── ''{{Green|5.15.24}}''       {{Highlight|The directory name is the linux version example : 5.15.24}}
  │  │  └── ''{{STLightGreen|{{EcosystemRelease/Component | revision=latest | component=Linux kernel | name=release}}}}''         {{Highlight|The directory name is the linux version (i.e. {{EcosystemRelease/Component | revision=latest | component=Linux kernel | name=release}})}}
  │  │      ├── {{Green|kernel}}      {{Highlight|Linux kernel modules}}
  │  │      ├── {{STLightGreen|kernel}}      {{Highlight|Linux kernel modules}}
  │  │      │  └── [...]
  │  │      │  └── [...]
  │  │      ├── modules.dep  {{Highlight|List of module dependencies (generated by ''depmod'')}}
  │  │      ├── modules.dep  {{Highlight|List of module dependencies (generated by ''depmod'')}}
  │  │      └── [...]
  │  │      └── [...]
  │  └── [...]
  │  └── [...]
  ├── {{Green|lost+found}}
  ├── {{STLightGreen|lost+found}}
  ├── {{Green|media}}                    {{Highlight|Mount points for removable media devices}}
  ├── {{STLightGreen|media}}                    {{Highlight|Mount points for removable media devices}}
  ├── {{Green|mnt}}                      {{Highlight|Temporarily mounted file systems}}
  ├── {{STLightGreen|mnt}}                      {{Highlight|Temporarily mounted file systems}}
  ├── {{Green|proc}}                    {{Highlight|[[Pseudo filesystem|Pseudo filesystem]] providing process and kernel information as files (e.g. ''/proc/cpuinfo'', ''/proc/version''...)}}
  ├── {{STLightGreen|proc}}                    {{Highlight|[[Pseudo filesystem|Pseudo filesystem]] providing process and kernel information as files (e.g. ''/proc/cpuinfo'', ''/proc/version''...)}}
  ├── {{Green|root}}                    {{Highlight|Home directory for the root user)}}
  ├── {{STLightGreen|root}}                    {{Highlight|Home directory for the root user)}}
  ├── {{Green|run}}                      {{Highlight|Run-time variable data (information about the running system since last boot)}}
  ├── {{STLightGreen|run}}                      {{Highlight|Run-time variable data (information about the running system since last boot)}}
  ├── {{Green|sbin}}                    {{Highlight|Essential system binaries (e.g. ''/sbin/fsck'', ''/sbin/init'', ''/sbin/modprobe''...)}}
  ├── {{STLightGreen|sbin}}                    {{Highlight|Essential system binaries (e.g. ''/sbin/fsck'', ''/sbin/init'', ''/sbin/modprobe''...)}}
  ├── {{Green|sys}}                      {{Highlight|Information about devices, drivers, and some kernel features (e.g. ''/sys/kernel/debug'' aka''debgufs''...)}}
  ├── {{STLightGreen|sys}}                      {{Highlight|Information about devices, drivers, and some kernel features (e.g. ''/sys/kernel/debug'' aka''debgufs''...)}}
  ├── {{Green|tmp}}                      {{Highlight|Temporary files}}
  ├── {{STLightGreen|tmp}}                      {{Highlight|Temporary files}}
  ├── {{Green|usr}}                      {{Highlight|User utilities and applications}}
  ├── {{STLightGreen|usr}}                      {{Highlight|User utilities and applications}}
  │  ├── {{Green|bin}}                  {{Highlight|Non-essential user binaries (e.g. ''/usr/bin/lsusb'', ''/usr/bin/weston''...)}}
  │  ├── {{STLightGreen|bin}}                  {{Highlight|Non-essential user binaries (e.g. ''/usr/bin/lsusb'', ''/usr/bin/weston''...)}}
  │  ├── {{Green|lib}}                  {{Highlight|Non-essential system libraries for the binaries in ''/usr/bin'' and ''/usr/sbin''}}
  │  ├── {{STLightGreen|lib}}                  {{Highlight|Non-essential system libraries for the binaries in ''/usr/bin'' and ''/usr/sbin''}}
  │  ├── {{Green|local}}                {{Highlight|Mounting point for the user file system (userfs partition): see below}}
  │  ├── {{STLightGreen|local}}                {{Highlight|Mounting point for the user file system (userfs partition): see below}}
  │  ├── {{Green|sbin}}                {{Highlight|Non-essential system binaries (e.g. ''/usr/sbin/alsactl'', ''/usr/sbin/weston.sh''...)}}
  │  ├── {{STLightGreen|sbin}}                {{Highlight|Non-essential system binaries (e.g. ''/usr/sbin/alsactl'', ''/usr/sbin/weston.sh''...)}}
  │  ├── {{Green|share}}                {{Highlight|Architecture-independent (shared) data}}
  │  ├── {{STLightGreen|share}}                {{Highlight|Architecture-independent (shared) data}}
  │  └── [...]
  │  └── [...]
  ├── {{Green|var}}                      {{Highlight|Variable files}}
  ├── {{STLightGreen|var}}                      {{Highlight|Variable files}}
  └── {{Green|vendor}}                  {{Highlight|Mounting point for the vendor file system (vendorfs partition): see below}}
  └── {{STLightGreen|vendor}}                  {{Highlight|Mounting point for the vendor file system (vendorfs partition): see below}}


* Boot file system mounting point
* Boot file system mounting point
  {{Green|/boot}} {{Highlight|'''bootfs partition'''}}
  {{STLightGreen|/boot}}   {{Highlight|'''bootfs partition'''}}
  ├── stm32mp157f-dk2[*].dtb {{Highlight|Linux kernel device tree blob files → STM32MP157F-DK2}}
  ├── stm32{{HighlightParam|<soc>}}-dk[*].dtb   {{Highlight|Linux kernel device tree blob files for discovery board(s)}}
  ├── stm32mp157f-ev&[*].dtb {{Highlight|Linux kernel device tree blob files → STM32MP157F-EV1}}
  ├── stm32{{HighlightParam|<soc>}}-ev[*].dtb   {{Highlight|Linux kernel device tree blob files for evaluation board(s)}}
├── [...]
  ├── uImage                  {{Highlight|Linux kernel binary image file (with U-Boot wrapper)}}
  ├── uImage                  {{Highlight|Linux kernel binary image file (with U-Boot wrapper)}}
  └── [...]
  └── [...]


* User file system mounting point
* User file system mounting point
  {{Green|/usr/local}} {{Highlight|'''userfs partition'''}}
  {{STLightGreen|/usr/local}}   {{Highlight|'''userfs partition'''}}
  ├── {{Green|Cube-M4-examples}}                                       {{Highlight|Examples for STM32CubeMP1 Package running on Arm<sup>&reg;</sup> Cortex<sup>&reg;</sup>-M4}}
  ├── {{STLightGreen|Cube-{{HighlightParam|[M4&#124;M33]}}-examples}}   {{Highlight|Examples for M4 {{HighlightParam|(STM32CubeMP1)}} Package or M33 {{HighlightParam|(STM32CubeMP2)}} running on Arm<sup>&reg;</sup> Cortex<sup>&reg;</sup>M}}
  │  ├── {{Green|STM32MP157C-DK2}}                                   {{Highlight|Examples of firmwares running on Arm Cortex-M4 → STM32MP157C-DK2 (see more in [[STM32CubeMP1 Package]])}}
  │  ├── {{STLightGreen|STM32MP{{HighlightParam|<soc>}}-DK}}       {{Highlight|Examples of firmwares running on Arm Cortex-M4 or Cortex-M33 }}
  │  │  ├── {{Green|Applications}}
  │  │  ├── {{STLightGreen|Applications}}
  │  │  │  ├── {{Green|OpenAMP}}
  │  │  │  ├── {{STLightGreen|<Applications Name>}}
  │  │  |  |    ├── {{Green|OpenAMP_TTY_echo}}                      {{Highlight|OpenAMP TTY echo application}}
  │  │  |  |    ├── {{STLightGreen|<Application Name>}}                      {{Highlight|OpenAMP TTY echo application}}
  │  │  │  |    |    ├── fw_cortex_m4.sh                 {{Highlight|Script to start/stop this application}}
  │  │  │  |    |    ├── <script name>.sh                   {{Highlight|Script to start/stop this application}}
  │  │  │  |    |    ├── {{Green|lib}}
  │  │  │  |    |    ├── {{STLightGreen|lib}}
  │  │  │  |    |    │  └── {{Green|firmware}}
  │  │  │  |    |    │  └── {{STLightGreen|firmware}}
  │  │  │  |    |    │      └── OpenAMP_TTY_echo.elf    {{Highlight|Firmware for this application}}
  │  │  │  |    |    │      └── <Application Name>.elf    {{Highlight|Firmware for this application}}
  │  │  │  |    |    └── README                           {{Highlight|Helper file for this application}}
  │  │  │  |    |    └── README                             {{Highlight|Helper file for this application}}
  │  │  │  │    └── [...]                                 {{Highlight|Other OpenAMP applications with the same structure (script, helper file and firmware)}}
  │  │  │  │    └── [...]                                   {{Highlight|Others applications with the same structure (script, helper file and firmware)}}
  │  │  │  └── [...]                                     {{Highlight|Other applications with the same structure (script, helper file and firmware)}}
  │  │  │  └── [...]                                       {{Highlight|Others applications with the same structure (script, helper file and firmware)}}
  │  │  ├── {{Green|Demonstrations}}
  │  │  ├── {{STLightGreen|Demonstrations}}
  │  │  │  ├── {{Green|AI_Character_Recognition}}                   {{Highlight|Artificial intelligence character recognition demonstration}}
  │  │  │  ├── {{STLightGreen|AI_Character_Recognition}}                     {{Highlight|Artificial intelligence character recognition demonstration}}
  │  │  │        └── {{Green|lib}}
  │  │  │        └── {{STLightGreen|lib}}
  │  │  │            └── {{Green|firmware}}
  │  │  │            └── {{STLightGreen|firmware}}
  │  │  │                └── AI_Character_Recognition.elf {{Highlight|Firmware for this demonstration}}
  │  │  │                └── AI_Character_Recognition.elf   {{Highlight|Firmware for this demonstration}}
      └── {{Green|Examples}}
  .   .   .
    │      ├── {{Green|GPIO}}
  .   .   .
  │      |    └── {{Green|GPIO_EXTI}}                            {{Highlight|GPIO EXTI example}}
  .  .  .
  │  │      |        ├── fw_cortex_m4.sh                  {{Highlight|Script to start/stop this example}}
{{ReviewsComments|-- [[User:Jean Christophe Trotin|Jean Christophe Trotin]] ([[User talk:Jean Christophe Trotin|talk]]) 15:51, 10 June 2025 (CEST)<br />The following directory shall either only be present for the boards of the STM32MP1 series, or be named "Linux-A7-examples" for the boards of the STM32MP1 series and "Linux-A35-examples" for the boards of the STM32MP2 series.}}
│  │      |        ├── {{Green|lib}}
  ├── {{STLightGreen|Linux-A7-examples}}   {{Highlight|Examples for Linux<sup>&reg;</sup> running on Arm<sup>&reg;</sup> Cortex<sup>&reg;</sup>-A7}}
│  │      |        │   └── {{Green|firmware}}
  │  ├── {{STLightGreen|GPIO}}             {{Highlight|GPIO examples}}
│  │      |        │      └── GPIO_EXTI.elf            {{Highlight|Firmware for this example}}
  │  │  ├── {{STLightGreen|buttons}}
  │      |        └── README                          {{Highlight|Helper file for this example}}
  │  │  │  ├── button_gpio_exti.sh   {{Highlight|Script for this example}}
│  │      └── [...]                                      {{Highlight|Other examples with the same structure (script, helper file and firmware)}}
  │  │  |  └── README.md             {{Highlight|Helper file for this example}}
 
  │  │  └── {{STLightGreen|leds}}                       {{Highlight|Same structure for this example relative to the leds}}
│  └── {{Green|STM32MP157C-EV1}}                          {{Highlight|Examples of firmwares running on Arm Cortex-M4 → STM32MP157C-EV1 (see more in [[STM32CubeMP1 Package]])}}
│      ├── {{Green|Applications}}
│      │  └── [...]                                      {{Highlight|Applications with the same structure (script, helper file and firmware)}}
│      ├── {{Green|Demonstrations}}
│      │  └── [...]                                      {{Highlight|Demonstrations with the same structure (script, helper file and firmware)}}
│      └── {{Green|Examples}}
│          └── [...]                                      {{Highlight|Examples with the same structure (script, helper file and firmware)}}
 
  ├── {{Green|Linux-A7-examples}}               {{Highlight|Examples for Linux<sup>&reg;</sup> running on Arm<sup>&reg;</sup> Cortex<sup>&reg;</sup>-A7}}
  │  ├── {{Green|GPIO}}                         {{Highlight|GPIO examples}}
  │  │  ├── {{Green|buttons}}
  │  │  │  ├── button_gpio_exti.sh {{Highlight|Script for this example}}
  │  │  |  └── README.md           {{Highlight|Helper file for this example}}
  │  │  └── {{Green|leds}}                     {{Highlight|Same structure for this example relative to the leds}}
  │  │      └── [...]
  │  │      └── [...]
  │  └── [...]                       {{Highlight|Same structure for all the examples}}
  │  └── [...]                         {{Highlight|Same structure for all the examples}}
  ├── {{Green|demo}}                             {{Highlight|All files needed (e.g. Python scripts, pictures, media files...) for the GTK demo launcher}}
  ├── {{STLightGreen|demo}}                               {{Highlight|All files needed (e.g. Python scripts, pictures, media files...) for the GTK demo launcher}}
  │  └── [...]
  │  └── [...]
  ├── {{Green|lost+found}}
  ├── {{STLightGreen|lost+found}}
  └── {{Green|weston-start-at-startup}}
  └── {{STLightGreen|weston-start-at-startup}}
     └── start_up_demo_launcher.sh   {{Highlight|Script to start the GTK demo launcher}}
     └── start_up_demo_launcher.sh     {{Highlight|Script to start the GTK demo launcher}}


* Vendor file system mounting point
* Vendor file system mounting point
  {{Green|/vendor}}    {{Highlight|'''vendorfs partition'''}}
  {{STLightGreen|/vendor}}    {{Highlight|'''vendorfs partition'''}}
  ├── [*].so {{Highlight|Specific vendor libraries (e.g. Vivante libraries OpenGL ES, OpenVG and EGL)}}
  ├── [*].so   {{Highlight|Specific vendor libraries (e.g. Vivante libraries OpenGL ES, OpenVG and EGL)}}
  └── [...]
  └── [...]



Latest revision as of 14:10, 30 June 2025

Applicable for STM32MP13x lines, STM32MP15x lines, Unknown MPU, Unknown MPU, Unknown MPU

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-unknown 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.78          The directory name is the linux version (i.e. 6.6.78)
│   │       ├── 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
├── stm32<soc>-dk[*].dtb    Linux kernel device tree blob files for discovery board(s)
├── stm32<soc>-ev[*].dtb    Linux kernel device tree blob files for evaluation board(s)
├── [...]
├── uImage                  Linux kernel binary image file (with U-Boot wrapper)
└── [...]
  • User file system mounting point
/usr/local    userfs partition
├── Cube-[M4|M33]-examples    Examples for M4 (STM32CubeMP1) Package or M33 (STM32CubeMP2) running on Arm® Cortex®M
│   ├── STM32MP<soc>-DK       Examples of firmwares running on Arm Cortex-M4 or Cortex-M33 
│   │   ├── Applications
│   │   │   ├── <Applications Name>
│   │   |   |    ├── <Application Name>                      OpenAMP TTY echo application
│   │   │   |    |    ├── <script name>.sh                   Script to start/stop this application
│   │   │   |    |    ├── lib
│   │   │   |    |    │   └── firmware
│   │   │   |    |    │       └── <Application Name>.elf     Firmware for this application
│   │   │   |    |    └── README                             Helper file for this application
│   │   │   │    └── [...]                                   Others applications with the same structure (script, helper file and firmware)
│   │   │   └── [...]                                        Others 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
.   .   .
.   .   .
.   .   .
├── 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)
└── [...]