yashsingh1/xdaforums huggingface dataset:
[Motorola Edge 40 Pro  / Moto X40 (China)] ThE_MarD:
Thanks @Drasner ! I'm hoping I can get this thing compiling and maybe with some luck booting too soon heh

I pushed a few more changes and I think I'm getting close, there's still more manifest errors and I'm trying to do manifest target level 7 like on stock ROM since we launched with A13 but I'm hitting this error:

Device manifest with level 7 must not set kernel level 6

I'm hoping once I solve this that the build will complete, but we shall see... I dunno if I have to revise my kernel or what but I'll keep at this thing.

UPDATE: WOW... ok, so Motorola was putting the kernel target level at the bottom of their manifests for some reason instead of the top like everyone else... just found it lol, so I nuked it and force pushed and will try a build overnight and fingers crossed no more manifest errors!

sm8550-common: Update HALs and manifest from rtwo · moto-sm8550/android_device_motorola_sm8550-common@906bf2f

RTWO_RETAIL_13_T1TR33.43-20-15_subsidy-DEFAULT_regulatory-DEFAULT_cid50_CFC Change-Id: I4ed355079b41921066a975fb1eb427d3dc17c49a

github.com

PS, just had a father's day weekend camping trip with the family and I took a bunch of pictures and a few videos while there just in case anyone watching this thread wants to see what it can do in the Jasper National Park of Alberta, Canada. The weather was mostly cloudy so not the most ideal for snaps so it put up a good challenge for the Edge 40 Pro and it did pretty darn good! The only caveat was the videos at the Athabasca falls where I think the noise cancelling thought the Athabasca falls was background noise and kept trying to cancel it out lol... maybe the hole I drilled in the side of my case wasn't big enough and partially blocking it? Not 100% sure tbh... The video though I took when walking turned out pretty darn good since it was on an uneven dirt path and I was rotating a bunch too

The quality is compressed though as I don't want to run out of storage on my Google account

PS, the last photo was actually from my wife's Samsung Galaxy S22 Ultra while she was sitting in the passenger seat.. it was snowing between Hinton and Grande Cache today hahaha... oh Alberta, Canada...

Camping in Jasper AB Canada June 16-18 2023

88 new items added to shared album

photos.app.goo.gl

I have heard from some users and a few reviews like Joshua Vegara that Edge 40 Pro can have some focus issues on videos when upclose but tbh I haven't tried that yet... hopefully it is something they can fix in a software update as it's probably something with the autofocus calculations?
[Motorola Edge 40 Pro  / Moto X40 (China)] ThE_MarD:
Oh, I also split up the kernel enough to eventually get around GitHub's 2GB push limit on free accounts so meow the local manifest won't fail if anyone else tries it heh
[Motorola Edge 40 Pro  / Moto X40 (China)] ThE_MarD:
So it builds meow! It also boots to Lineage Recovery! no touchscreen though lol have to use buttons.

Unfortunately, it doesn't boot and the install fails with a slot switch error so I'll have to check gpt-utils maybe I didn't set that up correctly

[ 179.218536] bootcontrolhal E 01-19 00:48:57 561 561] Slot pentries for shrm not found.
[ 179.218539] bootcontrolhal E 01-19 00:48:57 561 561] set_active_boot_slot: Failed to set active slot
[ 179.218541] update_engine_sideload E 01-19 00:48:57 561 561] [ERROR:boot_control_android.cc(143)] Unable to set the active slot to slot A: Operation not permitted

That's getting closer though! I did try to manually swap slots and it looks like the flashing did work but unfortunately, it doesn't boot, it goes to a black screen for a few seconds and then reboots to the bootloader... so this is where I think Bruno and Chandu are on OP11 too, oof...

Still! This is progress! Just need to figure out some of the errors and go from there (y)

on Wednesday I go back to work... so I'm unsure how my spare time will be to work on this more but hopefully, I'll get to and from the worksite at a decent time so I can smash away at this some more and see if I can figure out what's going on
[Motorola Edge 40 Pro  / Moto X40 (China)] mxz55:
That's really hopeful, we are getting close.. thanks for the hard work!

Maybe you can upload the test ROM file so others (myself included) can help with debugging the failure to boot/slot issue?
[Motorola Edge 40 Pro  / Moto X40 (China)] ThE_MarD:
@mxz55 I fixed the bootctrl HAL issue meow, so I just need to get logs and see what's maybe holding up the boot, so I'll ask other Motorola devs if there's pstore or ramoops somewhere for me to grab

Without it booting it will be a super boring test build :LOL:🙈😭

