Posts Tagged ‘heimdal’

Odyssey to revive Samsung S3 mini (GT-I8190)

Friday, January 8th, 2016

The Samsung GT-I8190 (S3 mini) is a decent android phone which has been around for a while. In order to see if it can handle a current 5.1.1 android, i wanted to install a custom rom.

The phone was rooted and had an old version of TWRP installed. Fortunately, there is a big community for the phone, so instructions to root and install a custom recovery are all over the internet.

When holding Volume Up + Home + Power, the phone boots into recovery (Volume Down + Home + Power for download mode). From there i wanted to install SlimLP when things went wrong.

Suddenly, the recovery could not mount any partitions anymore, the problem is well described over on StackExchange.

Since i had a fairly old version of TWRP installed, ADB was not available directly. Luckily, when switching to “ADB Sideload” under “Advanced” and canceling that, ADB was possible. From there, i verified the situation was exactly like that on StackExchange linked above. When running fdisk /dev/block/mmcblk0 i could see, that no partition information was available (unlike on StackExchange).

Next i created a partition spanning the entire internal memory with type “ee” (EFI GPT) while still in fdisk. The commands would be:

- n
- p
- 1
- enter (default)
- enter (default)
- t
- ee
- p (to verify)
- w (to write)

Then i tried to restore the partition information via the PIT file using Heimdal, the opensource alternative to samsungs Odin software. Odin and the download mode are somewhat similar to what elsewhere is called fastboot. Its a mechanism to restore pretty much everything, so as long as the download mode works, the phone is not bricked.

Unfortunately, even when compiling heimdal from git (version 1.41), running it as superuser (for USB permissions), it could not write the PIT file, i got:

Uploading PIT
ERROR: Failed to unpack received packet.
ERROR: Failed to unpack received packet.
ERROR: Failed to confirm end of PIT file transfer!
ERROR: Failed to confirm end of PIT file transfer!
ERROR: PIT upload failed!

ERROR: PIT upload failed!

Writing the custom recovery worked with heimdal, just the PIT upload wouldnt work.

Luckily, i had a windows machine nearby, where i could run Odin to repartition with the PIT file. I had to use Odin v1.85 because the v3.x versions did not work properly. On windows, be sure to install the Samsung USB drivers properly!

Back to Heimdal, i first flashed the stock recovery because it would try to setup the partitions again. It booted up but had a problem with the encryption, offering a “system reset”. Which would loop all over, so i then flashed TWRP (note: the partition is not called “recovery” but “Kernel2”) via:

heimdall flash --pit i8190_goldenxx.pit --verbose --stdout-errors --Kernel2 ./GT-I8190_TWRP_2.8.6.1/recovery.img

Beware, the GT-I8190 and GT-I8190N models use different PIT files.

After booting back into TWRP (where ADB works right away btw) an advanced wipe and “Format Data” brought back the desired partitions (no errors anymore mounting them).

From there, installing the custom rom was a breeze.