yashsingh1/xdaforums huggingface dataset:
[Moto G Power (2021)] thebestofall007:
I don't think it can write to the "system" partition, if that has anything to do with it.
[Moto G Power (2021)] thebestofall007:
What's funny is that I was able to flash a magisk patched boot image file to the boot partition to root my phone with no problem. So it can't be a locked bootloader. I don't know...
[Moto G Power (2021)] sd_shadow:
Does your device use fastbootd ?

Check with

fastboot getvar is-userspace
[Moto G Power (2021)] thebestofall007:
Yes it does use fastbootd actually. I can boot to fastbootd from the recovery and it says fastbootd on top of the screen when I boot to it. I can flash files in both fastbootd and bootloader modes, HOWEVER, I get different errors with each one when I flash the GSI image. When I flash with fastbootd, I get the terminal output I posted earlier, but in bootloader mode I get "(bootloader) Preflash validation failed".
[Moto G Power (2021)] triggerlord:
You know it might be comparing your GSI signature to the stock ROM. You might have to erase system first. Worst comes to worst you can just use the Lenovo Smart Assistant to flash the stock ROM back.
[Moto G Power (2021)] thebestofall007:
I erased system with fastboot erase system. Same errors unfortunately. I'm wondering if the system is part of the "super" partition and fastboot cannot write to it. I was also wondering if I can do fastboot within twrp, which CAN write to system.
[Moto G Power (2021)] thebestofall007:
I found a little info on the android development site that details what might be happening. It has to do with the writing to dynamic partitions giving an error. Here it is.
[Moto G Power (2021)] triggerlord:
TWRP can natively flash GSIs. You just have to change the image type from flashable zip to img.

I wouldn't recommend using the force argument.. That might change the logical partition to a physical one and the LSA might fail to flash the stock ROM. Worst case that might brick it.
[Moto G Power (2021)] thebestofall007:
GOOD NEWS! I FINALLY GOT IT TO BOOT THE GSI.

I had to initially update my ADB/fastboot drivers on my linux mint system (the one I'm flashing with) because the one that comes from the repositories is older than dinosaurs and doesn't recognize the --force option:

wget https://dl.google.com/android/repository/platform-tools-latest-linux.zip
unzip \platform-tools-latest-linux.zip
sudo cp platform-tools/adb /usr/bin/adb
sudo cp platform-tools/fastboot /usr/bin/fastboot

Next I had to wipe my userdata like triggerlord said, as that did cause me problems the first time. So I wiped userdata with

fastboot erase userdata

I then flashed with the force argument. Here is the output:

sudo fastboot --force flash system system-roar-arm64-ab-vanilla.img

Resizing 'system_a' OKAY [ 0.008s]

Sending sparse 'system_a' 1/4 (458752 KB) OKAY [ 20.873s]

Writing 'system_a' OKAY [ 2.666s]

Sending sparse 'system_a' 2/4 (458752 KB) OKAY [ 20.548s]

Writing 'system_a' OKAY [ 2.665s]

Sending sparse 'system_a' 3/4 (458752 KB) OKAY [ 20.779s]

Writing 'system_a' OKAY [ 2.581s]

Sending sparse 'system_a' 4/4 (161956 KB) OKAY [ 7.270s]

Writing 'system_a' OKAY [ 1.246s]

Finished. Total time: 78.651s

yes, I agree with you. I was able to use LMSA to restore my phone thank goodness and it didn't hurt it.

For some reason, I wasn't able to flash the image with TWRP, as the flash didn't finish, and I got no error message either, strangely, and the image wouldn't boot.

The main problem with this vanilla image is that the mobile/cell network doesn't work and has wifi-only networking. It was fun trying it out, though! Does anyone know one that does work with cell network?
[Moto G Power (2021)] triggerlord:
Phh's GSI is probably the best supported GSI. If that doesn't work nothing will. That said it's possible to fix within the booted OS. What carrier do you have? Verizon (for example) needs an extra APK installed to connect to the network.
[Moto G Power (2021)] thebestofall007:
I use Verizon.
[Moto G Power (2021)] triggerlord:
Was it completely broken or was it detecting the cell signal but just not connecting? If it's the later then this is a common issue. Verizon is broken on most (all?) GSIs out of the box. You need to install the Verizon authentication APK that comes with the stock ROM. There's more information how to do this in the treble ROMs section on XDA.
[Moto G Power (2021)] thebestofall007:
There was no signal meter in the home screen and the mobile network option in the network & internet menu to connect to a cell network was grayed out.

I would like to boot this rom again but I need a good way to back up my stock so I don't have to keep flashing with LMSA and starting over (it's getting old). which partitions do I need to back up to keep my apps and settings?
[Moto G Power (2021)] NinjaPerv:
If you dont mind me asking, where did you find a working twrp? Also, wondering if flashing the radio.img from the stock firmware would fix the no service issue. Or would that f**k things up?

