Installing LineageOS on Samsung Galaxy S2
If you run a Samsung Galaxy S2 with stock ROM, you cannot install LineageOS in the usual, straight forward way: Partitions have to be resized and flashing custom recovery is not as simple as for other phones. This summarizes the necessary steps for setting up LineageOS on the device running a stock ROM.
Preparation
Download the following tools/files
- Heimdall flashing tool
- LineageOS
- Partition table layout (see attachments)
- TWRP recovery
Flashing
- Boot in download mode (Volume Down + Home + Power)
- Execute the driver setup for Heimdall (the relevant device is Gadget Serial)
- Execute the following command as priviledged user(boot.img is part of LineageOS)
heimdall flash -repartition -pit I91001GB_4GB.pit -RECOVERY twrp-3.1.0-0-i9100.img -KERNEL boot.img -no-reboot
- Power off phone, remove battery, insert battery, and boot into recovery (Volume Up + Home + Power)
- Resize Partitions (do this for system, data, internal storage and ignore shown errors)
- Advanced wipe - select partition - repair or change file system - resize
- Back - change file system - ext4
- Power off phone, remove battery, insert battery, and boot into recovery
- Wipe dalvik cache, cache, system, data, internal storage
- Push zip files of LineageOS and OpenGapps to sdcard0
- Install zip files
Sources
I used the manual of Lukas Knauer that has been written in German.