update: I also fixed touchscreen on recovery haha yes! So that's good, meow if I could just get this darn thing booting!!! HNNNNGGGG I feel like I'm close...
[Motorola Edge 40 Pro  / Moto X40 (China)] Kkjin:
Volte 5g Network Perfect

Compatible touch sampling max!!

I'm looking forward to it!
[Motorola Edge 40 Pro  / Moto X40 (China)] ThE_MarD:
I won't be able to work on LineageOS for a bit on rtwo, work is keeping me super busy, 16 hour days. My job is a blender tender for hydraulic fracturing in the oil and gas industry (y)

Photos of course shot on Edge 40 Pro using Moto camera app
[Motorola Edge 40 Pro  / Moto X40 (China)] dekefake:
Hi everyone !

I'm currently working with Chandu and Bruno in bringing up LineageOS for the OnePlus 11 and we've been able to get USB working, and so, we have the logcat. We're currently having issues with the display HALs. As the Moto X40 and the OnePlus 11 are using the same platform, this will probably happen to the X40 too. Here is a link to my display HALs post on the OnePlus 11 thread : https://xdaforums.com/t/wip-porting-lineageos-20-to-the-oneplus-11.4551767/post-88692707

We're getting closer :)
[Motorola Edge 40 Pro  / Moto X40 (China)] ThE_MarD:
Heyyo @dekefake , that's fantastic news! The display HAL I was using was slightly different, but I'm guessing not different enough as I'm still stuck on Motorola boot logo

GitHub - moto-sm8550/android_hardware_qcom_display

Contribute to moto-sm8550/android_hardware_qcom_display development by creating an account on GitHub.

github.com

I think the only difference is I had kernel headers but still no boot

Bruno told me how to get USB to work just yesterday, so I'll have to try it on rtwo. SGCMarkus will probably get to pull logs before me though as I'm still about a week of 16 hour work days lol oof, so no spare time so far to work on rtwo...
[Motorola Edge 40 Pro  / Moto X40 (China)] ThE_MarD:
Heyyo! Epic news! SGCMarkus booted LineageOS on rtwo! He said a lot is dead so there's still lots to do though, but this is one massive step!

I'm dying of jealousy haha oof, I'm still doing 16 hour shifts until at least Sunday...
[Motorola Edge 40 Pro  / Moto X40 (China)] dekefake:
Hi,

Bruno booted the OnePlus 11 as well, very good news for Snapdragon 8 Gen 2 based devices
[Motorola Edge 40 Pro  / Moto X40 (China)] ThE_MarD:
@dekefake Great news there too! The future is looking better and better for sm8550 and 5.15 kernel devices
[Motorola Edge 40 Pro  / Moto X40 (China)] mxz55:
That's really good news.. also, something we didn't specifically state yet: The_MarD and SGCMarkus want to do dual maintainership for rtwo LineageOS, they have been working closely together. I will update OP and roadmap.

The dual maintainership route, the sponsored device will stay gifted to ThE_MarD, as he has put a lot of effort towards it and the Motorola custom ROM userbase in general.. this is my way to return the favor. Besides, it being the daily driver of/owned by both maintainers (ThE_MarD and SGCMarkus) is good for its support.
[Motorola Edge 40 Pro  / Moto X40 (China)] neatchee:
Former cyngn employee and gamedev QA veteran reporting in. I'm prepared to assist with anything you might need in the test and experimentation department :)
[Motorola Edge 40 Pro  / Moto X40 (China)] mxz55:
The latest status update is that SGCMarkus & The_MarD are ironing out some significant issues in otherwise largely functioning test builds of LineageOS, some of these include NFC not working yet, recovery not remounting partitions as writable, and something related to compatibility with network manager / dataservices (breakage depending on kernel version). Markus won't push all changes to the github repo's unless he is satisfied with the final revision of said change, and once it's in a more acceptable shape i expect we will begin to share alpha test ROM packages for any testers that know the risks as well as that it cannot be relied on for a daily driver yet.

Things seem to move along nicely especially in the last week, so i don't expect this to be something in the long run, there is a good chance we will see tester releases in the coming weeks/this month, depending of course on the developers' free time and how harsh the most significant issues will turn out to be.
[Motorola Edge 40 Pro  / Moto X40 (China)] Drasner:
I agree things are looking good, that is why I have ordered the phone today. Because of where I live it might take a month or more to arrive, so hopefully when it does I can start testing the builds, until they become stable enough that I can retire my current daily driver and use the new one instead.