Also, for backing up your stock rom you could try this magisk module...

Migrator
[Moto G Power (2021)] Dynakarp:
Cellular was working for me on Boost Mobile out of the box with the Pixel Experience GSI, SMS wasn't working until I went to "Phh Treble Settings" in the Settings app, "IMS features", "Install IMS APK for Qualcom vendor", "Create IMS APN", and checked "Request IMS Network" and "Force the presence of 4G Calling", and rebooted several times after letting the phone sit for a minute in between reboots, then it finally started working. So far, the GSI is working almost perfectly fine besides that, the only other issue I've run into is the camera cut out not being supported, but it looks like it may be fixable with this, so I'll give that a shot at some point.
[Moto G Power (2021)] thebestofall007:
https://xdaforums.com/t/working-twrp-but-very-unofficial-but-very-useful.4313665/

It would be nice to get touch working, as I have to use a mouse. I might try flashing the radio.img. I'm wondering if that is overwritten when I flash the GSI.

I'll definitely try the magisk migrator next time around. I've tried the TWRP I put in the link to back up my system, but it gives an error when it deals with the "super" partition, which has my userdata.
[Moto G Power (2021)] Dynakarp:
It looks like phone calls don't work unless the device is using 3G instead of LTE, anyone know if there's a way that can be fixed?
[Moto G Power (2021)] NinjaPerv:
Have you tried going into the dialer and dialing *#*#4636#*#* then select 'Phone Information' and setting the preferred network type? Worth a shot.
[Moto G Power (2021)] triggerlord:
The GSI should only touch system.
[Moto G Power (2021)] thebestofall007:
New observations:

I flashed the image again, but this time I didn't need to use the "--force" argument to make things work. I wonder if you have to do that the first time only, and then on the flash works without force?

I also noticed the mobile network now works, but that's after I changed to cricket wireless. I was having too much problems with the service when I was on Verizon.
[Moto G Power (2021)] moorer:
I am having an issue with installing any GSI ROM. I've tried PHH's ROM and also gave PixelExperience a shot. Restored from LSA, tried again, always the same error.

Moore@LAPTOP-JU2JP1SF C:\Users\Moore\Downloads\Moto G Power 2021\GSI ROMS
# fastboot flash system system-roar-arm64-ab-gapps.img
Resizing 'system_a' FAILED (remote: '')
fastboot: error: Command failed

I always cleared userdata before anything else. I even tried erasing the system too, which I had to use LSA to restore afterwards. I have also received "Not enough space to resize partition". I am using the latest adb versions.

Any ideas?
[Moto G Power (2021)] thebestofall007:
Were you in fastbootd mode or bootloader mode when you flashed the image? I had to have my phone in fastbootd mode for the image to flash, otherwise I got an error message similar to what you got.
[Moto G Power (2021)] moorer:
I realized most times I tried I was in normal fastboot, not fastbootd. The partition size error I got before was while in fastbootd. So I am unsure at this point. Maybe I'll have to restore again and try with just fastbootd mode right off the bat. Read that you can get into it with fastboot reboot fastboot, or adb reboot fastboot. I'll give it one more shot.
[Moto G Power (2021)] moorer:
Tried while in fastbootd mode. This is always the error now.

