Project

General

Profile

Recovery and the KERNEL partition

Added by Mickey Knox over 6 years ago

After having used replicant 4.2 for a while on my Samsung Galaxy S2, I wanted to give LineageOS a try.
Unfortunately, the CWM Recovery I installed when installing replicant cannot install LineageOS.
The installation instructions for LineageOS also suggest installing TWRP Recovery. That seems to work,
but when booting into Recover mode, it's always CWM who gets loaded.

One thing to mention here is: CWM was installed to the KERNEL partition, whereas TWRP is ought to be
installed to the RECOVERY partition. Several questions arise now:

1. What is the KERNEL partition? I could find information on the RECOVERY partition, but not on the
KERNEL partition. It seems not to be a standard partition. Is it only present on Samsung devices?

2. How is the booted partition selected when booting into Recovery mode? I assume, the KERNEL partition
has a higher priority than the RECOVERY partition and this is way the installation of TWRP into the
RECOVERY partition has seemingly no effect. Is this assumption correct?

3. Finally, how should I proceed? Is it save to install TWRP to the KERNEL partition? Or can I wipe
the KERNEL partition so that the RECOVERY partition is booted? If so, how?


Replies (5)

RE: Recovery and the KERNEL partition - Added by Fil Lupin over 6 years ago

Hi Mickey, I'm not an expert but it seems to me kernel is another name for BOOT.
It contains the Android Kernel while RECOVERY partition contains advanced tools for recovery. Than I would have install on RECOVERY only CWM (or TWRP) and let Replicant/standard android on BOOT partition.

However, since I am not an expert, I would prefer someone confirm this.

RE: Recovery and the KERNEL partition - Added by Mickey Knox over 6 years ago

I don't think that KERNEL is just another name for BOOT. You can see all partitions with this command:

heimdall print-pit

Output:

...

--- Entry #1 ---
Binary Type: 0 (AP)
Device Type: 2 (MMC)
Identifier: 1
Attributes: 0 (Read-Only)
Update Attributes: 0
Partition Block Size/Offset: 0
Partition Block Count: 0
File Offset (Obsolete): 0
File Size (Obsolete): 0
Partition Name: BOOT
Flash Filename: boot.bin
FOTA Filename:

...

--- Entry #6 ---
Binary Type: 0 (AP)
Device Type: 2 (MMC)
Identifier: 6
Attributes: 0 (Read-Only)
Update Attributes: 0
Partition Block Size/Offset: 73728
Partition Block Count: 16384
File Offset (Obsolete): 0
File Size (Obsolete): 0
Partition Name: KERNEL
Flash Filename: zImage
FOTA Filename:

--- Entry #7 ---
Binary Type: 0 (AP)
Device Type: 2 (MMC)
Identifier: 7
Attributes: 0 (Read-Only)
Update Attributes: 0
Partition Block Size/Offset: 90112
Partition Block Count: 16384
File Offset (Obsolete): 0
File Size (Obsolete): 0
Partition Name: RECOVERY
Flash Filename:
FOTA Filename:

...

RE: Recovery and the KERNEL partition - Added by Fil Lupin over 6 years ago

In fact, PIT depend of the android phone you have. I make the assumption that S2 PIT contains the same partitions than S3 PIT, which is perhaps a mistake.
For information, did you make any change into your PIT?

Could you write us the steps you followed and the commands you launched, especially heimdall commands?

RE: Recovery and the KERNEL partition - Added by Mickey Knox over 6 years ago

I'm pretty sure I did not make any changes to the PIT myself. In fact, I learned about the PIT only recently upon investigating why installing TWRP seemingly doesn't suceed.

The commands I launched came from the installation instructions for replicant and lineageos. The installation instructions for replicant have been updated for replicant 6,
but I did install replicant 4.2 back in the days. I will just assume, that doesn't change much with respect to the heimdall commands.

So, taken from the respective installation instructions, the commands where:

heimdall flash --KERNEL path/to/recovery-i9100.img (when installing replicant)

and when installing lineageos:

heimdall print-pit
heimdall flash --RECOVERY twrp-x.x.x-x-i9100.img --no-reboot (I think the name of the image was just recovery.img, so I changed that accordingly)

Reference: https://wiki.lineageos.org/devices/i9100/install

By the way, I succeeded in installing replicant 6 without a problem. However, I still would like to give LineageOS a try.

RE: Recovery and the KERNEL partition - Added by Mickey Knox over 6 years ago

I've succeded in installing TWRP. Why? I don't really know.

What has changed?
I've installed replicant 6 in between and thereby the replicant 6 recovery image. That is all.

    (1-5/5)