Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for Motorola Moto G8 Power #202

Draft
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

MagicLike
Copy link
Member

Added support for the Motorola Moto G8 Power.

@moan0s please test the config.

resolves #193

@MagicLike MagicLike mentioned this pull request Jul 30, 2023
2 tasks
@moan0s
Copy link

moan0s commented Jul 30, 2023

I am so sorry but I totally misunderstood/forgot the process. I now understand that I would need

  • the lineagOS image (which I have an unoffical version as linked in the issue at least)
  • but also the a TWRP build which does not seem to exist for this device https://twrp.me/Devices/Motorola/

So unless I misunderstood something again I think I wasted your time. I am very very sorry

@moan0s
Copy link

moan0s commented Jul 30, 2023

Okay I think I found a fitting TWRP image 🥳 Currently I am at Boot custom recovery which takes worryingly long 😱

@moan0s
Copy link

moan0s commented Jul 31, 2023

Well it's stuck at adb wait-for-sideload.

OpenAndroidInstaller log:

>$adb shell twrp sideload
>$adb wait-for-sideload

Phone output

MTP enabled
command is: 'sideload' and there is no value
starting ADB sidload feature...

I waited for 7 hours for the command to complete

@moan0s
Copy link

moan0s commented Jul 31, 2023

And maybe that is relevant too: Before that got a lot of errors in Updating partitioning details which seems to be executed two times on the phone (with the same errors)

Updating partitioning details
Error opening /data/misc/recovery (Operation not permitted)
Error opening /data/misc/bluedroid (Operation not permitted)
...
Updating partitioning details...
Error opening /data/misc/recovery (Operation not permitted)
Error opening /data/misc/bluedroid (Operation not permitted)
...

@tsterbak
Copy link
Member

Hey, thank you for trying the config so fast! 🙂 We will figure it out :)

I guess there is an issue in the config and the devices doesn't need the adb_twrp_copy_partitions steps. @MagicLike can you check? I'm not even sure it is a A/B-Partitioned device.

Here they just flash TWRP: https://www.getdroidtips.com/twrp-recovery-moto-g8-power/
And then flash LOS: https://www.getdroidtips.com/lineage-os-19-1-moto-g8-power/

@moan0s
Copy link

moan0s commented Jul 31, 2023

Can I somehow help by providing partition information?
Checking the backup option in TWRP allows me to select the following partitions

Boot (64MB)
DTBO (23MB)
Super (8288MB)
Data (excl. storge) (1MB)
Recovery (64MB)
Persist (1MB)
Bluetooth (4MB)
DSP (32MB)
EFS (8MB)
FSG (24MB)
LOGO (32MB)
Super (System, Product, Vendor) (8288MB)

And then flash LOS: https://www.getdroidtips.com/lineage-os-19-1-moto-g8-power/

The device here is called amogus I thnik this is a different device? Or should I be able to use that as well?
Here the Moto G8 Power is referred to as sofiar:https://www.xda-developers.com/motorola-moto-g8-power-twrp-omnirom/

@MagicLike
Copy link
Member Author

MagicLike commented Jul 31, 2023

Can I somehow help by providing partition information?
Checking the backup option in TWRP allows me to select the following partitions

Boot (64MB)
DTBO (23MB)
Super (8288MB)
Data (excl. storge) (1MB)
Recovery (64MB)
Persist (1MB)
Bluetooth (4MB)
DSP (32MB)
EFS (8MB)
FSG (24MB)
LOGO (32MB)
Super (System, Product, Vendor) (8288MB)

And then flash LOS: https://www.getdroidtips.com/lineage-os-19-1-moto-g8-power/

The device here is called amogus I thnik this is a different device? Or should I be able to use that as well?
Here the Moto G8 Power is referred to as sofiar:https://www.xda-developers.com/motorola-moto-g8-power-twrp-omnirom/

Hmmmm - @moan0s Can you try and install this app and send a screenshot here? (It can show us if your device supports a/b partitioning and is a bit easier, than fiddeling with the command line)

@moan0s
Copy link

moan0s commented Jul 31, 2023

No sorry, that app is not available for A11.

@MagicLike
Copy link
Member Author

No sorry, that app is not available for A11.

Weird, I can install it on Android 13...
Ok, then onto the command line.

What OS are you using on your PC?

@MagicLike
Copy link
Member Author

At first you will need to download the Android Platform Tools. I suppose USB-Debugging is already enabled?

Then navigate into the unpacked folder of the platform tools on your pc and open a command line in this folder and run the following commands:
./adb reboot bootloader
After your device rebooted into fastboot mode:
fastboot getvar all

If something like (bootloader) current-slot appears, with the value being either a or b your device is a/b partitioned. If not - it is not.

@moan0s
Copy link

moan0s commented Jul 31, 2023

What OS are you using on your PC?

Endeavour OS (Arch based linux)

USB-Debugging is already enabled?

Yes :)

Here is the relevant output (AFAIK what relevant is):

 fastboot getvar all
... 
(bootloader) current-slot: b
(bootloader) running-bl-slot: _b/_b
(bootloader) running-boot-lun: 0
(bootloader) slot-count: 2
(bootloader) slot-successful:_a: yes
(bootloader) slot-successful:_b: yes
(bootloader) slot-unbootable:_a: no
(bootloader) slot-unbootable:_b: no
(bootloader) slot-retry-count:_a: 6
(bootloader) slot-retry-count:_b: 6
(bootloader) logical-block-size: 0x200
(bootloader) erase-block-size: 0x200
...

So it seems the device is a/b partitioned?

@MagicLike
Copy link
Member Author

