[File] [PATCH] Magdir/rpi for raspberry PI eeprom*.bin

Christos Zoulas christos at zoulas.com
Sat Apr 2 14:39:45 UTC 2022


Committed, thanks!

christos

> On Apr 1, 2022, at 12:34 PM, Jörg Jenderek <joerg.jen.der.ek at gmx.net> wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hello,
> 
> some days ago i wanted to change the boot order on my old PI.
> Therefore i installed package rpi-eeprom. Afterwards in sub
> directory bootloader beneath /lib/firmware are files with names like
> pieeprom*.bin.
> 
> When running file command version 5.41 on such examples i get an
> output like:
> 
> pieeprom20-07-16.bin: BIOS (ia32) ROM Ext. (-16*512)
> pieeprom22-03-10.bin: BIOS (ia32) ROM Ext. (-16*512)
> 
> By "bad" circumstances such eeprom start with same magic as for
> BIOS (ia32) ROM Extension handled by Magdir/intel.
> 
> Luckily on Raspberry pi web site in Raspberry Pi Documentation
> there is a section about "Raspberry Pi 4 Boot EEPROM". More details
> can be found inside python script rpi-eeprom-config. That
> informations are now expressed by additional comment lines
> inside Magdir/rpi like:
> 
> # URL:		https://www.raspberrypi.com/documentation/computers/
> #		raspberry-pi.html#raspberry-pi-4-boot-eeprom
> # Reference:	https://github.com/raspberrypi/rpi-eepro/blob/master/
> #		rpi-eeprom-config
> 
> 
> At the end i add new lines that start like:
> 0	belong&0xFFffF00F	0x55aaF00F	Raspberry PI EEPROM
> !:mime	application/x-raspberry-eeprom
> !:ext	bin
> 
> Instead generic mime type application/octet-stream i display a user
> defined one. In all my dozens samples the starting 4 bytes are always
> 0x55aaF00F, but according to python source there may exist variants
> that look a little bit other. So the value must be masked with
> value 0xFFffF00F (called MAGIC_MASK) before comparing value with
> expected value 0x55aaF00F (called MAGIC in source).
> 
> Afterwards a 32 bit offset in big endian to the next section is
> stored. This is shown by line like:
>> 4	ubelong			x		\b, offset %8.8x
> 
> Afterwards length and optional filename of section follow. This
> maybe is shown by lines like:
>> 8	ubelong			!0		\b, length %x 12	string			>0		\b, "%s"
> 
> For the first section i got always length zero. If i understand
> source right this means second section start immediately afterwards
> with it own magic. If this magic is also zero then parsing of
> sections is done. So this is now shown lines like:
>> 8	ubelong			=0
>>> 8	ubelong			!0		\b, 2nd MAGIC=%8.8x
> 
> After applying the above mentioned modifications by patch
> file-5.41-rpi-bin.diff then the raspberry pi EEPROM now are
> identified and described. This now with option -m Magdir/rpi
> looks like:
> 
> pieeprom-2020-07-16.bin: Raspberry Pi EEPROM, offset 000184d4
> pieeprom-2020-07-31.bin: Raspberry Pi EEPROM, offset 000184c8
> pieeprom-2020-09-03.bin: Raspberry Pi EEPROM, offset 000184c8
> pieeprom-2020-10-02.bin: Raspberry Pi EEPROM, offset 00018534
> pieeprom-2020-10-28.bin: Raspberry Pi EEPROM, offset 000185a4
> pieeprom-2020-11-24.bin: Raspberry Pi EEPROM, offset 0001a628
> pieeprom-2020-12-11.bin: Raspberry Pi EEPROM, offset 0001a5f4
> pieeprom-2021-01-05.bin: Raspberry Pi EEPROM, offset 0001a608
> pieeprom-2021-01-11.bin: Raspberry Pi EEPROM, offset 0001a60c
> pieeprom-2021-01-16.bin: Raspberry Pi EEPROM, offset 0001a614
> pieeprom-2021-02-16.bin: Raspberry Pi EEPROM, offset 0001a62c
> pieeprom-2021-03-04.bin: Raspberry Pi EEPROM, offset 0001ddcc
> pieeprom-2021-03-17.bin: Raspberry Pi EEPROM, offset 0001ddb0
> pieeprom-2021-05-19.bin: Raspberry Pi EEPROM, offset 0001de60
> pieeprom-2021-06-11.bin: Raspberry Pi EEPROM, offset 0001de84
> pieeprom-2021-06-17.bin: Raspberry Pi EEPROM, offset 0001de84
> pieeprom-2021-06-25.bin: Raspberry Pi EEPROM, offset 0001de84
> pieeprom-2021-07-06.bin: Raspberry Pi EEPROM, offset 0001de84
> pieeprom-2021-09-23.bin: Raspberry Pi EEPROM, offset 0000ab2c
> pieeprom-2021-09-27.bin: Raspberry Pi EEPROM, offset 0000ab28
> pieeprom-2021-10-04.bin: Raspberry Pi EEPROM, offset 0000ab28
> pieeprom-2021-10-05.bin: Raspberry Pi EEPROM, offset 0000ab28
> pieeprom-2021-10-27.bin: Raspberry Pi EEPROM, offset 0000bb30
> pieeprom-2021-11-22.bin: Raspberry Pi EEPROM, offset 0000bb30
> pieeprom-2021-12-02.bin: Raspberry Pi EEPROM, offset 0000bb30
> pieeprom-2022-01-20.bin: Raspberry Pi EEPROM, offset 0000bb30
> pieeprom-2022-01-25.bin: Raspberry Pi EEPROM, offset 0000bb30
> pieeprom-2022-02-04.bin: Raspberry Pi EEPROM, offset 0000bb84
> pieeprom-2022-02-16.bin: Raspberry Pi EEPROM, offset 0000bb84
> pieeprom-2022-02-28.bin: Raspberry Pi EEPROM, offset 0000bbd4
> pieeprom-2022-03-10.bin: Raspberry Pi EEPROM, offset 0000bbd4
> 
> I hope my diff file can be applied in future version of file
> utility.
> 
> With best wishes
> Jörg Jenderek
> - --
> Jörg Jenderek
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> -----BEGIN PGP SIGNATURE-----
> Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
> 
> iF0EARECAB0WIQS5/qNWKD4ASGOJGL+v8rHJQhrU1gUCYkcpogAKCRCv8rHJQhrU
> 1poeAJ9LLptm5lnxflAPVM48vz8rwqWwFwCgnEusJWndcfXVgSgwcT64nYlwT3Y=
> =a+yN
> -----END PGP SIGNATURE-----
> <Nachrichtenteil als Anhang.DEFANGED-0><file-5_41-rpi-bin_diff.DEFANGED-1><file-5_41-rpi-bin_diff_sig.DEFANGED-2>--
> File mailing list
> File at astron.com
> https://mailman.astron.com/mailman/listinfo/file
> <sanitizer.log>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 235 bytes
Desc: Message signed with OpenPGP
URL: <https://mailman.astron.com/pipermail/file/attachments/20220402/80eb7b84/attachment.asc>


More information about the File mailing list