[Advanced users] How to install Lineage (or any) GSI on 2e

Very strange. I can’t confirm this. I used factory firmware and now I use gsi Havoc-OS-v3.12-20201230-Official-arm64-ab.img. Fingerprints works in both cases.

I’m having the same problem as Antero, also on Ubuntu 20.04 (I don’t have access to a windows PC)

writing 'system' 4/8...
FAILED (remote: Operation not permitted)
finished. total time: 59.435s

Edit: Update, i got it working with the platform tools from here

1 Like

Ubuntu Solved…
Android SDK Platform Tools for Ubuntu

1 Like

havoc 4,1 works very nicely imoas does lineage 18.1.

Is it possible to migrate FM radio app from stock to any GSI? Will it work?

It was mentioned previously that lineageos 18.1 was too big for our partition, can you provide your steps to get it working?

unlock bootloader per instructions here on the forum
fastboot delete-logical-partition product (if you get the message that says its to large)
flash system /PATH/TO/GSI.IMG
fastboot -w

had no issues this way as long as you wipe with the last command it should boot fine. headphone fix posted above did work but you do need to be rooted for that to work. you can manually adjust the size of the partition but this way works fine for me in this case. that guide is here on the forum as well for the 2e. i can write up a more detailed version tonight when i have the phone available again to me. also make sure you are using the proper lineage version for this phone and to extract the zip you download to only be the img file do not try to flash the zip file itself (some people do not know to do this) you can also use twrp if you wish also found here on the forum.

https://sourceforge.net/projects/andyyan-gsi/files/lineage-18.x/lineage-18.1-20210317-UNOFFICIAL-treble_arm64_bvS.img.xz/download

2 Likes

Hello, I’m a newbie and I need help.
First I installed and played with TWRP (and probably broken something).

Now when I try to fastboot flash system, I get this error:

…/platform-tools/fastboot flash system lineage-17.1-20210321-UNOFFICIAL-treble_arm64_bvS.img
Sending sparse ‘system’ 1/15 (131068 KB) OKAY [ 4.765s]
Writing ‘system’ FAILED (remote: ‘This partition doesn’t exist’)

So:

  1. What can I do with TWRP to fix this (or flash directly) ?
  2. If it doesn’t work, how can I recreate a system partition (big enough for LineageOS 18 if possible)
  3. If nothing works, how can I reset my 2e to factory without windows (I’m using Linux)

I just had this same problem with the same set of events. I made a TWRP backup of the system, used adb to pull it, then booted into bootloader and tried to flash.

After trying some stuff and it failing, I rebooted and went through setup skipping most steps like pin setup and google account and whatnot. I then turned on USB debugging in developer settings and did adb reboot fastboot it brought me to kind of a weird fastboot but I verified I was in fastboot with fastboot devices I reissued the fastboot flash system lineage-17.1-20210321.img and it did successfully flash it. I haven’t tried flashing lineage-18 yet, I saw your message and wanted to let you know my results.

Ok lineage-18 seems to have installed fine too, but again, you need to get to that specific incarnation of fastboot by using adb reboot fastboot. Since I had lineage-17 installed, I enabled advanced reboot and used the bootloader option and that brought me to fastboot verified by fastboot devices and again flashing failed with:

$ fastboot flash system ./lineage-18.1-20210317-UNOFFICIAL-treble_arm64_bvS.img
Sending sparse 'system' 1/19 (131068 KB)           OKAY [  4.456s]
Writing 'system'                                   FAILED (remote: 'This partition doesn't exist')
fastboot: error: Command failed

but rebooting into the OS, enabling usb debugging and issuing adb reboot fastboot it brings me to an “android fastboot” UI that can be navigated with volume keys, much like the stock android recovery system. Also, some where in the mix I think TWRP was wiped, if I use advanced reboot to reboot recovery I get the stock android recovery, similarly I get sock android recovery if I boot in using vol up on boot.

Edit: I think this bit about fastbootd explains the differences between the different ways to get access to the system partition: https://source.android.com/devices/bootloader/fastbootd

I was able to flash Havoc-OS 3.12 and Lineage 17.1 using this method:

  1. Reset the device with SPflash (linux version works well)
  2. Enter fastboot using steps 3 to 7 of the procedure described in the first message of this topic
  3. Run fastboot flash using the last version of platform-tools

So fastboot mode integrated in TWRP and entering fastboot mode directly via the first menu doesn’t work. You have to enter the original recovery mode, then enter fastboot mode.

Curious, did you manage to get the device to boot using a magisk patched boot image? I’ve got this rom running now which has builtin su, but I can’t get anything to actually boot a magisk patched boot.img, it just drops me to fastboot, where if I flash the original boot.img it will boot fine into whatever OS.

Initially I played with TWRP and Magisk (sorry for omitted this detail).

After the full reset, it works well with Lineage 17.
Now I’m trying to install Linage 18 (with the correct fastboot mode):

./fastboot flash system lineage-18.1-20210317-UNOFFICIAL-treble_arm64_bvS.img
Resizing 'system'  FAILED (remote: 'Not enough space to resize partition')

How can I resize the system partition (for newbie like me please) ?

Some other members were saying they just deleted the logical product partition. I haven’t tried it yet, but fastbootd (see link above to google’s docs on it) it seems to have a command like this for resize:

resize-logical-partition <partition> <size> 	Resizes the logical partition to the new size without changing its contents. Fails if not enough space is available to perform the resize.

I’m thinking if product can just be resized using this, then when you flash system it will just auto-resize to the appropriate size. You could also just delete product like suggested above though, I did it can it seems like things still run ok, not totally sure what data is stored there.

I was able to flash lineage 18 after:

fastboot delete-logical-partition product

“delete-logical-partition” is not documented in fastboot --help, but it works

Thanks @mastershake and @anonimal !

Anyone have trouble with speakerphone? Mine just is an immediate feedback loop. I just applied the headphone jack fix, no difference there (and was present prior) with regards to speakerphone, headphone jack works great though.

Note: To apply the headphone jack fix, I couldn’t get it to work just be editing prop.default, I had to use the following, I’m not sure where it stuck that prop config for persistence though.

:/data/data # getprop persist.sys.overlay.devinputjack
false
:/data/data # setprop persist.sys.overlay.devinputjack true                    
:/data/data # getprop persist.sys.overlay.devinputjack
true
1 Like

I was also able to flash lineage 18 after deleting product. I gather the product partition really doesn’t apply to GSIs? I am still trying to fully wrap my head around the concept of a GSI.

Two things to check:

  1. Try a different phone/dialer app like Simple Phone.
  2. Check phh gsi github issues (or google) to see if similar issue is being reported on latest builds.

Thanks for the suggestions! I did look on the phh github issues but didn’t see anything, but I might have the wrong search terms, there is a lot of activity over there. I just tried out Simple dialer and it seemed to have the same issues with speakerphone, when turned on it just becomes a feedback loop.

Could you try a different gsi maybe Android 10, 11.