Moore@LAPTOP-JU2JP1SF C:\Users\Moore\Downloads\Moto G Power 2021\GSI ROMS
# fastboot flash system system-roar-arm64-ab-gapps.img
Resizing 'system_a' FAILED (remote: 'Not enough space to resize partition')
fastboot: error: Command failed

--force gives the same error as above.
[Moto G Power (2021)] moorer:
OK finally figured out a solution. Read this post https://xdaforums.com/t/guide-unbrick-or-restore-to-oos-using-only-fastboot.4289013/. I had to delete the system partitions and recreate them, then flashing it with fastboot flash system system-roar-arm64-ab-gapps.img worked!

fastboot delete-logical-partition system_a
fastboot delete-logical-partition system_b

fastboot create-logical-partition system_a 100000
fastboot create-logical-partition system_b 100000

UPDATE: Is there a way to install a playstore certificate permanently or is this normal for using the gapps build?
[Moto G Power (2021)] triggerlord:
You have to add the unauthorized device in your Google account.
[Moto G Power (2021)] moorer:
Well I tried but I can not login to my google account at all, soI am unsure how it's going to notice my device is valid. I added my Android ID.
[Moto G Power (2021)] triggerlord:
Look around in the PHH settings. There may be a way to fix it in there if it's a known bug.
[Moto G Power (2021)] moorer:
No options to fix it in PHH Settings however, I just did an account backup after being able to sign into my google account from the normal Settings. After it was finished, I was able to open up the Play store.
[Moto G Power (2021)] triggerlord:
So does everything work but the camera? If we could find someone to fix it with a custom vendor overlay we'd have a complete custom rom.
[Moto G Power (2021)] thebestofall007:
The main camera works on mine. I'm not sure about the other cameras. FM doesn't work.
[Moto G Power (2021)] triggerlord:
Ah I thought you said the camera didn't work. Was it the selfie cam?
[Moto G Power (2021)] thebestofall007:
I never said that. I said I had issues with the mobile network when I was under Verizon. The main cam works for sure for me, but I'm not sure about the other cams.
[Moto G Power (2021)] triggerlord:
Must have been someone else who said that. My bad. I'm planning on trying this out myself and writing a detailed list of what does and doesn't work.
[Moto G Power (2021)] thebestofall007:
I just tested the selfie cam and can confirm that it works.
[Moto G Power (2021)] triggerlord:
Cool I'll have to install this myself tomorrow. I'm going with the FOSS (floss is a joke) variant. I prefer using an open source OS.
[Moto G Power (2021)] thebestofall007:
I would like to know how to install magisk with this rom, as it is a pain to do with the stock root method. I tried the "securize" option to remove root, but that resulted in the phone not booting past the motorola logo.
[Moto G Power (2021)] triggerlord:
Unfortunately you'd have to do it the same way because we don't have a functional TWRP. Patch boot and flash it.
[Moto G Power (2021)] thebestofall007:
I was able to patch the boot, but the app complains that the magisk version is unsupported and then pretends that it's not installed, as well as not letting me access the modules. It does the same with the direct install method, too. I need magisk to install AdAway.
[Moto G Power (2021)] triggerlord:
I haven't got to try the GSI yet but the FLOSS variant comes pre-rooted.
[Moto G Power (2021)] thebestofall007:
So does the GAPPS variant.
[Moto G Power (2021)] triggerlord:
Ah, ok. Install the PHH superuser app off the Play Store. The FLOSS variant comes with it pre-installed.
[Moto G Power (2021)] triggerlord:
Trying to install it now. Will report back.
[Moto G Power (2021)] triggerlord:
OK mine is saying;