Looking forward to testing the builds.
[Motorola Edge 40 Pro  / Moto X40 (China)] EthanG01:
Can’t wait until this releases, is this the official Lineage OS ROM or a ported version from non official developers? Will this be an easy setup with the flashing process through fastboot?
[Motorola Edge 40 Pro  / Moto X40 (China)] Drasner:
Others will confirm, but what usually happens is a ROM is unofficial until it has been tested enough to be made official.

The developers involved have experience porting LineageOS to other devices.
[Motorola Edge 40 Pro  / Moto X40 (China)] mxz55:
All involved developers are part of the LineageOS team (as well as being known maintainers for other devices), so don't worry about that. The goal is official but if it will be instantly so depends on how many precompiled libraries we'll have to use, and whether or not said use extends beyond the alpha testing period (more likely/hopefully A. it will turn out we got all sources we need, B. Motorola will release missing repositories soon, or C. we get someone to reverse the absolutely necessary ones as SGCMarkus may be doing, and in the past for Moto, Demon00 has done the same, as referred somewhere in this topic)

Even if circumstances will make it unofficial for the first period, im pretty sure that at the hands of @ThE_MarD there would be weekly sync with LOS sources. Let's just take our time to make it as stable as possible as well.
[Motorola Edge 40 Pro  / Moto X40 (China)] jimmie32:
Thanks for all the wonderful work thus far. I have a Edge+ (XT2301-1) that I'm willing to tinker with and help with testing on this particular variant. I have some experience with Linux but not Android in particular but hopefully I can put together coherent bug reports. Looking forward to an alpha alpha release!
[Motorola Edge 40 Pro  / Moto X40 (China)] hugolight:
Hello

any news about release date lineage os for edge 40pro?

thanks
[Motorola Edge 40 Pro  / Moto X40 (China)] mxz55:
Please take your time to read the info and updates-posts in this topic, and you can answer it by yourself
[Motorola Edge 40 Pro  / Moto X40 (China)] ThE_MarD:
Heyyo, so it seems like Motorola pushed a new kernel source update for rtwo and it might be a complete one! SGCMarkus is going to go through it and check but even a preliminary check it does look promising (y)

Release MMI-T1TR33.43-20-28 · MotorolaMobilityLLC/kernel-msm

rtwo-g push for android 13

github.com

We're still plugging away on rtwo, hopefully we find a solution to fix remounting partitions as rw in recovery so we can release a public build that can actually be fun to play with

Update: SGCMarkus unfortunately noticed that techpack display is still missing which is a bummer. I think on eqs with that missing USB-C display out wasn't working so hopefully that's the only issue we get as well...
[Motorola Edge 40 Pro  / Moto X40 (China)] ThE_MarD:
SGCMarkus did get the source built kernel to boot to system, but oddly enough without display lol oof... The really weird part is the USB-C display out actually works though haha... So she still needs some work
[Motorola Edge 40 Pro  / Moto X40 (China)] hugolight:
i buy nothing phone 2 ...in next time more

custom roms....
[Motorola Edge 40 Pro  / Moto X40 (China)] jjdxda:
Just got my phone, unlocked version,

from my local Best Buy store back on

Wednesday of this week, and was very

surprised to find out there are DSU files

for early release version of Android 14

hidden (and I do mean HIDDEN) on it..

Here's a screenshot from the "Developer

options" menu as proof:
[Motorola Edge 40 Pro  / Moto X40 (China)] jjdxda:
And here's a screenshot of the

terms that have to be agreed to

in order to install the GSI+GMS

ARM64 DSU package:
[Motorola Edge 40 Pro  / Moto X40 (China)] zlebors:
is this a working Lineage recovery on Moto X40? I was wondering if it can be use to flash Gapps on CN ROM
[Motorola Edge 40 Pro  / Moto X40 (China)] mxz55:
Status update: the public can expect an alpha testing build later this week.. some features will be buggy, it's for those that realize and want a first impression/report bugs

It will include a fix for partition remounting bug, for a few other nasty bugs like QSEE one (lockscreen getting stuck over and over) it's unclear if there are enough days in-between to find a fix or if we will ship the bug in alpha bleeding edge build, for the sake of other tests and feedback. It may also have unstable or non functional NFC, and Widevine L3 only.
[Motorola Edge 40 Pro  / Moto X40 (China)] ThE_MarD:
Heyyo, first public alpha is out! lineage-20.0-20230727-UNOFFICIAL-rtwo is very experimental!

The recovery can now remount partitions as rw, so flashing GApps is possible. WPA3 was also fixed by SGCMarkus and is also included.

Here are the main bugs noticed so far:

QSEE can screw up and lockscreen security won't pass/unlock (workaround is reboot. Might just be my device but I'll mention it here in case anyone else gets this issue)

NFC doesn't work

Automatic brightness is broken