What OS are you using on your PC?

Endeavour OS (Arch based linux)

USB-Debugging is already enabled?

Yes :)

Here is the relevant output (AFAIK what relevant is):

 fastboot getvar all
... 
(bootloader) current-slot: b
(bootloader) running-bl-slot: _b/_b
(bootloader) running-boot-lun: 0
(bootloader) slot-count: 2
(bootloader) slot-successful:_a: yes
(bootloader) slot-successful:_b: yes
(bootloader) slot-unbootable:_a: no
(bootloader) slot-unbootable:_b: no
(bootloader) slot-retry-count:_a: 6
(bootloader) slot-retry-count:_b: 6
(bootloader) logical-block-size: 0x200
(bootloader) erase-block-size: 0x200
...

So it seems the device is a/b partitioned?

It seems like... But why did it fail? 🤔
Is it also possible for you to upload the full openandroidinstaller.log?

@moan0s
Copy link

moan0s commented Jul 31, 2023

This is the full log: https://pastebin.com/rPRzxZ0s

@MagicLike
Copy link
Member Author

Interestingly - I can't find anything suspicious in the log... @tsterbak Can you also take a look at this?

@MagicLike
Copy link
Member Author

@moan0s Would it be possible for you to start over again, but flip the switch "Bootloader is already unlocked" at the beginning? It seems like you tried to unlock it multiple times, although it was already unlocked. Maybe the log is a bit clearer then...

@moan0s
Copy link

moan0s commented Jul 31, 2023

Yes I did that after the initial double-unlocking problem (otherwise the installer would not have continued).

Here is the log of a "clean" attempt: https://pastebin.com/eaqGSeJX

@MagicLike
Copy link
Member Author

Yes I did that after the initial double-unlocking problem (otherwise the installer would not have continued).

Here is the log of a "clean" attempt: https://pastebin.com/eaqGSeJX

Thanks! Just for my understanding: Everything works up until adb sideload should be activated, right?

@tsterbak
Copy link
Member

Interestingly - I can't find anything suspicious in the log... @tsterbak Can you also take a look at this?

So you can boot into TWRP, but then sideloading is not activated or not recognized by the Installer, right?

Can you try to activate sideloading in TWRP the usual way, by going to "Advanced", then "ADB sideload" and then slide to start sideload. Is this recognized by the installer?

@moan0s
Copy link

moan0s commented Jul 31, 2023

So you can boot into TWRP, but then sideloading is not activated or not recognized by the Installer, right?

It seems that way yes. This was what it shows me:

OpenAndroidInstaller log:

>$adb shell twrp sideload
>$adb wait-for-sideload

Phone output

MTP enabled
command is: 'sideload' and there is no value
starting ADB sidload feature...

Regarding

Can you try to activate sideloading in TWRP the usual way, by going to "Advanced", then "ADB sideload" and then slide to start sideload. Is this recognized by the installer?

Yes that seemed to work! I activated sideload, then pressed continue in the installer. The next steps worked and now I am again stuck at waiting for sideload at the step Install OS

@moan0s
Copy link

moan0s commented Jul 31, 2023

There the trick does not work anymore as the first command is >$adb wait-for-recovery which only starts when I cancel sideloading

@tsterbak
Copy link
Member

There the trick does not work anymore as the first command is >$adb wait-for-recovery which only starts when I cancel sideloading

Hm, I think I saw a similar issue before with Motorola devices...
@SirRGB have you seen this issue before and what was a solution there? It seems like TWRP scripting doesn't activate sideloading.

@tsterbak
Copy link
Member

tsterbak commented Jul 31, 2023

Yes that seemed to work! I activated sideload, then pressed continue in the installer. The next steps worked and now I am again stuck at waiting for sideload at the step Install OS

This is to copy_partitions step, right? Where you got these errors?

Error opening /data/misc/recovery (Operation not permitted)
Error opening /data/misc/bluedroid (Operation not permitted)
...
Updating partitioning details...
Error opening /data/misc/recovery (Operation not permitted)
Error opening /data/misc/bluedroid (Operation not permitted)

I'm not sure if this step should even be in the config. At least I can find no information if it should be there for this device.

@MagicLike
Copy link
Member Author

MagicLike commented Jul 31, 2023

Yes that seemed to work! I activated sideload, then pressed continue in the installer. The next steps worked and now I am again stuck at waiting for sideload at the step Install OS

This is to copy_partitions step, right? Where you got these errors?

Error opening /data/misc/recovery (Operation not permitted)
Error opening /data/misc/bluedroid (Operation not permitted)
...
Updating partitioning details...
Error opening /data/misc/recovery (Operation not permitted)
Error opening /data/misc/bluedroid (Operation not permitted)

I'm not sure if this step should even be in the config. At least I can find no information if it should be there for this device.

I can remove it - I just copied from the g7 and customised it for the device...
Maybe @SirRGB can help indeed, as I have 0 xp with Motorola devices

@SirRGB
Copy link
Contributor

SirRGB commented Jul 31, 2023

Well I just didnt face that error, might be cuz I have moto legacy devices without a/b dynamic or whatever stuff...

@MagicLike MagicLike added help wanted Extra attention is needed device Request to add or improve a specific device. labels Aug 30, 2023
@MagicLike MagicLike linked an issue Sep 9, 2023 that may be closed by this pull request
2 tasks
@MagicLike MagicLike added the needs testing Device support was added, but it still needs testing label Oct 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
device Request to add or improve a specific device. hacktoberfest help wanted Extra attention is needed needs testing Device support was added, but it still needs testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for sofiar
4 participants