"Resizing 'system_a' FAILED (remote: 'Not enough space to resize partition')

fastboot: error: Command failed"

Lol.
[Moto G Power (2021)] thebestofall007:
I got the same error. I had to run these commands to delete and resize the system partition to fit the image:

fastboot delete-logical-partition system_a
fastboot delete-logical-partition system_b
fastboot create-logical-partition system_a 100000
fastboot create-logical-partition system_b 100000
[Moto G Power (2021)] triggerlord:
Yep that did it. Anyone know if there's an option or command to set the notch offset? I know you can do it but I don't know how.
[Moto G Power (2021)] thebestofall007:
Same with the Gapps variant.
[Moto G Power (2021)] thebestofall007:
I found a lineage OS GSI that is phh-treble based here and it works well with this phone. I am trying it out as I type. I was able to fastboot flash a magisk boot image on it no problem to root it so I could run AdAway.

The main problem with this ROM so far is that it does not include Gapps out of the box. How do I get Gapps on this one? I used the TWRP from the XDA thread here, to try out several flavors of Gapps (opengapps, nikgapps, bitgapps, etc.), but the flash fails due to the system partition being read-only or not having enough space on it. Furthermore, this particular TWRP doesn't offer to allow modifications to the system partition.
[Moto G Power (2021)] thebestofall007:
I had to flash my phone back to stock, as I am able to run adaway and magisk with it no problem, as well as have my google apps. I'd keep the GSI ROMs on my phone if I was able to run those two programs and use magisk as my rooting method, and run Gapps at the same time. So far I can't do that with the ones I found. They're a different breed for sure compared to a proper ROM.
[Moto G Power (2021)] thebestofall007:
Update, I found a ROM that has magisk as the root manager and gapps included. It is android 11 and also a lineage OS ROM, and you can download it here: https://gigenet.dl.sourceforge.net/project/treblerom/LiR/2021.09.15/lir-v313-210915-arm64-bgZ.img.xz. It works well so far.
[Moto G Power (2021)] Mr nerd:
How are you flashing these roms?..can one of you guys link me to the kernel maybe I can help with the Twrp issue as well I just can't get it to build since I'm having issues with the environment I'm running
[Moto G Power (2021)] thebestofall007:
I use fastboot to flash roms with the following command when the phone is in fastbootd mode:

fastboot flash system (your image here)
[Moto G Power (2021)] Mr nerd:
Thank you
[Moto G Power (2021)] Mkami:
Hey there, how were you able to sucessfully flash it into your moto g? I tried but i keep getting this..

Program Files (x86)\Minimal ADB and Fastboot>fastboot flash system lir-v313-210915-arm64-bgZ.img

target reported max download size of 804474880 bytes

Invalid sparse file format at header magic

error: write_sparse_skip_chunk: don't care size 95372660 is not a multiple of the block size 4096

sending sparse 'system_b' 1/2 (785616 KB)...

error: write_sparse_skip_chunk: don't care size 95372660 is not a multiple of the block size 4096

error: write_sparse_skip_chunk: don't care size 95372660 is not a multiple of the block size 4096

OKAY [ 19.475s]

writing 'system_b' 1/2...

(bootloader) Preflash validation failed

FAILED (remote failure)

finished. total time: 19.589s
[Moto G Power (2021)] Mkami:
Hello gents do any of you guys know how I can fastboot a rom or gsi? when I try I keep getting a failed message or this message here:

target reported max download size of 804474880 bytes

Invalid sparse file format at header magic

error: write_sparse_skip_chunk: don't care size 95372660 is not a multiple of the block size 4096

sending sparse 'system_b' 1/2 (785616 KB)...

error: write_sparse_skip_chunk: don't care size 95372660 is not a multiple of the block size 4096

error: write_sparse_skip_chunk: don't care size 95372660 is not a multiple of the block size 4096

OKAY [ 19.475s]

writing 'system_b' 1/2...