Widevine L1 doesn't work (only Widevine L3. Motorola bootloader unlock wipes DRM keys and no known haxxs to restore them)

Boot animation plays in slow motion

SELinux permissive

Steps are similar to Dubai but also requires flashing the additional partitions

Install LineageOS on dubai | LineageOS Wiki

wiki.lineageos.org

ROM link:

LineageOS for rtwo - Browse /lineage-20/lineage-20.0-20230727-UNOFFICIAL-rtwo at SourceForge.net

LineageOS for rtwo (Motorola Edge 40 Pro / X40 / Edge Plus 2023)

sourceforge.net

The img files must be flashed to their respective partitions in fastboot before rebooting to recovery
[Motorola Edge 40 Pro  / Moto X40 (China)] jimmie32:
Thanks for the alpha release! Really excited to try this out.

A bit of a newbie question, does the boot.img contain the LineageOS recovery? I'm trying to flash the alpha release but whatever I do I keep going into the stock recovery. Maybe I'm doing something very wrong so pointers would be appreciated :)

It appears that rtwo has a A/B recovery layout after checking flashfile.xml from a stock ROM - I tried to flash boot.img into recovery_a but it wouldn't let me. Perhaps a separate recovery.img is needed?

fastboot flash dtbo dtbo.img
fastboot flash vendor_boot vendor_boot.img
fastboot flash boot boot.img
fastboot flash init_boot init_boot.img
fastboot reboot recovery
adb sideload lineageos-20.0-20230727-UNOFFICIAL-rtwo.zip

After fastboot reboot recovery (or a clean reboot to recovery) the standard motorola android recovery pops up. adb sideload would fail signature verification, so I can't proceed.

I tried flashing to the 'b' slots as well but no matter which slot I'm booting from it still drops me into the stock recovery.

The images I'm flashing:

8514238eebf2ba100743ba7c3070e0edfe3eb28f1a01935bca51164e60e83449 boot.img
4e4742ec25b4733b4e4260e3b2c49accf4008058c6fb54bd4ca655ab0e8d970b dtbo.img
c101e25d3a643b39f7cd2ac71a0293474f14bab9d5d6dca0f5d6b53e6390da3e init_boot.img
1afd82114133aee3a099068330c7d18e76ba4d18a976395ba6b3d9cbc49f5477 vendor_boot.img

Edit: Sorry, forgot to mention the important info: I'm on Edge+ 2023 (US variant) XT2301-1
[Motorola Edge 40 Pro  / Moto X40 (China)] ThE_MarD:
@jimmie32 oops my bad, I did forget to upload the recovery.img as rtwo actually has dedicated recovery partitions too which is good. It is uploaded now

Don't forget to do copy partitions step aswell as both slots need to be populated with device firmware
[Motorola Edge 40 Pro  / Moto X40 (China)] jimmie32:
Thank you @ThE_MarD! Recovery boots fine now.

If anyone is having issues with fastboot reboot recovery sending the device back to fastboot, run "fastboot oem fb_mode_clear" and then "fastboot reboot recovery" should work. Took me a while to figure it out.

It boots great now! The brightness is blinding lol. Testing everything now.

When going through setup on the Wi-Fi screen, "Use mobile network for setup" & the signal indicator kept appearing and disappearing the system rebooted and booted to a "Shutting down..." screen. I was kicked into recovery and had to Factory Reset. I took out the SIM to prevent it from going into mobile network and it set up fine.

A few thoughts about the known bugs, not sure if this will be helpful.

I remember reading in the moto X40 to Edge 40 Pro thread, as well from my own experience, that flashing a different region ROM (e.g. RETEU on X40 or Edge+) caused PIN issues that required reboots to clear. Maybe it is related. On my Edge+ I only encountered this issue if I flashed anything but RETUS/BOOST. So maybe there is something region/device specific in the firmware that has to work with QSEE? Or it is unrelated.

A few of us kept our Widevine L1 after bootloader unlock, even when rooted. I'm happy to go back to RETEU, root, and check if L1 is still working and pull any debug information needed.
[Motorola Edge 40 Pro  / Moto X40 (China)] Yqsy:
greetings from China(y)(y)(y)
[Motorola Edge 40 Pro  / Moto X40 (China)] jimmie32:
On my Edge+ (XT2301-1) I can't get mobile network. It seems to connect and get a signal then flashes to no signal, the mobile network icon disappears, then it appears again in a loop. SIM status keeps looping between Unknown - No Service - T-Mobile - then back to Unknown.

I tried the usual commands that are included after flashing each stock firmware

fastboot erase apdp
fastboot erase apdpb
fastboot erase carrier

but it did not help.

