ubports / halium_bootable_recovery

The Ubuntu Touch recovery for Halium ports
8 stars 10 forks source link

Prevent bricking devices when factory resetting in recovery #19

Open amartinz opened 3 years ago

amartinz commented 3 years ago

The factory reset option of the recovery executes an "Android factory reset", which wipes the whole data partition.

Depending on device, this may erase the whole ubuntu touch installation, as it is possible to push rootfs, vendor etc images to userdata to run ubuntu touch.

We should wire up the "Ubuntu Touch way" of factory resetting to the GUI instead.

Flohack74 commented 3 years ago

Is this a problem of utilizing the LOS 17 recovery? This worked well so far in pre-Halium 10 devices.

amartinz commented 3 years ago

I did not test it with older Halium versions, but it bricked axolotl with H10, because system was installed in userdata and code was forced to handle every device as device, which installs system to the actual partition.

there a wipe would not matter and it just recreates data.

but on axolotl it wiped the system and vendor image files, which live on userdata and the system was bricked.

Flohack74 commented 3 years ago

Humm Android factory reset? I cannot follow, it should do this: https://github.com/ubports/halium_bootable_recovery/blob/halium-9.0/system-image-upgrader#L316 - we would need to add vendor.img there in the exclusion list but the rest should be fine. We should never format data actually...

amartinz commented 3 years ago

This is from system.

But if you boot the recovery itself and select "Factory Reset", it executes the android routine instead of our system-image-upgrader.

Flohack74 commented 3 years ago

@amartinz yes our selections in recovery are stupid since ever. I always tell people to not push any of these buttons :P also in older systems you could easily brick your phone.

amartinz commented 3 years ago

That's what this issue is about, as i also managed to brick a H10 device with doing so 😄

I can wire it up, but i first need some blockers regarding recovery and my device to get merged to even start properly working on it.