msgbartop
Blog di Bernardino (Dino) Ciuffetti
msgbarbottom

13 Giu 11 How to unpack a patch.e2 enigma2 file from linux

The enigma2 patch file, generally named patch.e2, is a packet binary file containing a cramfs root filesystem and a linux kernel in zboot format.
It is commonly used by some TV decoder linux distribution systems to update the system firmware.

I didn’t find a quick way to extract the “/” cramfs filesystem from patch.e2 files from a linux system, so I decided to write a small utility from myself.

It is in attach, it’s called unpack_e2 and it’s very easy to use.
Just compile it with:

gcc -o unpack_e2 -O2 -Wall unpack_e2.c

And call it with the patch.e2 file as the first argument.
The two files produced are cram.img and kernel.img.

dino@dam2k:~/AZBOX_RTi_E2$ ./unpack_e2 /tmp/patch.e2
Team name: RTi Team
Description: Core 1.0
Version: 1.0.0
About: v.1.0
Kernel description: #78_May27
Size of cram image: 47542272 bytes (45.34 Mb)
Size of kernel image: 6584320 bytes (6.28 Mb)
Unpacking cramfs image to cram.img
Unpacking kernel image to kernel.img

Warning: it will work only with the new E2 image format (I think >= Core RC12).

If for some weird reason you need to extract the linux binary kernel file, you must use those commands:
# mount -t auto -o loop kernel.img /mnt
# dd if=/mnt/xrpc_xload_vmlinux_ES4_prod.bin skip=1 bs=836 |zcat >/tmp/vmlinux.bin

P.S. To do the reverse (pack a patch.e2) follow this link: http://sourceforge.net/projects/rticoree2/files/image_tools/

Ciao, Dino.

unpack_e2.c