I've attached the logcat and logcat -db radio captured throughout the multiple reattempts.

For privacy purposes I snipped out the IMEI (IMEIIMEIIMEI99) & serial but kept the rest. I'm happy to take any other logs or do any other testing!

LineageOS was installed on top of the RETEU ROM (so it has the RETEU radio, bluetooth, dsp, ...) which had mobile network fine.

Update: flashing the RETUS radio (with factory reset) results in bootloop.

Going back to full stock by flashing the full RETUS firmware, then flashing lineage, works but has the same mobile network issues. So it looks like I can't do a dirty flash of the firmware, but I suppose that is to be expected.

Wi-Fi appears to work fine.

Thanks for all your hard work!
[Motorola Edge 40 Pro  / Moto X40 (China)] mxz55:
There's no attachment
[Motorola Edge 40 Pro  / Moto X40 (China)] jimmie32:
Oops, rookie mistake... apologies. Here it is:

Huh, strange. It's not letting me attach it, maybe too large. I'll paste it somewhere.

logcat: https://gist.github.com/jimmielin/811c395d5daed4a9ae36e9d2e8f8a6a3

logcat -db radio: https://gist.github.com/jimmielin/8c084d2a48723bed2037df67402841a4

Otherwise everything appears to work on Edge+! Really appreciate the work on the first alpha.

* Recovery including touch screen

* Touch, display fingerprint, brightness (except auto-brightness), refresh rate change

* Wi-Fi, WPA3

* Sound and vibration

* Cameras through Moto Camera (camera3)

* PIN lock (haven't had issues with PIN requiring reset, yet)

* MindTheGapps works as well (above taken without Gapps)
[Motorola Edge 40 Pro  / Moto X40 (China)] mxz55:
I will post my impressions on the test build later, but for now i dont see any major bugs except for NFC not working.. and i will use it as a daily driver for some time. It works really smooth, just don't forget to manually raise refresh rate from 60hz to 120 or 165hz, and the "High touch polling rate" option is also advisable.

@jimmie32 for your mobile network issue, i expect The_MarD or @SGCMarkus to get back to you about it, for our tests (and what the sources are based on) the Edge 40 Pro is being used, maybe something needs to be added for ideal Edge+ (2023) support. Luckily, full sources for Edge+ (2023) were also released. They can evaluate this, or someone else that has this device variant could flash the test build and report in, as it could be something on your side. Maybe reinstall the ROM once to test.
[Motorola Edge 40 Pro  / Moto X40 (China)] jimmie32:
Thanks @mxz55! I tried clean reinstalls with both RETEU & RETUS base but neither could get my mobile network working, so I assume there might be something with missing support for the Edge+ variant.

I would volunteer to poke a little around the sources (maybe diff-ing the Edge+ & Edge 40 Pro sources could reveal some things) but I've never built Android/Lineage from source myself. Perhaps I'll find a guide and build it from source some day. Either way I'm happy to do any tests on my device as I don't need it as a daily driver yet.
[Motorola Edge 40 Pro  / Moto X40 (China)] mxz55:
From a quick glance, i can see your logcats contain plenty of relevant lines about SIM/data connection failure, they will likely figure it out. My hunch is that there's a firmware mismatch, as the Edge 40 Pro latest stock version is T1TR33.43-20-28 (from April 2023) while latest for Edge+ (2023) is T1TR33.43-48-21 (includes May security patch and some Motorola fixes), there could be an incompatibility or radio fw mismatch as LOS so far is based on T1TR33.43-20-28 sources

I don't know why Motorola chose to provide more/regular updates for the Edge+ (2023), by the way also for Chinese variant X40 (there, its T1TR33.4-30-62), but leave the Motorola Edge 40 Pro behind on it.

Maybe they dont care as much about EU customers? Either way, surely, no matter if this is the cause.. devs can merge & unify all the sources from each variant, to provide ideal support. There's newer stuff in the Edge+ (2023) update that may also be used to base LineageOS things on.

And, in case Motorola is really going to leave EU customers behind on their already fairly poor update policy, LOS can be used to ship whatever they ship to US and CN users (Edge+ 2023 and X40) also to EU users, through supplying the stuff in its trees. As known, this route can be taken so users don't have to manually perform firmware updates all the time, next to LineageOS ROM updates.

As a minor sidenote, if any Edge+ (2023) user is too stoked to wait, flashes the test build and runs into the mobile data issue (thereby confirming it's not limited to jimmie32), if my hunch is correct they may be able to workaround it for now by flashing EU (Edge 40 Pro) firmware, and then the test build. Lenovo Rescue assistant is reliable in case something goes wrong.