(bootloader) Preflash validation failed

FAILED (remote failure)

finished. total time: 19.589s

all the help I can get would be greatly appreciated it!
[Moto G Power (2021)] thebestofall007:
I got the "Invalid sparse file format at header magic" error as well, but it wasn't detrimental to the flash, however, I had to delete and recreate my system partition when I first flashed ROMs with these commands:

fastboot delete-logical-partition system_a
fastboot delete-logical-partition system_b
fastboot create-logical-partition system_a 100000
fastboot create-logical-partition system_b 100000

Then erase userdata:

fastboot erase userdata

Also, make sure your phone is in fastbootd mode, not bootloader mode when you flash.
[Moto G Power (2021)] Mkami:
Awesome thanks! I'll give it a try now, are these the steps?
[Moto G Power (2021)] Mkami:
I get this now

Program Files (x86)\Minimal ADB and Fastboot>fastboot delete-logical-partition system_a

fastboot: usage: unknown command delete-logical-partition

Program Files (x86)\Minimal ADB and Fastboot>fastboot delete-logical-partition system_b

fastboot: usage: unknown command delete-logical-partition

Program Files (x86)\Minimal ADB and Fastboot>fastboot create-logical-partition system_a 100000

fastboot: usage: unknown command create-logical-partition

Program Files (x86)\Minimal ADB and Fastboot>fastboot create-logical-partition system_b 100000

fastboot: usage: unknown command create-logical-partition
[Moto G Power (2021)] thebestofall007:
You may need to update your adb/fastboot directly from google here (assuming you are using windows, I use linux mint).

It looks like you may be using an older version of adb/fastboot that doesn't recognize those commands. I had to do that as well because the version I had was older than dinosaurs and didn't recognize the "--force" argument.
[Moto G Power (2021)] Mkami:
Hey thanks, so before I proceed what are the steps to fastbooting that GSI rom you recommended, thanks!
[Moto G Power (2021)] Mkami:
I get this message now

C:\Program Files\platform-tools>fastboot delete-logical-partition system_a

Deleting 'system_a' FAILED (remote: '')

fastboot: error: Command failed

C:\Program Files\platform-tools>fastboot delete-logical-partition system_b

Deleting 'system_b' FAILED (remote: '')

fastboot: error: Command failed

C:\Program Files\platform-tools>fastboot create-logical-partition system_a 100000

Creating 'system_a' FAILED (remote: '')

fastboot: error: Command failed

C:\Program Files\platform-tools>fastboot create-logical-partition system_b 100000
[Moto G Power (2021)] thebestofall007:
1. update your adb/fastboot with the google link I showed.

2. enable usb debugging in System>Developer Options>USB Debugging.

3. connect your phone to your computer with USB cable. when prompt comes up on phone, allow the debugging.

4. issue command

adb reboot recovery

to reboot phone to recovery.

5. when the dead android robot shows, hold down power and press vol up to get to menu. select enter fastboot (third option down).

6. when in fastboot mode, enter the commands to delete and recreate the system partition.

fastboot delete-logical-partition system_a
fastboot delete-logical-partition system_b
fastboot create-logical-partition system_a 100000
fastboot create-logical-partition system_b 100000

7. flash the image with this command:

fastboot flash system <name of image>

8. clear userdata with

fastboot erase userdata

9. enter command

fastboot reboot

