This version is outdated by a newer approved version.DiffThis version (2020/01/28 20:47) is a draft.
Approvals: 0/1

This is an old revision of the document!


batocera.linux is based on buildroot. You can see buildroot as a Linux distribution while it maintains base packages. However, it's a tool to build root file systems (like a firmware). batocera.linux mainly includes extra packages not available on buildroot (emulators) and configuration.

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

Technically, batocera.linux has 2 partitions. 1 for the system, 1 for the user data. The partition named BATOCERA visible on any computer under Windows, MacOS or Linux is the system data.

It contains mainly 3 files :

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

Upgrading the system means mainly that these 3 files are getting upgraded. There are 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 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.

RPI SD CARD

      1                  1263
+-----+-------------------+--------+--------------+
| MBR |                   |  BOOT  |     FREE     |
+-----+-------------------+--------+--------------+
     512                 631K

X86/X86_64 USB KEY / HARD DRIVE

      1                  1263
+-----+-------------------+--------+--------------+
| MBR | GRUB              |  BOOT  |     FREE     |
+-----+-------------------+--------+--------------+
     512                 631K

XU4 SD/EMMC CARD

      1      31      63          719     1231    1263
+-----+-------+-------+-----------+--------+-------+----------+--------------+
| MBR |  bl1  |  bl2  |   uboot   |  tzsw  |       |   BOOT   |     FREE     |
+-----+-------+-------+-----------+--------+-------+----------+--------------+
     512     15K     31K         359K     615K    631K       1.2G

C2 SD CARD

      1       97         1281
+-----+-------+-----------+--------+--------------+
| MBR |  bl1  |   uboot   |  BOOT  |     FREE     |
+-----+-------+-----------+--------+--------------+
     512     48K         640K
  • batocera.linux_architecture.1580240862.txt.gz
  • Last modified: 4 years ago
  • by genetik57