199449224Schristos 299449224Schristos#------------------------------------------------------------------------------ 3*4c89978fSchristos# $File: rpi,v 1.3 2022/04/02 14:39:34 christos Exp $ 499449224Schristos# rpi: file(1) magic for Raspberry Pi images 599449224Schristos-44 lelong 0 699449224Schristos>4 lelong 0 799449224Schristos>>8 lelong 1 899449224Schristos>>12 lelong 4 999449224Schristos>>>16 string 283x 1099449224Schristos>>>>20 lelong 1 1199449224Schristos>>>>>24 lelong 4 1299449224Schristos>>>>>>28 string DTOK 1399449224Schristos>>>>>>>32 lelong 44 1499449224Schristos>>>>>>>>36 lelong 4 1599449224Schristos>>>>>>>>>40 string RPTL Raspberry PI kernel image 160086c5a6Schristos 170086c5a6Schristos-56 lelong 0 180086c5a6Schristos>4 lelong 0 190086c5a6Schristos>>8 lelong 1 200086c5a6Schristos>>12 lelong 4 210086c5a6Schristos>>>16 string 283x 220086c5a6Schristos>>>>20 lelong 1 230086c5a6Schristos>>>>>24 lelong 4 240086c5a6Schristos>>>>>>28 string DTOK 250086c5a6Schristos>>>>>>>32 lelong 1 260086c5a6Schristos>>>>>>>>36 lelong 4 270086c5a6Schristos>>>>>>>>>40 string DDTK8 280086c5a6Schristos>>>>>>>>>>48 lelong 4 290086c5a6Schristos>>>>>>>>>>>52 string RPTL Raspberry PI kernel image 30*4c89978fSchristos 31*4c89978fSchristos# From: Joerg Jenderek 32*4c89978fSchristos# URL: https://www.raspberrypi.com/documentation/computers/raspberry-pi.html 33*4c89978fSchristos# #raspberry-pi-4-boot-eeprom 34*4c89978fSchristos# Reference: https://github.com/raspberrypi/rpi-eeprom/blob/master/rpi-eeprom-config 35*4c89978fSchristos# Note: start with same magic as for BIOS (ia32) ROM Extension handled by ./intel 36*4c89978fSchristos# masked with MAGIC_MASK and then compared with MAGIC 37*4c89978fSchristos0 belong&0xFFffF00F 0x55aaF00F Raspberry PI EEPROM 38*4c89978fSchristos#!:mime application/octet-stream 39*4c89978fSchristos!:mime application/x-raspberry-eeprom 40*4c89978fSchristos# like: pieeprom-2020-09-03.bin 41*4c89978fSchristos!:ext bin 42*4c89978fSchristos# a 32 bit offset to the next section like: 000184d4 000184c8 00018534 ... 0000bb84 0000bbd4 0000bbd4 43*4c89978fSchristos>4 ubelong x \b, offset %8.8x 44*4c89978fSchristos#>(4.L) ubelong x NEXT=%8.8x 45*4c89978fSchristos# self.length 46*4c89978fSchristos>8 ubelong !0 \b, length %x 47*4c89978fSchristos# self.filename 48*4c89978fSchristos>12 string >0 \b, "%s" 49*4c89978fSchristos# length is zero 50*4c89978fSchristos>8 ubelong =0 51*4c89978fSchristos# if length is zero then 2nd section magic here can be zero; this means sections parsing done 52*4c89978fSchristos>>8 ubelong !0 \b, 2nd MAGIC=%8.8x 53