to reboot the phone.
[Moto G Power (2021)] thebestofall007:
I forgot to ask, is your bootloader unlocked?
[Moto G Power (2021)] Mkami:
Hey! thanks so much for your guided steps so everything worked but now I get a pop up that says "the disc image file is corrupted". Yes my phone is bootloader unlocked
[Moto G Power (2021)] Mkami:
I am trying to use this image after extracting the image from the zip file. When I try to fastboot it to the phone I get that disc corrupted message
[Moto G Power (2021)] thebestofall007:
Try downloading it again. The image may very well have been corrupted in the download, and you may need to do a checksum to check integrity and make sure it's not corrupt. The md5 checksum of this file from the site is e31577a6b6cbced5aad3fbc2b852de72.
[Moto G Power (2021)] Mkami:
Hey I did a checksum and it seems they do not match, how may I fix this? Thanks!
[Moto G Power (2021)] thebestofall007:
Try downloading it again and then running the checksum again to make sure the file doesn't get corrupted. I've had network problems mess my files up before.
[Moto G Power (2021)] Mkami:
So after trying multiple downloads and doing md5 checksum it seems that I keep getting unmatched. :(
[Moto G Power (2021)] Mkami:
Thank you thank you thank you so much! After hours of trying and failing I have finally got LineageOS gsi working on my phone :D Thanks again for your help and patience. I appreciate it!

Solution. Go to extractions settings and tick mark "keep broken parts" allowing the full checksum to come out as matched. Everything seems to be good right now. :)
[Moto G Power (2021)] thebestofall007:
Good to see you got it working! You're welcome.
[Moto G Power (2021)] NinjaPerv:
Borneo Kernel Source
[Moto G Power (2021)] Mr nerd:
Thank you kind sir.
[Moto G Power (2021)] triggerlord:
Sorry I've been gone for a while. Seems like MMS/SMS and headphone jack detection is broken. Everything else is working.
[Moto G Power (2021)] thebestofall007:
Same goes for the LineageOS GSI I'm using that is also based on PHH's work.

I got a question: Would you know how to determine if this device tree would work for this phone?

https://github.com/MrNerd/MotoGPower_2020_DT

I know it says 2020 on it, but I looked through some of it and it points to Borneo. Mr. Nerd told me he used a python script to generate this tree.

Update: I just got word that motorola is releasing the device tree and kernel tree:

https://github.com/MotorolaMobilityLLC/kernel-msm/issues/374

I'm trying to pitch together the necessary source code (kernel and device tree files) to get the ball rolling on a proper custom ROM (NOT a GSI) for this phone (especially LineageOS).
[Moto G Power (2021)] triggerlord:
Honestly it would probably be easier to fix these two things in the GSI and set the default hole punch offset. Rather than try to create a device tree and port the ROM from scratch.
[Moto G Power (2021)] thebestofall007:
Oh, OK.
[Moto G Power (2021)] triggerlord:
Not saying you shouldn't try if you want to but it's more work.
[Moto G Power (2021)] thebestofall007:
I agree, but it's good to have a dedicated ROM alternative in the end.

Have you had any issues with Bluetooth? The phone connects fine, but I can't get Bluetooth audio to work. How do I fix this? MMS/SMS seems to be working for me. I'm using the ROM in this thread: https://xdaforums.com/t/lir-project-rom-los-18-1-based-on.4328019/ which is based on PHH's work.
[Moto G Power (2021)] triggerlord:
Bluetooth audio was working for me.
[Moto G Power (2021)] triggerlord:
Re-locked my bootloader for now. I'll re-unlock it if there are any future developments.
[Moto G Power (2021)] arkansawdave74:
Sir, I think that IS the device tree for this phone. I bet it had a late release so they had to rename it 2021. That would also explain why a 2021 came with Android 10. That tree is even called motorola_borneo. This phone was planned to be the Moto G Power 2020 but didn't make it in time is my guess. I did a github search for borneo...I wonder why it didn't pull that up....

EDIT: Okay now I see it's Mr. Nerd's repo. Maybe 2020 was a typo or something, but I do bet it's the device tree for the 2021. No other directory would be called motorola_borneo and Mr. Nerd DID say he had generated a device tree....
[Moto G Power (2021)] kevinchristopherson:
NEED ASSISTANCE ... I have the moto g stylus 2021.. I am able to flash and have everything running just no data no phone calls nor messages .. it sees the sim and knows the number.. I'm thinking there's something very minor to do but I can't find an answer.. any suggestions would be appreciated. thank you all.