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.
Download the following tools/files
- 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
I used the manual of Lukas Knauer that has been written in German.