An open API service indexing awesome lists of open source software.

https://github.com/info-beamer/rpi-eeprom-tools

Tools for working with the Pi4/Pi5 EEPROM firmware files
https://github.com/info-beamer/rpi-eeprom-tools

eeprom pi4 pi5 raspberry-pi

Last synced: 5 months ago
JSON representation

Tools for working with the Pi4/Pi5 EEPROM firmware files

Awesome Lists containing this project

README

          

# Pi4 / Pi5 EEPROM tools

Created for use by [info-beamer hosted](https://info-beamer.com): They allow you to
modify the pieeprom EEPROM images used for the Pi4 and Pi5. You can inspect those
EEPROM files and modify some of their content for fun and profit :)

Somewhat based on https://github.com/raspberrypi/rpi-eeprom/blob/master/rpi-eeprom-config

## Usage:

Fetch one of the EEPROM files from the [firmware repository](https://github.com/raspberrypi/rpi-eeprom):

```
$ wget https://github.com/raspberrypi/rpi-eeprom/raw/master/firmware-2711/latest/pieeprom-2023-05-11.bin -o pieeprom.bin
```

### Inspecting an EEPROM file

```
$ ./pi-eeprom-ls pieeprom.bin
eeprom version: 4fd8f1f3, 2023-05-11 (pi4)
-----------------------------------
60424 @ 0x00000000 / 0>

-[ bootconf.txt ]------------------
[all]
BOOT_UART=0
WAKE_ON_GPIO=1
POWER_OFF_ON_HALT=0

-[ bootconf.sig ]------------------
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-[ pubkey.bin ]--------------------
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
```

### Extracting EEPROM content

You can extract and decompress the files within an EEPROM image into individual files:

```
$ mkdir pieeprom
$ ./pi-eeprom-extract pieeprom.bin pieeprom
$ ls -l pieeprom
total 720
-rw-rw-r-- 1 dividuum dividuum 60424 Nov 10 15:29 boot
-rw-rw-r-- 1 dividuum dividuum 1024 Nov 10 15:29 bootconf.sig
-rw-rw-r-- 1 dividuum dividuum 54 Nov 10 15:29 bootconf.txt
-rw-rw-r-- 1 dividuum dividuum 244964 Nov 10 15:29 bootmain
-rw-rw-r-- 1 dividuum dividuum 27404 Nov 10 15:29 font.bin
-rw-rw-r-- 1 dividuum dividuum 12844 Nov 10 15:29 logo.bin
-rw-rw-r-- 1 dividuum dividuum 5440 Nov 10 15:29 mcb.bin
-rw-rw-r-- 1 dividuum dividuum 20492 Nov 10 15:29 memsys00.bin
-rw-rw-r-- 1 dividuum dividuum 20492 Nov 10 15:29 memsys01.bin
-rw-rw-r-- 1 dividuum dividuum 20492 Nov 10 15:29 memsys02.bin
-rw-rw-r-- 1 dividuum dividuum 20492 Nov 10 15:29 memsys03.bin
-rw-rw-r-- 1 dividuum dividuum 20492 Nov 10 15:29 memsys04.bin
-rw-rw-r-- 1 dividuum dividuum 20492 Nov 10 15:29 memsys05.bin
-rw-rw-r-- 1 dividuum dividuum 20492 Nov 10 15:29 memsys06.bin
-rw-rw-r-- 1 dividuum dividuum 20492 Nov 10 15:29 memsys07.bin
-rw-rw-r-- 1 dividuum dividuum 20492 Nov 10 15:29 memsys08.bin
-rw-rw-r-- 1 dividuum dividuum 1024 Nov 10 15:29 pubkey.bin
-rw-rw-r-- 1 dividuum dividuum 40044 Nov 10 15:29 qrcode.bin
-rw-rw-r-- 1 dividuum dividuum 9446 Nov 10 15:29 vl805hub.bin
-rw-rw-r-- 1 dividuum dividuum 86680 Nov 10 15:29 vl805mcu.bin

$ file pieeprom/bootmain
pieeprom/bootmain: ELF 32-bit LSB executable, Broadcom VideoCore III, version 1 (SYSV), statically linked, stripped

$ gimp pieeprom/logo.bin
```

### Rewriting bootconf.txt

This can be used to create files needed for the update process (see [here](https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#eeprom-update-files)):

```
$ ./pi-eeprom-update pieeprom.bin updated.bin updated.sig updated.ver
```

This will create three new files. `updated.bin` contains the modified EEPROM, `updated.sig` is a signature file and
`updated.ver` contains the version number of the EEPROM.

Use

```
$ ./pi-eeprom-ls updated.bin
```

to confirm that these changes are have been made.

### Recompressing the firmware files

Not sure why you would do that, but it here it is. Be sure to run `make` first so `compress.so` gets built. Otherwise the
compression is shit:

```
$ make
gcc compress.c -O3 -shared -o compress.so
$ ./pi-eeprom-recompress pieeprom.bin updated.bin

$ ./pi-eeprom-ls pieeprom.bin |grep bootmain

$ ./pi-eeprom-ls updated.bin |grep bootmain

```