This version is outdated by a newer approved version.DiffThis version (2022/06/23 09:42) is a draft.
Approvals: 0/1

This is an old revision of the document!


Batocera's File Partitions

Batocera.linux is based on buildroot. You can see buildroot as a minimal Linux distribution which maintains base packages. Its focus is on being firmware for embedded systems, but is flexible enough to allow for more complex projects such as Batocera. Batocera.linux mainly includes extra packages not available by default in Buildroot (emulators, front-end GUI, additional drivers for devices, etc.) and configuration.

More information about Buildroot can be found here: https://buildroot.org.

An illustration showing how the Batocera system is laid out on a USB stick: the BATOCERA partition first, containing all the programs, and then the SHARE, containing all the userdata.

Technically, batocera.linux has two partitions. One for the system and one for the userdata. The partition named BATOCERA visible on any computer under Windows, MacOS or Linux is the system. It is a partition formatted in FAT32, a filesystem supported by almost every OS and boot system (BIOS legacy or UEFI).

It contains mainly 3 files:

  • linux, the technical system (about 10 MB)
  • batocera, the software system containing all the programs (about 2 GB compressed)
  • initrd.gz or uInitrd, the loader (about 600 kB)

Upgrading the system means mainly that these 3 files are getting upgraded. There may be some other files depending on the architecture.

The file batocera can be seen like a firmware, you cannot modify it. However the architecture is a bit more complex and allows you to add “adjustments” to modify the firmware without recompiling everything: batocera.linux supports and uses by default overlayfs. The real system is the firmware (the file batocera) + a filesystem in memory initialized with the file overlay if it exists. The overlay is an in-memory filesystem and not directly the overlay file because under Linux, you cannot properly unmount the root filesystem, mainly when it's a complex root from several filesystems.

As a general rule, the file overlay doesn't exist, unless it's created by the script batocera-save-overlay if a user or developer customizes the system.

+--------------------------------+
| TMPFS, writable                | --> must be saved explicitly on /boot/overlay
+--------------------------------+
| firmware (squashfs), read only |
+--------------------------------+

More details on overlayfs can be found here : http://embedded-computing.com/guest-blogs/understand-what-an-overlayfs-is-and-how-it-works

When you create the card to run batocera.linux, the card is more complex than a basic card, and it's dependent on the architecture. It's why you need a special tool to burn it.

  • BEFORE BOOT : these are technical files to be able to access the BOOT partition and run the Linux kernel.
  • BOOT : this partition is visible on Windows. This is where the batocera.linux system is.
  • FREE : this free space is filled with a SHARE partition on the first boot to save all the user data (ROMs and ancillary files like screenshots, video snaps and so on).
  • SHARE : this partition replaces FREE at the first boot. It is partitioned as EXT4 by default, but you have other options depending on the usual OS you have on your other computers. See the chapter “Userdata file systems” below.
      1                  1263
+-----+-------------------+--------+--------------+
| MBR |                   |  BOOT  |     FREE     |
+-----+-------------------+--------+--------------+
     512                 631K
      1                  1263
+-----+-------------------+--------+--------------+
| GPT | SYSLINUX          |  BOOT  |     FREE     |
+-----+-------------------+--------+--------------+
     512                 631K
      1      31      63          719     1231    1263
+-----+-------+-------+-----------+--------+-------+----------+--------------+
| MBR |  bl1  |  bl2  |   uboot   |  tzsw  |       |   BOOT   |     FREE     |
+-----+-------+-------+-----------+--------+-------+----------+--------------+
     512     15K     31K         359K     615K    631K       1.2G
      1       97         1281
+-----+-------+-----------+--------+--------------+
| MBR |  bl1  |   uboot   |  BOOT  |     FREE     |
+-----+-------+-----------+--------+--------------+
     512     48K         640K

You have several options to host your user data file systems. Refer to the add games and BIOS page to get some guidelines to make your decision. Be careful with this choice: in most cases, if you need to change the file system, you will lose all your ROMs, BIOS files and other userdata.

  • batocera.linux_architecture.1655970156.txt.gz
  • Last modified: 22 months ago
  • by atari