[DEV][WIP] brcmfmac wifi driver & qcwcn libs for MSM8974-based devices like Sony Shinano - Android Software/Hacking General [Developers Only]

The intention behind this thread is to share some experience of a little project where I try to migrate the Sony Xperia Shinano devices (based on Qualcomm MSM8974 chipset with a Broadcom BCM4339 wifi/bluetooth chip) from the old bcmdhd wifi driver to a close-to-mainline brcmfmac driver. I want to share the progress and status here, and maybe get some hints. It is work in progress, and for sure it still contains some mistakes - I haven't done something like this before and am still learning.
Why?
The Shinano devices are still maintained by the LineageOS, and some devices are currently on the official LineageOS 17.1 stream.
The kernel however is terribly outdated, based on msm-3.4
There are some wifi issues with all LineageOS-based ROMs since years, like weak 5GHz connections and non-working wifi in some countries. There are some hacks around that, but they work (afaik) by practically disabling the kernel-level regulatory system by e.g. setting a static country code like "DE".
I am curious if we can improve that by updating the kernel drivers and network/wifi components, and maybe also the firmware (to the latest release available from Broadcom, 6.37.34.43 ?) . I got the ideas from Sonyxperiadev/Loire (+ related platform config), the Linux Backport Project and other MSM8974 based devices.
Working so far:
Did a few tests only so far, STA with WPA2 and p2p (hotspot) seem to work
Wifi connection is stable on 2,4GHz on 00 world regulatory domain (tested on a Z3 and a Z3c)
5GHz manually setting a country code (could only test DE)
Switching countries / setting new regulatory domains is now working, too
Download speed looks OK to me, in my case at least better than before Download >60MBit, Upload >30 Mbit on some initial tests.
Not working yet:
WifiHAL (qcom-caf) does not work correctly. This may create multiple issues, tbd.
Connection bandwidth seems to be not reported correctly
I don't know if wowlan works (interrupts working?)
Stability: After 1-2 days without reboot wifi sometimes crashes but immediately reconnects. Reason not yet understood.
Patches & Picks
Kernel:
backported and configured brcmfmac, cfg800211 wireless configuration API and wireless network stack from linux-stable v5.8 by adopting the compatibility patches from the linux backporting project.
updated Shinano device tree, updated Z3, Z3c and Z2 (Z2 test needed!) defconfigs (unset bcmdhd and enabled brcmfmac) and removed board-sony_shinano-wifi.o in the arch-msm makefile
Note: the backported drivers and compatibility-patches are located in a separate backports/ subdirectory
Sorry, this is work in progress and contains some hacks, to be cleaned up later
--> https://github.com/LineageOS/androi...1...Tom1000:lineage-17.1-driver-backport-v5.8
Vendor blobs / device z3(c): removed proprietary firmware and replaced that by publicly available firmware for bcm4339 on linux-firmware.git
z3c --> https://github.com/LineageOS/androi.../lineage-17.1...Tom1000:lineage-17.1-brcmfmac
z3 --> https://github.com/LineageOS/androi.../lineage-17.1...Tom1000:lineage-17.1-brcmfmac
Shinano-common: Use qcwcn instead of bcmdhd WLAN device, serve wpa_supplicant_overlay.conf
--> https://github.com/LineageOS/androi.../lineage-17.1...Tom1000:lineage-17.1-brcmfmac
msm8974-common: raise wpa_supplicant version (unknown if we need that) and update sysfs node for MAC address
--> https://github.com/LineageOS/androi.../lineage-17.1...Tom1000:lineage-17.1-brcmfmac

As a follow up, the driver seems to work quite stable already. I still have issues with nl80211 private commands, as a mainline brcmfmac does not seem to accept command strings passed via a libnl control socket like this:
qcwcn/wpa_supplicant_8_lib/driver_cmd_nl80211.c
@vknecht : I've seen your backporting work for the Xperia X. How does this work for Loire with SODP? Does e.g. a "set country code request" work for you, and if so, can you give me a hint?

I need some feedback from people with a Z3/Z3c/Z3Dual to see if the new builds work in affected countries, where 5GHz wifi is not working on current custom ROMs like e.g. LineageOS 17.1. I would appreciate if you test one of the builds below and send me a full log.
WARNING: The following builds are for debugging purpose only. Do not use them as a daily driver, as they have SELinux disabled and create excessive log entries. This ROM is not stable, some features are not yet implemented.
Xperia Z3 (D6603):
lineage-17.1-20201227-UNOFFICIAL-z3.zip
drive.google.com
Xperia Z3c (D5803):
lineage-17.1-20201227-UNOFFICIAL-z3c.zip
drive.google.com
Xperia Z3Dual (D6633) Update 10Jan2021:
lineage-17.1-20210110-UNOFFICIAL-z3dual.zip
drive.google.com
Z3Dual build has SELinux enabled already
If possible, please follow these steps:
Install ROM with TWRP for Android 10 or Lineage Recovery for 17.1
If possible, factory reset the device. Be sure to get rid of all former Magisk modules which try to set country codes etc. (if applicable).
Make sure a a local SIM card is inserted.
Boot the device. Enable mobile data and enable wifi. Connect to a 5GHz capable access point or router.
Optional: Increase log buffer size. This may be required as the kernel is set to verbose logging, creating large logfiles. You can do this via settings/developer options or via adb:
adb logcat -G 8M
Get close to the access point or router, so that the device would prefer 5GHz over 2.4GHz.
Reboot the device and let wifi connect. Check if device uses a 5Ghz connection. (Ignore bandwith / speed for now.)
Create a logfile, e.g. with this command via adb:
adb shell logcat -d -b all > mylog.log
The logfile may contain private information, so I recommend not to post them public. Together with the ligfile I would like to know
a) Wifi 5GHz working?
b) The country in which you have tested this.

nice work bro.
i live in iran and in this build my Z3 Dual detects wifi networks while the sim card is also connected.
but in 10 Jan 2021 update my phone can't detect my router's wifi unfortunately while the previous build could do it without problems.
hotspot turns on on both 2.4GHz and 5GHz.
in this new build cellular network and data are working.

Thanks @TheShadowOfAGhost20 !
Can you please run a root shell (E.g. by connecting via ADB, run adb root, then adb shell) and then
$> iw wlan0 scan → scan for networks
and then look if your access point is found?
Furthermore, can you please check which WiFi channel this particular router ist set to, and if possible the bandwidth?

Mr.Tom_Tom said:
Thanks @TheShadowOfAGhost20 !
Can you connect via ADB, run adb shell and then
$> iw wlan0 scan → scan for networks
and then look if your access point is found?
Furthermore, can you please check which WiFi channel this particular router ist set to, and if possible the bandwidth?
Click to expand...
Click to collapse
i did that but got this error: "/system/bin/sh: iw: inaccessible or not found"
but i found the cause: my wifi channel was set to 12. i changed it and then got detected!

TheShadowOfAGhost20 said:
i did that but got this error: "/system/bin/sh: iw: inaccessible or not found"
Click to expand...
Click to collapse
Sorry I forgot to write that you have to do this as root, I edited the post accordingly.
TheShadowOfAGhost20 said:
i found the cause: my wifi channel was set to 12. i changed it and then got detected!
Click to expand...
Click to collapse
Tha sounds reasonable. However, Channel 12 should be usable in IR.

Mr.Tom_Tom said:
Sorry I forgot to write that you have to do this as root, I edited the post accordingly.
Tha sounds reasonable. However, Channel 12 should be usable in IR.
Click to expand...
Click to collapse
channel 13 has detection problem too. the others are OK

.sorry erroneous post

New builds​Feedbacks have been positive so far, so here are some updated builds.
Lineage Sources* as of 20 March 2021
Kernel sources* based on Linux 3.4.113 with backported wifi from 5.8.18 plus cherry-pick of the following changes:
bluetooth: fixed #ifdef'ed PM callbacks ("BTLowPower" wakelock) 50f16d16b32871c5ce97b029e68692008c848bb2
SELinux enforcing
Build as userdebug, normal loglevels
* For links to sources see 1st post. Z3Dual does not have official Lineage17.1 sources yet, bringup is in progress.
Xperia Z3 (D6603):
HiDrive
hidrive.ionos.com
md5: d7aaf1fea120df3e2aad10b3a2d32226
Xperia Z3c (D5803):
HiDrive
hidrive.ionos.com
md5: 456ff87441c3a63e8dc8c7a8d03bdf39
Xperia Z3Dual (D6633):
HiDrive
hidrive.ionos.com
md5: 1848681c82d608f3212f1ace621327cb
As always, feedback is welcome.

Has anyone found a bug/installed this latest build yet? lineage-17.1-20210320-UNOFFICIAL-z3dual
Finding this super stable.. The only thing that does not work for me is the advanced boot recovery that goes back into system, But that's a known issue.

Mr.Tom_Tom said:
New builds​Feedbacks have been positive so far, so here are some updated builds.
Lineage Sources* as of 20 March 2021
Kernel sources* based on Linux 3.4.113 with backported wifi from 5.8.18 plus cherry-pick of the following changes:
bluetooth: fixed #ifdef'ed PM callbacks ("BTLowPower" wakelock) 50f16d16b32871c5ce97b029e68692008c848bb2
SELinux enforcing
Build as userdebug, normal loglevels
* For links to sources see 1st post. Z3Dual does not have official Lineage17.1 sources yet, bringup is in progress.
Xperia Z3 (D6603):
HiDrive
hidrive.ionos.com
md5: d7aaf1fea120df3e2aad10b3a2d32226
Xperia Z3c (D5803):
HiDrive
hidrive.ionos.com
md5: 456ff87441c3a63e8dc8c7a8d03bdf39
Xperia Z3Dual (D6633):
HiDrive
hidrive.ionos.com
md5: 1848681c82d608f3212f1ace621327cb
As always, feedback is welcome.
Click to expand...
Click to collapse
hi mr.tom. it's perfect as always, found no bug except wifi signal power, it's weak compared to stock roms but there was no difference in speeds. maybe it's because of wifi icon that shows little weaker signal.
and about overheating: i didn't test this build for long but while working with it i have noticed that my device is cooler than previous builds, maybe it's because of this new kernel.
i have recorded 4k for about 7 minutes then my phone rebooted i think that was because of too much heat, then i've reinstalled stock rom, however, stock rom's camera won't let me record much and the app shuts down because of heat, so i can't find out if stock rom can record 4k at least without rebooting.
i need to test this build for more time i hope the heating is now gone
and one question: can you port cyberian camera mod for these roms? or is that possible?

netwave said:
Has anyone found a bug/installed this latest build yet? lineage-17.1-20210320-UNOFFICIAL-z3dual
Finding this super stable.. The only thing that does not work for me is the advanced boot recovery that goes back into system, But that's a known issue.
Click to expand...
Click to collapse
lineage os recoveries have these problems yet, there's no fix for that, only the developer can fix it. currently the twrp works if you flash it to FOTAKernel partition but i think the twrp is useless because it doesn't install these builds.

Surely better to do: fastboot boot recovery-20201012-TESTING-z3dual.img rather than a "flash" recovery. What would be the point in flashing a recovery if its not working.

Hey
Thanks @Mr.Tom_Tom for new build and @TheShadowOfAGhost20 for testing dev builds!
today i installed the new release
but i have some problems with recovery and boot
after installing Lineage i cannot boot to recovery again
i tried adb, android advanced boot options and "fastboot boot image.img"
none of them taken me to recovery mode
so i needed to install Magisk , OpenGApps , and rom itself with adb sideload and reboot to system because i can't boot to recovery again
i'm now installing my apps for daily usage testing - i need about one or two week to test and use and see if anything is wrong or not
for now WiFi problem is gone , i have full wifi access and both sims antenna
again , thanks to everyone puts effort on this project (and sorry for bad English)
i will update this post if i found anything

navidmafi said:
today i installed the new release
but i have some problems with recovery and boot
after installing Lineage i cannot boot to recovery again
i tried adb, android advanced boot options and "fastboot boot image.img"
none of them taken me to recovery mode
Click to expand...
Click to collapse
If your going to settings\system\developer options\advanced restart\power\restart recovery , Forget it! this method doesn't work for now, & will only boot you back into Lineage. It's an issue that hopefully get's fixed in the future.
But here's a better way of entering recovery without having to flash it...
Check all your drivers are installed correctly & make sure you have the correct recovery to hand.
Here's what I Command:
adb devices
adb reboot bootloader
fastboot devices
fastboot boot recovery-20201012-TESTING-z3dual.img
Good luck!

Hey again
Thanks to @netwave i can now boot to recovery without problems by going to fastboot from adb , and booting image directly by "fastboot boot"
while using devices after installing new release , i have a problem with WiFi connectivity
when i lock the screen by power button , the wifi disconnects
for example i use whatsapp a lot and when screen is locked wifi is not connected
i checked power settings - and even set the battery profile to "Quick" (and battery saver is off) but it did not help
is this a bug or a feature?

navidmafi said:
Hey again
Thanks to @netwave i can now boot to recovery without problems by going to fastboot from adb , and booting image directly by "fastboot boot"
while using devices after installing new release , i have a problem with WiFi connectivity
when i lock the screen by power button , the wifi disconnects
for example i use whatsapp a lot and when screen is locked wifi is not connected
i checked power settings - and even set the battery profile to "Quick" (and battery saver is off) but it did not help
is this a bug or a feature?
Click to expand...
Click to collapse
Have you tried without Magisk installed? Don't use v22.0 what ever you do as it disables WiFi

Ow
I'm using Magisk and it is version 22.0
and even root not works
should i reflash ?
Edit : Ok i'm flashing again now

navidmafi said:
Ow
I'm using Magisk and it is version 22.0
and even root not works
should i reflash ?
Click to expand...
Click to collapse
Install the Magisk uninstall.zip from recovery
when your back in Lineage your still have a disabled WiFi as Magisk does not uninstall correctly.
So Install the original boot extracted from the Lineage.zip to get things working again.
- adb devices
- adb reboot bootloader
- fastboot devices
- fastboot flash boot boot.img
- fastboot reboot
Then your be sorted.

Related

[ROM][GT-I9305][Marshmallow][6.0][Cyanogenmod 13.0][UNOFFICIAL]

Disclaimer (partially borrowed from MIT license) - WARNING:
THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND. If you loose your data, brick your device, any other damage or anything else happens (e.g. your cat eats your dog), it is YOUR PROBLEM and YOUR RESPONSIBILITY. Your device warranty is most probably void after installing this.
Although my original intention was just to help with porting CM 13 to i9305, I ended up with my build
To avoid any confusion a because I still have a felling that some people don`t understand this, I have to explain one more detail. I didn`t create this, I only built it. It is a big difference, similar to buying versus building a house. Buying a house is not a simple thing (at least in my country) and you`d probably need to do some changes and repairs before you can start living in it. But building a house is something completely different and much more difficult. The work I`ve done on this CM build is more like buying a house. The see the list of people who "built the house" go into Settings on your phone, section About phone and then Contributors. It is a really long list. Thanks to all of them
Also, please, keep in mind, that I am only sharing results of my hobby.
It is build mostly directly from CyanogenMod 13.0 sources. I only added support for i9305 and cm12 chroot for RIL support. See the original thread for some details. Anyway my work on this is really small, I fixed some problems a put all of this together.
You can download here:
cm-13.0-20160907-UNOFFICIAL-i9305.zip
There is also another builds from @evilracer123. (EDIT 31.3. 2016)
If you want you can also download unofficial build of TWRP with f2fs support TWRP-UNOFFICAIL-3.0.1.img
Changelog:
EDIT (17.1. 2016) - new build with bluetooth fixed
EDIT (19.1. 2016) - new build with bluetooth for non owner fixed, the code for this build downloaded yesterday
EDIT (22.1. 2016) - new build
EDIT (25.1. 2016) - new build - there is some bug in FileManager - see http://forum.xda-developers.com/showpost.php?p=64980000&postcount=150
EDIT (27.1. 2016) - new buld - FileManager bug fixed, Answer call with hardware HOME button commit included
EDIT (29.1. 2016) - new build
EDIT (1.2. 2016) - new build - attempt to fix bluetooth audio problem
EDIT (8.2. 2016) - new build - clock overflow fix (details)
EDIT (17.2. 2016) - new build - I added the SlimISP_PH.bin file, fixed the crashing gallery for non-owner (I added the INTERACT_ACROSS_USERS permission, I hope that it is a correct fix) and added rules for selinux denies @BMP007 reported for logcat.
EDIT (25.2. 2016) - new build with multiple RIL implementations, diff attached
EDIT (19.3. 2016) - new build, f2fs support (some hints here). I attached 2016-03-18_16-49-21-cm-13.0-20160318-UNOFFICIAL-i9305.tar.gz, which contains diff file, roomservice.xml and list of used commits.
EDIT (31.3. 2016) - new build
EDIT (18.4. 2016) - new build
EDIT (25.4. 2016) - new build
EDIT (20.5. 2016) - new build
EDIT (23.6. 2016) - new build
EDIT (7.9. 2016) - new build
EDIT (10.4. 2016) - new build, compiled with ArchiDriod optimizations (thanks to @JustArchi), fixed mDNIe settings
This ROM supports F2FS - you can find some hints, how to use it here. (EDIT 31.3. 2016)
If you want world writable sdcard, set property persist.world_writable_sdcard to true (search the thread to see how) , but be aware that this is not standard behavior.
Multiple RIL implementation
In this ROM, there are more then one RIL implementations. None of them is perfect, but you can choose, which one of them works better for you. The first RIL implementation is the usual CM 12.1 based one (this is the default one), the second one is based on proprietary files extracted from stock 4.4.4 ROM downloaded from sammobile.com (I9305XXUFOB2_I9305PHNFOB2_I9305XXUFOA1_HOME.tar.md5), the third is based on proprietary files from TheMuppets, with one small change (see here for details). To switch between them open shell (over adb, or using the build in app, or whatever you like) and execute command ril. You will see something like this:
Code:
Select RIL implementation:
* 1 - CM 12.1 based
2 - Stock 4.4.4 based
3 - TheMuppets based
x - quit
?
Type 1,2,3 or x and hit enter. The requires root, so be sure it is enabled. After switching, reboot the phone. If you don`t want bother with this, don`t. The default one is, based on my experience, the best
If you want gapps, use http://opengapps.org/. As mentioned several times elsewhere flash it RIGHT AFTER the ROM. I tried the nano version and it works fine.
As far as I know all hardware and RIL is working without problems (even barometer is correctly detected).
Know BUGs:
- sometimes after boot RIL is not started correctly (http://forum.xda-developers.com/galaxy-s3/development-i9305/rom-t3252492/post64740417#post64740417) - data connection (and maybe something else) is not working. In that case turn on and of flight mode (or go somewhere without signal). I trying to fix this, but it is difficult.
- the led flash light used as a torch goes off together with the display (http://forum.xda-developers.com/galaxy-s3/development-i9305/rom-t3252492/post64699946#post64699946)(fixed http://review.cyanogenmod.org/#/c/132783/)
- I suppose there is still msm_hsic_host wakelock bug (https://jira.cyanogenmod.org/browse/CYAN-2266). Supposedly unplugging the charger with display on should prevent this. EDIT (13.2. 2016) Some people are reporting that is fixed. I didn`t anyting specific to fix it, so I am not sure. One possibility is that this was also caused by the clock bug.
- if you have non FAT partition on you sdcard, you get a message that sdcard is corrupted. I`ll try to fix this one, it should not be difficult and it is annoying for me.
- gallery app is crashing for non owner (EDIT 19.1. 2016) (EDIT 17.2. 2016)
- there a problem with bluetooth audio - it occasionally stops for few seconds may be fixed in the today`s build (EDIT 1.2. 2016)
- on the first boot (after /data wipe) the SIM may not be found. Reboot should fix this. (EDIT 31.3. 2016)
Selinux is enforcing. If you used some of my previous builds from the original thread and there is something broken, what worked before, this may be the reason. In that case output of dmesg | grep 'avc.*denied' from the moment the problem happens, is a big help to solve it.
Code related to this can be found here:
https://github.com/p-an/i9305-cm13-device
https://github.com/p-an/android_system_core/tree/cm-13.0
https://github.com/p-an/android_build/
and some smaller changes in attached diffs (part of attached tar.gz archives as code.diff since 2016-3-18)
Build instructions:
This is definitely not the only way how to build CM13 for i9305, but it is the procedure, which I, more or less, use.
First of all read (and understand) the original guide. My build process is modified version of it. The modification is necessary, because there is no official CM13 for i9305, so the breakfast command won`t work. It is replaced by creating .repo/local_manifests/roomservice.xml file. Another change is that proprietary file are part of my github repo, so you don`t have to connect the phone.
Followe the guide mentioned above till the repo command setup. The next step is to initialize the CyanogenMod source repository - use the cm-13.0 branch:
Code:
$ cd ~/android/system/
$ repo init -u https://github.com/CyanogenMod/android.git -b cm-13.0
Now before you do repo sync, you have to create the roomservice.xml file (note the actual command is old, download the latest .tar.gz archive attached to this post and extract roomservice.xml from it):
Code:
$ mkdir .repo/local_manifests
$ wget "http://forum.xda-developers.com/attachment.php?attachmentid=3657032&d=1456237857" -O .repo/local_manifests/roomservice.xml
Now is time for downloading the code (it takes some time):
Code:
$ repo sync
After this is done you will probably need to sync the code from my github with upstream. It may up to date, but i can`t guarantee it. First add the upstream repo:
Code:
$ cd ~/android/system/system/core/
$ git remote add upstream https://github.com/CyanogenMod/android_system_core.git
And now sync the code:
Code:
$ cd ~/android/system/system/core/
$ git checkout cm-13.0
$ git fetch upstream
$ git merge upstream/cm-13.0 -m 'sync with upstream'
The checkout is necessary to have cm-13.0 branch active. Following two commands download the code from upstream and merge it. They can be replaced with one pull command. Now apply patches. I usually attach them either to this post, or the post, where I announce something new (like a fix). The reason why I share some changes this way, is that I don`t wan`t to fork whole big repository because of a small change. In the latest (cm-13.0-20160217-UNOFFICIAL-i9305.diff) diff there is only one change bigger than one line - delete 5 lines (2 of them are comments). This is usually easy to change manually, if patch fails. You can use this https://groups.google.com/forum/#!topic/repo-discuss/43juvD1qGIQ to apply the patch (store the script into ~/bin/repo_patch and make executable).
Code:
$ cd ~/android/system/
$ repo_patch cm-13.0-20160217-UNOFFICIAL-i9305.diff
Now proceed to the Extract proprietary blobs step. The commands are the same, but you don`t have to connect the phone to the computer:
Code:
$ cd ~/android/system/device/samsung/i9305
$ ./extract-files.sh
Since you skipped the breakfast step, you should now return to the ~/android/system/ directory and setup the environment:
Code:
$ cd ~/android/system/
$ source build/envsetup.sh
Now setup the ccache, if you want. See Turn on caching to speed up build in the original guide.
Start the build:
Code:
$ brunch i9305
If you find some problem let me know, I can try to fix it. But I can`t promise anything, this is only hobby for me and my original intention was just to help with porting CM 13 to i9305.
pAn
reserved
The bug whit the flashlight is on every CM12.1 rom.
2 min using the flashlight and the phone automaticly booting (bootloop).
Is there a chance the problem whit the sdcard to be permision problem?
Thanks i was start thinking that no one want we to have a marshmallow rom for our devices. Live long and prospect.
Sectorian said:
The bug whit the flashlight is on every CM12.1 rom.
2 min using the flashlight and the phone automaticly booting (bootloop).
Click to expand...
Click to collapse
This is new for me. I`ve probably newer used it for such a long time. I`ll put on my list
Sectorian said:
Is there a chance the problem whit the sdcard to be permision problem?
Click to expand...
Click to collapse
I don`t think so. I suppose that this is because there is ext2 partition (with Debian chroot) and Android has never designed to use sdcard with something like this. Until this version it was simply ignored. It is not a big problem, just annoying message.
Nvm sry for asking
russia101 said:
Are there some more changes then the build you already posted on the other thread ?
Click to expand...
Click to collapse
You quote entire OP and you can't read it ?
Please ...
russia101 said:
Are there some more changes then the build you already posted on the other thread ?
Click to expand...
Click to collapse
Edit your post please. No need to quote entire OP
@p.a.n gongrats for your first and the new thread with your rom and many thanks for uploading your sources.
But I am wondering, why you haven't pushed the changes in build and smdk-common, which are present in your posted diff file? Are they not needed (anymore?). And still not clear is, where to put mount_chroot.sh? In system/bin or cm12chroot/system/bin?
ok ... I tried it with usual cyanogenmod smdk-common cm-13.0 branch and original cyanogenmod build and without mount-croot.sh and: sim card and ril is working. But I still cannot hear something or anybody during a call . What vendor/samsung repo are you using? themuppets or crazyweazel and which branch? Maybe there is the problem located?
rodman01 said:
ok ... I tried it with usual cyanogenmod smdk-common cm-13.0 branch and original cyanogenmod build and without mount-croot.sh and: sim card and ril is working. But I still cannot hear something or anybody during a call . What vendor/samsung repo are you using? themuppets or crazyweazel and which branch? Maybe there is the problem located?
Click to expand...
Click to collapse
All the my changes from smdk-common are either in upstream (e.g. the incomminmg call fix) or I moved them to i9305. Script mount-croot.sh is not necessary anymore, the mounts are handled by init (init.target.rc). The only changes from the diffs which are not in those two repositories were in kernel and they are not necessary. The proprietary files which I am using are in the repo (https://github.com/p-an/i9305-cm13-device/tree/cm-13.0/proprietary, https://github.com/p-an/i9305-cm13-device/blob/cm-13.0/cm12chroot/cm12chroot.tgz), I don`t remember where I have it from Just execute extract-files.sh in device/samsung/i9305.
I really have no idea what could be wrong in your case You problems with audio or is it the still the problem with incoming calls (the phone doesn`t ring when someone calls)?
p.a.n. great work brother, installed this ROM with this Gapps (https://www.androidfilehost.com/?fid=24269982086993883) with my outdata Philz Touch 6.48 and works pretty damm good! GPS and wifi OK, incoming and outcoming calls smooth. Congratz!!!
Im expirience a slow charging whit your Rom whit agni kernel. Before that i was on Acip10 whit the same version of agni kernel and the charging work corectly. Hope im helpes.
Oher bugs: trebuchet crashing, skype is not working.
@p.a.n thanks for your all you've done,the rom works great for me,ril data 3g and lte works fine,many thanks ......
@rodman01 just and idea, you`ve probably tried it - do you have data connection, when you try the call? The bug which requires airplane mode on/off effects more than only data connection - if it happens also Llama doesn`t correctly detect area based on cell id. So it could be the reason for your problems.
Sectorian said:
Im expirience a slow charging whit your Rom whit agni kernel. Before that i was on Acip10 whit the same version of agni kernel and the charging work corectly. Hope im helpes.
Click to expand...
Click to collapse
What about cpu load, wakelocks? Did you check it?
Sectorian said:
Oher bugs: trebuchet crashing, skype is not working.
Click to expand...
Click to collapse
Could you provide some details - how to replicate it, logcat, etc. ? Trebuchet seems to be stable to me, but I using mostly another launcher. I don`t use skype, so I am afraid I can`t help with that one
Many thanks for the the tip, I will look at it and make some tests. Sim and ril is working, incoming and outgoing calls too...but no call audio, so I cannot hear the caller and he doesn't hear me neither.
rodman01 said:
Many thanks for the the tip, I will look at it and make some tests. Sim and ril is working, incoming and outgoing calls too...but no call audio, so I cannot hear the caller and he doesn't hear me neither.
Click to expand...
Click to collapse
Can you talk on a headset via the 3.5mm jack? If you can then it's related to RIL or the microphone and earpiece don't work in call.
Thanks for the awesome rom! Do I need to flash anything to get root?
floopyb said:
Thanks for the awesome rom! Do I need to flash anything to get root?
Click to expand...
Click to collapse
No, just enable the developer options, it is there
Sectorian said:
Im expirience a slow charging whit your Rom whit agni kernel. Before that i was on Acip10 whit the same version of agni kernel and the charging work corectly.
Click to expand...
Click to collapse
In AGNi control set 'Ignore unstable charging power', 'ignore safety margin', 'AC charge rate 1500mA'.
You won't damage anything, not phone nor charger.
There is a free app called Galaxy Charging Current which shows you the charging rate.
If you're too scared, just do the ignore unstable power and that will cure your issue. The other two things just make it charge even quicker.

SailfishOS 3 for Photon Q and siblings

Code:
* I am not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this ROM
* before flashing it!
SailfishOS 3 for Photon Q
Continuation from 2.0 thread to keep most important information in first post. Thanks to vevgeniev for initial port, without it I would never buy Photon Q.
Repo with my apps is added to image. Packages can by installed via terminal:
Code:
devel-su zypper in "package name"
Images
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Click to expand...
Click to collapse
Installation
Download and flash cm-11-20150626-SNAPSHOT-XNG3CAO1L8-moto_msm8960_jbbl.zip via twrp-3.0.2-0-asanti_c.img according to ordinary cm instruction. Use ext4 filesystem for /data partition. Boot to android and make sure everything works.
Download SailfishOS 4 image (open browser in private mode if onedrive ask you to login) and flash it over cyanogenmod. It's compressed tarball so installation may take even 10 minutes.
OTA
Read about Stop Releases and make backup using TWRP
Code:
/usr/share/sfos-moto_msm8960_jbbl-adaptation/upgrade.sh
# after reboot execute pkcon refresh to update all repositories
For any issues with upgrade.sh script download more up-to-date version, add --verbose argument or execute commands from real-upgrade.sh manually: https://build.sailfishos.org/packag...bl:4.4.0.68/sfos-moto_msm8960_jbbl-adaptation
At first boot tracker might slow down phone and eat a lot of storage. If it's too resource hungry move your media files out of device or create .nomedia empty file to exclude particular directory from tracker. Then force reset it:
Code:
tracker reset --hard
Custom Bootlogo
vevgeniev created a custom bootlogo:
Instruction how to use it
Known issues
Half screen mirror glitch occurs sometimes. Blank/unblank display fixes it
Sometimes removing files does not have any effect, i.e. free space doesn't increase and sdcard can't be unmounted. Could be easily triggered by mtp or dd usage. For sdcard access use FileZilla (SFTP).
QProcess:startDetached can hang randomly. Workaround added to fingerterm. Looks like it's bug in Qt and it is not photon q specific: https://together.jolla.com/question/202337/bug-fingerterm-terminal-freezes-after-opening-new-window
There are no 2.XG, 3.XG network indicators.
glReadPixels() return empty content in some cases. This means no screen recording, screenshots and thumbnails in browser. Workaround for screenshots added to lipstick.
All bugs at first boot are features.
FAQ
Q: How to run apk?
A: It's not android, you can't
Q: Can I switch between hardware keyboard layouts?
A: Default xkb layout switch shortcut: "shift + sym". You need to also set second keyboard layout:
dconf write /desktop/lipstick-jolla-home/layout "'us,ru'"
Click to expand...
Click to collapse
In newer releases layouts can be enabled in settings and switched via "shift + space"
Tips
Fast way to restart lipstick:
shift + tab + k
Alt + Tab like switching (if you have sailfishos-alttab-patch installed):
OK + tab
To disable volume media keys:
dconf write /apps/photonq-helper/mediaKeysEnabled 0
batt_health can cause reported battery capacity decrease which I am not sure works correctly at least on my aging battery. It's disabled since 3.3.0 in 2 places in /init.target.rc. Therefore btry will not report Aged Capacity anymore.
To use h264 (hardware accelerated) decoder in youtube set in about:config media.mediasource.webm.enabled to false
user name is still 'nemo' instead 'defaultuser' even for latest releases
Changelog
4.4.0.68
* Partially usable browser. Javascript doesn't cause crash on almost all sites like in 4.0-4.3 sfos. Tabs in landscape mode are unusable.
* Using browser probably breaks video encoding/decoding ('vid_dec_open() max number of clientslimit reached' in dmesg). Killing minimediaservice/browser usually helps.
* Disabled sailjail, and enabled start up boosters back.
* Few general sfos bugs more (see patchmanager catalogue for my patches)
4.3.0.15 - No for daily use, just required Stop Release
4.2.0.21 - No for daily use, just required Stop Release
4.1.0.24 - No for daily use, just required Stop Release
4.0.1.48
Broken browser
3.4.0.24 - Latest usable version
Fix memory leak when taking screenshot
Add workaround for remembering wlan state after reboot in airplane mode
Media keys works only in locked screen
3.3.0.16
NFC pn544 plugin added
batt_health disabled in /init.target.rc
glibc 2.30, gcc 8.3
3.1.0.12
kernel: hold volume up/down to select next/previous song
droid-hal-init: disable mpdecision due to constant cpu usage
3.0.3.9
Patch glibc for 3.0 kernel
3.0.2.8
Handle system and data partition automatically
New methods to wake up sensors
3.0.1.11
kernel: Fix crashes caused by new firewall rules
kernel: Experimental multi LUNs support
droidmedia: Fix random audio/video fail in browser
usb-moded: Mass storage was dropped in upstream. Use patched one
Click to expand...
Click to collapse
XDA:DevDB Information
SailfishOS 3 for Photon Q, ROM for the Motorola Photon Q 4G LTE
Contributors
elros34, vevgeniev
Source Code: https://github.com/elros34?utf8=✓&tab=repositories&q=msm8960&type=&language=
ROM OS Version: 4.4.x KitKat
ROM Kernel: Linux 3.0.x
Based On: CyanogenMod
Version Information
Status: Alpha
Created 2018-11-23
Last Updated 2019-08-20
Thanks for maintaining this for our devices @elros34
I have been meaning to try Sailfish for some time on my RAZR HD (xt926) and i finally got around to it the other day only to find that it wont boot up.
As per the 2.0 thread i can flash CM11 and that will boot and work fine but once i flash Sailfish over the top it wont boot past the bootloader unlocked logo. I have tried both the xt907 and photonq zips but neither will boot.
The xt907 zip did shown some signs of something happening since the led would light up either orange or white but after leaving it for 45 mins with no other signs of life i gave up on it.
Please find attached a list of my device drivers using the following command:
Code:
ls -alR /dev
Are there any chances of this running on my xt926 ?
Thanks, so it has xt907 like partition table, you can't use photon q image. LED glowing means system is booting.
Boot to TWRP then:
Code:
rm /data/.stowaways/sailfishos/init_disable_telnet
Now reboot, connect phone to usb and telnet to it:
Code:
telnet 192.168.2.15 2323
In windows you can use putty but it's hard to copy logs from it.
Then wait a while so logs are complete and run:
Code:
dmesg
journalctl --no-page
logcat
evdev_trace -I
elros34 said:
Thanks, so it has xt907 like partition table, you can't use photon q image. LED glowing means system is booting.
Boot to TWRP then:
Code:
rm /data/.stowaways/sailfishos/init_disable_telnet
Now reboot, connect phone to usb and telnet to it:
Code:
telnet 192.168.2.15 2323
In windows you can use putty but it's hard to copy logs from it.
Then wait a while so logs are complete and run:
Code:
dmesg
journalctl --no-page
logcat
evdev_trace -I
Click to expand...
Click to collapse
Thanks @elros34
Please find attached the various logs from my xt926.
Note i'm still running Sailfish 2.1.3.7, i figured it would be easier to start with that but if needed i can re-run these on 3.0.0.8
I have no idea what most of it means for the most part but a few errors did stand out to me in particular
Code:
Dec 12 20:20:16 Sailfish systemd[1407]: Failed to start The lipstick UI.
Could this possibly explain why its not booting any further?
Lipstick fails to start because xt926 use different touchscreen driver. Change "/dev/touchscreen" to "/dev/input/event1" in /var/lib/environment/compositor/droid-hal-device.conf
Also paste output of:
Code:
udevadm info -a /dev/input/event1
elros34 said:
Lipstick fails to start because xt926 use different touchscreen driver. Change "/dev/touchscreen" to "/dev/input/event1" in /var/lib/environment/compositor/droid-hal-device.conf
Also paste output of:
Code:
udevadm info -a /dev/input/event1
Click to expand...
Click to collapse
Thanks @elros34 its working now after changing the touchscreen driver boots up fine. I'm not seeing any immediate issues but will see how i get on with it. First impressions are very good, a really nice os i'm actually surprised at how fast and fluid it is.
Here is the output of
Code:
udevadm info -a /dev/input/event1
Code:
sh-3.2# udevadm info -a /dev/input/event1
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/i2c-3/3-0048/input/input1/event1':
KERNEL=="event1"
SUBSYSTEM=="input"
DRIVER==""
looking at parent device '/devices/i2c-3/3-0048/input/input1':
KERNELS=="input1"
SUBSYSTEMS=="input"
DRIVERS==""
ATTRS{name}=="melfas-ts"
ATTRS{phys}=="3-0048/input0"
ATTRS{properties}=="2"
ATTRS{uniq}==""
looking at parent device '/devices/i2c-3/3-0048':
KERNELS=="3-0048"
SUBSYSTEMS=="i2c"
DRIVERS=="melfas-ts"
ATTRS{drv_debug}=="Debug Setting: 0"
ATTRS{drv_reset}=="Reset: HIGH"
ATTRS{hw_irqstat}=="Interrupt line is HIGH."
ATTRS{ic_reflash}=="No firmware loading in progress."
ATTRS{irq_enabled}=="Interrupt: 1"
ATTRS{latency_debug}=="Latency Debug Setting: 0"
ATTRS{latency_times}==""
ATTRS{latency_values}=="Touch Latency Time: Average 0uS, High 0uS,0 interrupts of 0 were slow"
ATTRS{name}=="melfas-ts"
looking at parent device '/devices/i2c-3':
KERNELS=="i2c-3"
SUBSYSTEMS=="i2c"
DRIVERS==""
ATTRS{name}=="QUP I2C adapter"
I'll also see if i can convert some of the other xt925 and xt926 users for testing.
Absolutely love this - haven't had a single problem yet. Thank you so much elros34.
Could somebody check what "getprop ro.product.device" returns for xt926 or xt907 with sailfish installed?
mounting /dev/mmcblk0p39 on /data failes
Hi,
at first i would like to thank you for building SFOS3 for the Photon Q series, i bought another XT907 to finally get SF running on this pretty nice and tiny handset.
As @drkdeath5000 i stuck at the bootloader unlocked screen but with another problem as the touchscreen driver for his XT926.
I think it's a problem with the partition table here the error from /init.log
mount: mounting /dev/mmcblk0p39 on /data failed: No such file or directory
I followed the installation instructions you provided and flashed cm11, which is booting without issues. I already tried it with and without wiping dalvik/cache, with and without booting to cm11 first. So i would really appreciate your help. If i can provide some more detail just tell me.
Best regards
André
rkdeath5000 get further because he used old xt907 image, you can't use photon q image in XT907.
I have tried to support all devices in one image. I even prepared untested script to update kernel but need a nice way to distingnues between devices. No feedback so far.
Few days ago I came up with different an idea how to auto detect correct partitions in all devices but so far I am struggling with some serious issue in 3.0.2 so I am not sure when I will release it.
elros34 said:
Could somebody check what "getprop ro.product.device" returns for xt926 or xt907 with sailfish installed?
Click to expand...
Click to collapse
On my XT907 it returns scorpion_mini
Thank you for your fast response,
as you recommended Version Alpha3 is running but of course i would like to run SFOS3 So i would like to help you in any way possible.
Best regards
André
If you could test whether this image works (boots without issue and touchscreen works) then it would be great. This is image I just built with new method to detect correct partitions but without all needed patches for middleware so other bugs are not important for now.
Thank you so much! I can hardly tell you how happy you made me I always wanted i tiny handset running on SFOS and finally after i already had given up on that your rom make it happen.
I just started some basic testing on it, as i want to wait for the screen protector before starting to really use it so i'll give you a feedback on the rom later.
3.0.2.8 Released as OTA and new image probably for all moto_msm8960_jbbl devices.
Also I created new patch for Alt+Tab (OK + Tab key) like switching between windows. It's added to my obs repo.
So far the new version alpha9 installs without issues on the XT907. Right now i have just one problem, as in version alpha8 I'm not able to send text messages (SMS). I tried different sim cards from two different networks, so i think it's a problem within the ROM. How could i help you on this? Maybe collecting some logs?
What about Alpha3 or android? To boot android you don't have to flash whole system, just boot cm11 kernel via fastboot. Have you tried to set "Prefer 3G" in cellular settings?
To get most basic logs, reboot phone and try to send sms, then:
Code:
dmesg
journalctl --no-page
logcat -b radio
If it's something more serious then you will need to follow:
https://jolla.zendesk.com/hc/en-us/articles/203761078-How-to-collect-SMS-logs-
Thanks so much for 3.0.2.8 - works great. Really hope you're able to give us a 3.0.3 with the updated browser.
Don't know if you have any interest/knowledge on Maemo Leste or PMOS, but since you're the most knowledgeable person on the Photon Q, just wondered if you could hazzard a guess as to how possible it might be to get them working on this device further down the line?
Thanks again.
Yes, updated browser is tempting so I will definitely bring 3.0.3 when it will be available for ported devices.
Unfortunately I have never ported Leste or Postmarketos so I have limited knowledge here.
With Photon there are several issue like: no sim without modification and no flex cable to buy. Also we are stuck with android drivers and ancient 3.0 kernel with no chance for upstream. It means to run anything (in usable form) other than android we need libhybris. I think there are better devices with more active developers for these systems: droid 4 - have ongoing upstream efforts, Fxtec pro1 for sure will have 4.x or even 5.x kernel. That's why you will not find photon in actively supported devices in postmarketos or leste site.
- Leste use hildon-desktop (x window manager) so it would be probably not trivial to get libhybris based ui acceleration if it's possible at all. Is that os even daily usable?
- After a quick read of Postmarketos wiki looks like it support wayland based compositor like weston so it is a good sign. I was able to run libhybris accelerated weston in ubuntu chroot in sailfish. It has some touch issues but it may be because I run it nested in lipstick. From what I understand if device doesn't have upstream kernel then postmarketos requires ported halium and lxc containers. That might be not possible because of 3.0 kernel but you will never know until you try.
Take everything I said with a grain of salt and start porting. For halium you will probably need newer base than cm11. There are few important commits which are needed otherwise kernel will not work.
SMS issue could be general ofono bug: https://together.jolla.com/question...installing-3028/?answer=205366#post-id-205366
Jolla is focused on android8 base so older bases are neglected. Upstream libhybris is also broken for hybris-11 base.

[ROM] Unofficial LineageOS 16.0 PQ3A.190801.002] for ZTE Blade S6 (P839F30)

Code:
[I]DISCLAIMER[/I]
[COLOR="red"]Do not mirror my builds![/COLOR] Please post a link to this thread instead.
All information and files — both in source and compiled form — are provided on an as is basis.
No guarantees or warranties are given or implied. The user assumes all risks of any damages
that may occur, including but not limited to loss of data, damages to hardware, or loss of
business profits. Please use at your own risk. Note that unless explicitly allowed by the
warranty covering your device, it should be assumed that any warranty accompanying your
device will be voided if you tamper with either the system software or the hardware.
Introduction
This is my unofficial build of LineageOS 16.0 for the ZTE Blade S6 aka P839f30.
This is the first alpha release, so be aware that issues could arise.
I have tested this version with my AS variant device. Other variants have to be tested.
Click to expand...
Click to collapse
Features
working:
phone: calls, sms, data.
wifi
bluetooth
sensors
gps: mostly I have used the energy saving mode
sound
camera: rear with flash and front.
torch
headphone detection
swap back and menu button
light: button backlight, brightness control and adaptive brightness, breath light (notification and/or battery)
not working:
SELinux is permissive.
We have to test to find out.
Click to expand...
Click to collapse
Installation instructions
It is best to have installed the latest stock rom beforehand, so modem and all other vendor stuff is up to date.
If you like you can use this mod to have a unified data partition, please proceed with caution.
You will need TWRP or any other custom recovery.
Reboot into recovery and do a nand backup.
Do a factory format.
Download Rom and put it on your phone or use adb sideload.
Install the rom and then clear cache and dalvik cache.
optional: install su and/or gapps (preferable pico).
Click to expand...
Click to collapse
Changelog:
25.05.2021 - new release:
los security patch level 05.05.2021
revert some kernel changes from the last release
add some cpu governors and cpu hotplug
now with Boeffla WakeLock Blocker and other things
wireguard kernel support
22.12.2019 - 1st beta release:
los security patch level 05.12.
kernel supports EU device variant
add autosmp hotplug
add cpu governors blu_active, darkness, lionfish and relaxed
Revert CwMcu sensor driver from SU6 kernel release
24.10.2019 - 2nd alpha release:
los security patch level 05.10.
CwMcu sensor driver from SU6 kernel release, with wake lock disabled
wifi mac is loaded anyway, remove the loading in the wifi driver
give bluetooth a null mac address, to overcome force close error
kang gps from oppo
04.10.2019 - 1st alpha release:
los security patch level 05.09.
initial release of pie
Click to expand...
Click to collapse
Downloads
new release - 25.05.2021:
Google Drive.
first beta release - 22.12.2019:
Google Drive or here.
second alpha release - 24.10.2019:
Google Drive or here.
first alpha release - 04.10.2019:
Google Drive or here.
If you want root use the lineage addon package found here - download arm version.
Install it after flashing the rom or download your favourite root package and install it.
Click to expand...
Click to collapse
Sources
device
msm8916-common
vendor
kernel
Click to expand...
Click to collapse
FAQ
Here you will find some answers to common question which could arise.
Q: How to give root access to an app or adb?
A: First install the su extra package from Lineage OS or any other su tool you like. Then go into settings and about device, click there multiple times on the build number until you unlocked the developer options. Go to developer options and look for root access.
Q: I thing I found an issue, what to do now?
A: Do a logcat or grab a dmesg while having the issue, otherwise we can't say what is happening. Report as much info as possible. Quote your stock rom your device shipped with or which device variant you possess.
Click to expand...
Click to collapse
Thanks To/Credits
Code:
*aquaris-dev team
*aymende7
*PacMM79
*LineageOS team
*many others
XDA:DevDB Information
Unofficial LineageOS 16.0 [PQ3A.190801.002] P839F30, ROM for the ZTE Blade S6
Contributors
lightwars
ROM OS Version: 9.x Pie
ROM Kernel: Linux 3.10.x
Based On: LineageOS 16.0
Version Information
Status: Beta
Current Beta Version: 20191213
Beta Release Date: 2019-12-22
Created 2019-10-04
Last Updated 2019-12-22
many thanks for the new version, i will tested later :good: :highfive:
Hello, works on my ZTE Blade S6 Plus (p839f50)
but only with a fixed updater-script
from Folder: lineage-16.0-20191002-UNOFFICIAL-p839f30.zip\META-INF\com\google\android
the bold text must delete and than save the file
after the start my phone , i have a error message with bluetooth is deactivated
updater-script - original
https://filehorst.de/d/crqjwnjI
updater-script - fixed
https://filehorst.de/d/cbmctorj
new update is in the op.
just small changes and updated security patch level.
Anybody tested with EU device?
... at the moment no time to test myself (to much effort to keep my other devices up-to-date ), just wanted to ask if anybody already tested on EU device (and forgot to post ).
Gtz
Kurt
Kurt Krummbein said:
... at the moment no time to test myself (to much effort to keep my other devices up-to-date ), just wanted to ask if anybody already tested on EU device (and forgot to post ).
Click to expand...
Click to collapse
Answer my own request, gave it a try, didn't boot, screen stayed black and device went into fastboot-mode ... restored my nandroid-backup of stock-EU-B15 .
Next time, i format system and just install rom without gapps and addon-su.
Gtz
Kurt
Kurt Krummbein said:
Answer my own request, gave it a try, didn't boot, screen stayed black and device went into fastboot-mode ... restored my nandroid-backup of stock-EU-B15 .
Next time, i format system and just install rom without gapps and addon-su.
Gtz
Kurt
Click to expand...
Click to collapse
Hello Kurt,
please, if you find the time to do another test. Download the attached zip extract the boot.img and copy it to your device, flash it with twrp right after installing the lineage zip through twrp. report back if something different happens.
I splited the dtb from the zImage and attached the almost stock eu dtb, so maybe we are lucky. But I have not find any big differences in analyzing the dts of EU vs AS and kernel defconfigs EU vs AS.
I can show this files too, if somebody has a better understanding of this.
lightwars said:
Hello Kurt,
please, if you find the time to do another test. Download the attached zip extract the boot.img and copy it to your device, flash it with twrp right after installing the lineage zip through twrp. report back if something different happens.
I splited the dtb from the zImage and attached the almost stock eu dtb, so maybe we are lucky. But I have not find any big differences in analyzing the dts of EU vs AS and kernel defconfigs EU vs AS.
I can show this files too, if somebody has a better understanding of this.
Click to expand...
Click to collapse
Hi!
Well, i loaded the def's and config's into WinMerge and did a compare ... in the def's there are some different addresses, but i have now clue what the meaning of that all is :angel:. The config files look like beeing from different kernel versions, there are some options which don't exist in both, one is modularised, the other is not ... all in all quite strange.
Ok, i made a try with the boot_eu.img:
- Made a factory reset
- Flashed the LOS.zip
- Wiped caches
- unzipped the boot.img
- copied it to boot partition with dd if=boot_eu.img of=/dev/block/bootdevice/by-name/boot
- reboot
... screen goes black, one buzz .... nothing. One the PC the fastboot device appears and that's it. I was looking for tombstones, but couldn't find any ... they are stored to /data/tombstones, are they? I'm not sure, the kernel i getting up high enough to mount /data.
Cheers
Kurt
P.S.: one thing i forgot to mention ... i coulnd't find the "OEM unlock" swich in the stock system anywhere and the bootloader seems to be quite dumb, many commands from fastboot just end in a "command unknown", perhaps there's something left to do on my side (tweak in build.prop etc ... googleed for it no result ).
Kurt Krummbein said:
Ok, i made a try with the boot_eu.img:
- Made a factory reset
- Flashed the LOS.zip
- Wiped caches
- unzipped the boot.img
- copied it to boot partition with dd if=boot_eu.img of=/dev/block/bootdevice/by-name/boot
- reboot
... screen goes black, one buzz .... nothing. One the PC the fastboot device appears and that's it. I was looking for tombstones, but couldn't find any ... they are stored to /data/tombstones, are they? I'm not sure, the kernel i getting up high enough to mount /data.
Click to expand...
Click to collapse
Thanks for testing. You used the reboot system button of twrp I guess. Have you tried to reboot by pressing the power button?
I can think of two things: There is some flag in the kernel source which is called download_mode. I have seen that some devices have different default values! At the moment the value is 0, devices like the ones from bq with msm8916/msm8939 used this too, but devices from oppo with msm8939 uses a value of 1 as default. We can try this one.
Or there is a mask, which defines the restart reason so to speak says the device which mode to boot to. Here we have some differences in the meaning of the bits, a different bit shifting is used.
I can not really think that one of these causes your device to boot into download mode, because the recovery uses the same kernel on both region variants...
lightwars said:
Thanks for testing. You used the reboot system button of twrp I guess. Have you tried to reboot by pressing the power button?
I'll give that one a try .
Hope my device is not "going over the Wupper" LOL (this one has to come somewhen ...)
Click to expand...
Click to collapse
Ok, tried it ... same result. Then did a (perhaps a bit wired) test, just restored boot from my nandroid-backup. With this, the white ZTE bootscreen comes up and after some seconds it reboots to twrp.
Perhaps the dumb-bootloader refuses to boot with AS keys ... otherwise it wouldn't boot recovery. Strange puzzle.
Cheers
Kurt
Kurt Krummbein said:
Ok, tried it ... same result. Then did a (perhaps a bit wired) test, just restored boot from my nandroid-backup. With this, the white ZTE bootscreen comes up and after some seconds it reboots to twrp.
Perhaps the dumb-bootloader refuses to boot with AS keys ... otherwise it wouldn't boot recovery. Strange puzzle.
Cheers
Kurt
Click to expand...
Click to collapse
It is okay to do some unusual testings. I was doing this sort of things also, back then.
I'm not sure I get you, when you write about AS keys. Do you mean the fingerprint in the build.prop? I think I used the ones from the eu version. Maybe they build in some kind of kernel version check inside the bootloader, but only for the eu and other versions.
The cause is, that android needs an advanced kernel, so we can not use the stock kernel to boot newer android version like nougat, oreo or pie.
Sorry, I can not be of much help here, because I do not have a device with eu or some other region version. But we can try do some changes, if you like to do some more testing and maybe get something like a log, last_kmseg or ramoops. We should look to activate some of them.
Hello @Kurt Krummbein,
if you find the time please post the info you get by issuing this commands in the adb shell or on your phone in a terminal:
Code:
su
cat /sys/zte_board_id/board_id
cat /proc/device-tree/model
cat /proc/device-tree/compatible
Do this on your rom or stock rom you are using a the moment. Thank you.
For reference mine output is this:
Code:
Blade-S6:/ # cat /sys/zte_board_id/board_id
wrbA
Blade-S6:/ # cat /proc/device-tree/model
Qualcomm Technologies, Inc. MSM 8939 MTP
Blade-S6:/ # cat /proc/device-tree/compatible
qcom,msm8939-mtp qcom,msm8939 qcom,mtp
It could be that the eu variant uses another device tree inside the kernel, because the bootloader request that, but we have only this model available.
lightwars said:
Hello @Kurt Krummbein,
if you find the time please post the info you get by issuing this commands in the adb shell or on your phone in a terminal:
Code:
su
cat /sys/zte_board_id/board_id
cat /proc/device-tree/model
cat /proc/device-tree/compatible
Do this on your rom or stock rom you are using a the moment. Thank you.
For reference mine output is this:
Code:
Blade-S6:/ # cat /sys/zte_board_id/board_id
wrbA
Blade-S6:/ # cat /proc/device-tree/model
Qualcomm Technologies, Inc. MSM 8939 MTP
Blade-S6:/ # cat /proc/device-tree/compatible
qcom,msm8939-mtp qcom,msm8939 qcom,mtp
It could be that the eu variant uses another device tree inside the kernel, because the bootloader request that, but we have only this model available.
Click to expand...
Click to collapse
Mine is:
cat /sys/zte_board_id/board_id
wrbA-EUROPE
cat: /proc/device-tree/model: No such file or directory
cat: /proc/device-tree/compatible: No such file or directory
ls /proc/device-tree
/proc/device-tree: No such file or directory
Attached my build.prop ... perhaps this sheds some light .
Thx
Kurt
Kurt Krummbein said:
Mine is:
cat /sys/zte_board_id/board_id
wrbA-EUROPE
cat: /proc/device-tree/model: No such file or directory
cat: /proc/device-tree/compatible: No such file or directory
ls /proc/device-tree
/proc/device-tree: No such file or directory
Attached my build.prop ... perhaps this sheds some light .
Thx
Kurt
Click to expand...
Click to collapse
Sorry for that, I forgot that the stock kernel did not expose the device tree.
But I think I remeber the info about the model is in the logcat after boot up...
Please try this ones in a terminal on the phone or via adb shell, they should work.
Code:
su
Blade-S6:/ # cat /sys/devices/soc0/hw_platform
MTP
Blade-S6:/ # cat /sys/devices/soc0/soc_id
239
lightwars said:
Sorry for that, I forgot that the stock kernel did not expose the device tree.
But I think I remeber the info about the model is in the logcat after boot up...
Please try this ones in a terminal on the phone or via adb shell, they should work.
Code:
su
Blade-S6:/ # cat /sys/devices/soc0/hw_platform
MTP
Blade-S6:/ # cat /sys/devices/soc0/soc_id
239
Click to expand...
Click to collapse
mine is:
cat /sys/devices/soc0/hw_platform
MTP
cat /sys/devices/soc0/soc_id
268
cat /sys/devices/soc0/image_version
10:LRX22G:eng.root.20150808.123811
Gtz
Kurt
Kurt Krummbein said:
mine is:
cat /sys/devices/soc0/hw_platform
MTP
cat /sys/devices/soc0/soc_id
268
cat /sys/devices/soc0/image_version
10:LRX22G:eng.root.20150808.123811
Gtz
Kurt
Click to expand...
Click to collapse
Fantastic! Here we have an explanation. Your device reports 268 as id which equals to msm8929 and I have a device with id 239 which is msm8939. The kernel only holds a device tree blob (dtb) for the id 239. I thought that the variant were very similar, so last time I used a dtb from the eu release but only for id 239. Attached I have added a dtb for id 268. Please test this rom with that boot image.
Again, just unpack the bootASEU.img and copy it to your device, flash it after installing the lineageos zip.
Please make a backup beforehand and report back, when you have time. Happy trying out.
lightwars said:
Fantastic! Here we have an explanation. Your device reports 268 as id which equals to msm8929 and I have a device with id 239 which is msm8939. The kernel only holds a device tree blob (dtb) for the id 239. I thought that the variant were very similar, so last time I used a dtb from the eu release but only for id 239. Attached I have added a dtb for id 268. Please test this rom with that boot image.
Again, just unpack the bootASEU.img and copy it to your device, flash it after installing the lineageos zip.
Please make a backup beforehand and report back, when you have time. Happy trying out.
Click to expand...
Click to collapse
One step ahead ! Phone is booting with the new boot.img ... but ends with a bootloop.
Highest was one boot with start of the setup-wizard, but after setting language to "Deutsch (Deutschland)" (and several "Bluetooth is not working" messages) it went around again. Couldn't get logs yet ... well see :
Cheers
Kurt
Kurt Krummbein said:
One step ahead ! Phone is booting with the new boot.img ... but ends with a bootloop.
Highest was one boot with start of the setup-wizard, but after setting language to "Deutsch (Deutschland)" (and several "Bluetooth is not working" messages) it went around again. Couldn't get logs yet ... well see :
Cheers
Kurt
Click to expand...
Click to collapse
Yeah! Would be best to build the dtb from source, rather than attaching just the right one to the kernel...
The bluetooth message can be made silent, by the way what build you are using? I think the first build has not the fix for the message. The build.prop should contain this line:
Code:
ro.boot.btmacaddr=00:00:00:00:00:00
and the message should not appear.
I hope there are not any preferences with could only be applied to msm8939 and not to msm8929.
@Kurt Krummbein
Here is my latest build or just grab the boot.img from the attachment. Which has a dtb for msm8929 build from source.
Maybe this will boot without any bootloop.
lightwars said:
@Kurt Krummbein
Here is my latest build or just grab the boot.img from the attachment. Which has a dtb for msm8929 build from source.
Maybe this will boot without any bootloop.
Click to expand...
Click to collapse
For which version is your latest build? the eu?
Thanks
BR Slawo
slawoko said:
For which version is your latest build? the eu?
Thanks
BR Slawo
Click to expand...
Click to collapse
AS and hopefully EU.

[ROM][UNOFFICIAL] LineageOS 17.1 for Unihertz Atom L (20200828)

Introduction
This thread contains the LineageOS 17.1 custom firmware images for the Unihertz Atom L, a rugged Android phone released by Unihertz in July 2020, and the accompanying LineageOS Recovery used for flashing the firmware.
Please note that this ROM is one of my side projects, for which I could provide zero warranty. By installing this ROM, you acknowledge that you take all the risks that come with installing custom firmwares on your devices, including but not limited to bricking your device, losing your data, etc. You are always suggested to keep backups and make sure you know how to flash back to official ROM before trying any custom ROMs.
Please find the download links in the Download section. The following sections are guides to installing the ROM.
WARNING: DO NOT try to install this on Atom XL. This is ONLY for the Atom L.
Working Features
- All basic features (Telephony, VoLTE, Audio, Camera, NFC, WiFi, Bluetooth, ....)
- Programmable PTT (red) button (Functionality can be set in Settings - System - Buttons, under the "Search Button" section)
- 48MP camera seems to be working (unlike on many other super resolution devices)
Known Issues
- VoLTE is working (at least for me) but sometimes quirky. If you find it somehow stopped working, usually turning it off and back on again (in Settings - Network - Mobile Network) will fix it. Putting the device to SELinux Permissive mode also fixes most of the VoLTE quirks but this is not recommended (a few quirks in Enforcing mode is better than having the whole device Permissive)
Unlocking
1. Boot your Atom L to the official OS
2. Go into Settings - About phone, tap "build number" several times to enable developer settings
3. Go to Settings - System - Developer Settings, enable OEM unlocking and ADB debugging
4. Run `adb reboot bootloader` on your PC (there is no way to enter bootloader directly, only possible through adb)
5. Run `adb flashing unlock` and comfirm unlock on device (THIS WILL WIPE ALL DATA)
6. Reboot and now you should see an unlocked warning during boot screen.
Installing LineageOS Recovery
For now the only working recovery is the LineageOS Recovery, because the device's kernel does not load the touch driver in recovery mode for whatever reason, rendering TWRP useless.
1. Download `lineage_recovery_XXX.img` and `vbmeta.zip`, unpack `vbmeta.zip` to get three .img files starting with `vbmeta`
2. Run `adb reboot bootloader` to put your device in bootloader mode
3. Run `fastboot flash --disable-verification --disable-verity vbmeta vbmeta.img`
4. Run `fastboot flash --disable-verification --disable-verity vbmeta_system vbmeta_system.img`
5. Run `fastboot flash --disable-verification --disable-verity vbmeta_vendor vbmeta_vendor.img`
6. Run `fastboot flash recovery lineage_recovery_XXX.img`
7. Run `fastboot reboot recovery` to reboot into the newly-installed LineageOS Recovery
The LineageOS Recovery is operated by volume keys as selection and power as confirmation (or entering sub-menus). To return to upper levels of menus from sub-menus, press volume up until the selection goes to the first item and then disappears, then press power (i.e. there's a hidden "Go Back" item at the very top of each sub-menu).
The recovery will show a verification failed prompt for most packages that are not signed with the AOSP keys. This is safe to ignore.
Installing LineageOS 17.1
The LineageOS image must be installed via LineageOS recovery.
1. Download `lineage-17.1-Atom_L-XXX.zip`
2. Reboot your device into recovery (`adb reboot recovery` or simply hold volume up while turning power on)
3. Wipe all data (factory reset) (THIS DELETES EVEN INTERNAL STORAGE)
4. Choose Apply Update, then Apply Update from ADB
5. Run `adb sideload lineage-17.1-Atom_L-XXX.zip` from your PC
6. Wait for the process to finish. (The recovery might prompt something about verification failure, just ignore it and continue anyway)
7. At this point, you can then sideload the LATEST Magisk and OpenGAPPS Nano at your will (note that the size of the system partition might only be enough for the `nano` variant of OpenGAPPS) (If installing Magisk / OpenGAPPS fails, you can try rebooting into recovery again in advanced menus, then try installing them again)
8. Reboot into system and enjoy (Note that Magisk might cause your device to boot loop once or two but it will eventually boot)
When updating to a newer build, you have to flash the new zip, and then re-flash whatever mod you have installed previously (Magisk / GAPPS).
Download Links
LineageOS:
lineage-17.1-Atom_L-20200828-peter-signed.zip: https://mega.nz/file/bAgh1BZA#jzMs_0e9NUR9NcALXWp51ZeWttM5rl_3K5T8Or9hAW0
- Synchronized updates from LineageOS upstream.
lineage-17.1-Atom_L-20200728-peter-signed.zip: https://mega.nz/file/vBwlmL5D#wpw8RovBHyVFCLFlhQ2H5QAIb0ECXkT4of0FRijiP6A
LineageOS Recovery:
lineage_recovery_20200728.img: https://mega.nz/file/yc4Dnbyb#yx0Ci9p3q9_lfAiXkGfgWDFnRJI-JSGrv3kyawkU3fw
vbmeta:
vbmeta.zip: https://mega.nz/file/nF51mBoY#ZNY4j92wc_6a1dXch3l5r-w4VFl9QjN7YJaRMKRoEGk
XDA:DevDB Information
LineageOS 17.1 for Unihertz Atom L, ROM for the Android General
Contributors
PeterCxy
Source Code: https://cgit.typeblog.net/android/device/unihertz/Atom_L/
ROM OS Version: Android 10
Version Information
Status: Alpha
Created 2020-07-28
Last Updated 2020-07-28
How different is the Atom XL?
PeterCxy said:
Introduction
WARNING: DO NOT try to install this on Atom XL. This is ONLY for the Atom L.
Unfortunately I've got the XL version which I thought only varied from the L by the presence of a UHF radio! Can you explain to me why its not a suitable candidate for your mods which sound very good!?
And before you ask, I only got this radio for hacking so I don't mind experimenting if that is required. Please let me know if I can help.
The Bitfarmer
Click to expand...
Click to collapse
tvroman said:
PeterCxy said:
Introduction
WARNING: DO NOT try to install this on Atom XL. This is ONLY for the Atom L.
Unfortunately I've got the XL version which I thought only varied from the L by the presence of a UHF radio! Can you explain to me why its not a suitable candidate for your mods which sound very good!?
And before you ask, I only got this radio for hacking so I don't mind experimenting if that is required. Please let me know if I can help.
The Bitfarmer
Click to expand...
Click to collapse
Because Unihertz publishes completely different firmware files for the L and XL, so the safest assumption is that there is more difference than just the UHF radio. If you want to risk it, then you CAN try using this ROM on the XL, as long as you know how to revert back to official if things go wrong. (But I cannot guarantee if the kernel image from L that this ROM uses will not cause serious issues like corrupted baseband or something on the XL)
My suggestion is that instead of trying this ROM directly on the XL, someone with XL can try to modify my device tree for L, replacing the kernel, dtbo images and other vendor blobs from the ones from XL, and then re-compile the ROM for XL. This would be the proper way to handle these two devices.
Click to expand...
Click to collapse
Going XL
Hi.
Great work. :good:
I want to built a ROM for the Atom XL myself. And because I'm no expert on this (for now) I'm in search of guides and hints on how to achieve my goal.
As far as I know the biggest problem with Unihertz is that they use a Mediatek chipset with which they are not allowed to provide the sourcecode of the kernel. Or at least you have to pay for it from Mediatek.
But there are some variants of the chipset (Helio P60; mt6771) used in other mobile phones (e.g. Nokia X5) for which I was able to find kernelsources on Github. Using these and the latest Android kernel from google I tried to compile a kernel as a starting point. I was able to extract the build.config directly from the phone which helped tremendously. This should at least get me to the point where I'm able to assemble a TWRP build. But I believe that I'm still missing some (vital?) drivers which are specific to the actual device. This includes I think the missing touchscreen driver that you mentioned is preventing the recovery to be useful.
So now I'm a little bit stuck, because most of the guides to arrange a LineageOS (or any other custom ROM) build tree I found require the sourcecode from the manufacturer which we don't have. All other guides to build from scratch were too generic for my current level of expertise.
Can you please share your approach to create this build?
If you don't want to do this in the open you could also PM me.
With kind regards
ADT
a-dead-trousers said:
Hi.
Great work. :good:
I want to built a ROM for the Atom XL myself. And because I'm no expert on this (for now) I'm in search of guides and hints on how to achieve my goal.
As far as I know the biggest problem with Unihertz is that they use a Mediatek chipset with which they are not allowed to provide the sourcecode of the kernel. Or at least you have to pay for it from Mediatek.
But there are some variants of the chipset (Helio P60; mt6771) used in other mobile phones (e.g. Nokia X5) for which I was able to find kernelsources on Github. Using these and the latest Android kernel from google I tried to compile a kernel as a starting point. I was able to extract the build.config directly from the phone which helped tremendously. This should at least get me to the point where I'm able to assemble a TWRP build. But I believe that I'm still missing some (vital?) drivers which are specific to the actual device. This includes I think the missing touchscreen driver that you mentioned is preventing the recovery to be useful.
So now I'm a little bit stuck, because most of the guides to arrange a LineageOS (or any other custom ROM) build tree I found require the sourcecode from the manufacturer which we don't have. All other guides to build from scratch were too generic for my current level of expertise.
Can you please share your approach to create this build?
If you don't want to do this in the open you could also PM me.
With kind regards
ADT
Click to expand...
Click to collapse
You don't need the kernel source code to build a working ROM -- just look at my device tree for Atom L. I think you can build a working ROM for the XL by just replacing the prebuilt kernel in my device tree with the one from Atom XL and also re-extracting the vendor blobs from XL using the script in my devcie tree, then rename everything to Atom XL instead of L. I don't know if the integrated amateur radio would still work though.
PeterCxy said:
You don't need the kernel source code to build a working ROM -- just look at my device tree for Atom L. I think you can build a working ROM for the XL by just replacing the prebuilt kernel in my device tree with the one from Atom XL and also re-extracting the vendor blobs from XL using the script in my devcie tree, then rename everything to Atom XL instead of L. I don't know if the integrated amateur radio would still work though.
Click to expand...
Click to collapse
I'm already on to that.
But I seem to have trouble extracting the prebuilt kernel. None of the tools I found gave me the exact files you have got (dtb.img, dtbo.img, Image.gz). What did you use?
The best I could get were "dtb", "kernel" and "dtborecovery" (without extensions) which roughly had the same size as yours.
Also, as far as I understand it, with your initial commit (without the modifications for Lineage itself) I should be able to at least compile a recovery image but I got an error regarding a missing dtb.img file in the "out" directory.
Something seems to be missing because, my dtb file is in the "device" directory and not being transfered into "out" during building.
I'm not sure that is because I have got a different naming scheme (renamig it didn't help) or I did something wrong with the extraction.
---------- Post added at 07:30 ---------- Previous post was at 07:14 ----------
Another question I have:
Are the vbmeta-files you used to flash the recovery the ones from the original firmeware zip from unihertz or did you get them from the lineage built?
And reguarding the rather smallish system partition:
I have an idea to bypass that by using the SPFlash Tool from Mediatek. As far as I understand the settings in the scatter-file this tool does a repartitioning of the internal storage. So we only need to "decrease" the userdata, "move" some partitions inbetween and "increase" the system. Only problem is, I couldn't find a partition designated as "system" in the scatter-file, only one big "super" and a "vbmeta-system" (which for my understaning is for verified boot) partition.
What do you think?
a-dead-trousers said:
I'm already on to that.
But I seem to have trouble extracting the prebuilt kernel. None of the tools I found gave me the exact files you have got (dtb.img, dtbo.img, Image.gz). What did you use?
The best I could get were "dtb", "kernel" and "dtborecovery" (without extensions) which roughly had the same size as yours.
Also, as far as I understand it, with your initial commit (without the modifications for Lineage itself) I should be able to at least compile a recovery image but I got an error regarding a missing dtb.img file in the "out" directory.
Something seems to be missing because, my dtb file is in the "device" directory and not being transfered into "out" during building.
I'm not sure that is because I have got a different naming scheme (renamig it didn't help) or I did something wrong with the extraction.
---------- Post added at 07:30 ---------- Previous post was at 07:14 ----------
Another question I have:
Are the vbmeta-files you used to flash the recovery the ones from the original firmeware zip from unihertz or did you get them from the lineage built?
And reguarding the rather smallish system partition:
I have an idea to bypass that by using the SPFlash Tool from Mediatek. As far as I understand the settings in the scatter-file this tool does a repartitioning of the internal storage. So we only need to "decrease" the userdata, "move" some partitions inbetween and "increase" the system. Only problem is, I couldn't find a partition designated as "system" in the scatter-file, only one big "super" and a "vbmeta-system" (which for my understaning is for verified boot) partition.
What do you think?
Click to expand...
Click to collapse
> None of the tools I found gave me the exact files you have got (dtb.img, dtbo.img, Image.gz). What did you use?
There is a tool called `unpack_bootimg` in the Android source code. Just run `make unpack_bootimg` in the root directory of the Android source tree and you will get one in the output directory. (btw I have renamed those extracted files so the names won't exactly match, but you need this tool to extract the correct images. All other tools won't work properly).
> my dtb file is in the "device" directory and not being transfered into "out" during building.
Because most tools other than `unpack_bootimg` extracts dtb incorrectly.
> Are the vbmeta-files you used to flash the recovery the ones from the original firmeware zip from unihertz or did you get them from the lineage built?
Those don't matter. Either will work as long as you flash it with the correct parameters as given in my post.
> And reguarding the rather smallish system partition
No don't do that. Android 10 does not use a separate system partition anymore, instead both system, vendor and product are sub-partitions in a huge super partition. When flashing a new ROM, the partitions are automatically resized to match the new image exactly, instead of leaving free space unused like before Android 10. That's why I need to reserve space in BoardConfig.mk for gapps to be installed correctly.
Still not able to build.
PeterCxy said:
There is a tool called `unpack_bootimg` in the Android source code. Just run `make unpack_bootimg` in the root directory of the Android source tree and you will get one in the output directory. (btw I have renamed those extracted files so the names won't exactly match, but you need this tool to extract the correct images. All other tools won't work properly).
Click to expand...
Click to collapse
I'm still getting an error:
Code:
FAILED: ninja: 'out/target/product/Atom_XL/dtb.img', needed by 'out/target/product/Atom_XL/boot.img', missing and no known rule to make it
Comparing your BoardConfig.mk with mine shows a slight difference in the offset and size values which could be associated with the different kernels of the phones.
But using "unpack_bootimg" I didn't get a value for "BOARD_KERNEL_OFFSET" like you have it in your config. Could this be the problem?
Your BoardConfig.mk
My BoardConfig.mk
Do you see anything else out of the ordinary?
(Because I'm doing everything what you did step-by-step the links point to the best matching commits)
Despite not being able to compile right now I tried to press on with integrating your changes in the hopes that it will be fixed somehow later on
So I'm currently stuck on this commit of yours:
Atom_L: import overlay from official vendor
Where did you get the "config.xml" and "power_profile.xml" from? The best thing I could find was a "power_profile.xml" inside "/vendor/overlay/FrameworkResOverlay/FrameworkResOverlay.apk" which seems to be a "compiled" version of the aforementioned xml-file.
a-dead-trousers said:
I'm still getting an error:
Code:
FAILED: ninja: 'out/target/product/Atom_XL/dtb.img', needed by 'out/target/product/Atom_XL/boot.img', missing and no known rule to make it
Comparing your BoardConfig.mk with mine shows a slight difference in the offset and size values which could be associated with the different kernels of the phones.
But using "unpack_bootimg" I didn't get a value for "BOARD_KERNEL_OFFSET" like you have it in your config. Could this be the problem?
Your BoardConfig.mk
My BoardConfig.mk
Do you see anything else out of the ordinary?
(Because I'm doing everything what you did step-by-step the links point to the best matching commits)
Despite not being able to compile right now I tried to press on with integrating your changes in the hopes that it will be fixed somehow later on
So I'm currently stuck on this commit of yours:
Atom_L: import overlay from official vendor
Where did you get the "config.xml" and "power_profile.xml" from? The best thing I could find was a "power_profile.xml" inside "/vendor/overlay/FrameworkResOverlay/FrameworkResOverlay.apk" which seems to be a "compiled" version of the aforementioned xml-file.
Click to expand...
Click to collapse
> Comparing your BoardConfig.mk with mine shows a slight difference in the offset and size values which could be associated with the different kernels of the phones.
TARGET_KERNEL_OFFSET should normally always be 0x00008000. Also, your other offset values seem to be wrong too -- those values from `unpack_bootimg` cannot be filled in directly to BoardConfig.mk. Instead, you need to subtract BOARD_KERNEL_BASE from them (e.g. BOARD_RAMDISK_OFFSET should be 0x55000000 - 0x40078000, which is 0x14f88000, the same as mine). In fact, I think those parameters should be exactly the same for XL and L. Other than that, I don't think I can see much of a problem about your makefiles.
However, note that not all of my historical commits represent a compilable state of the device tree. I'd suggest you start directly from the latest state and just replace whatever is relevant instead of starting over. And there should not be much that needs changing at all except device names, fingerprints and the proprietary vendor files.
> Where did you get the "config.xml" and "power_profile.xml" from
Exactly from those apks. Just decompile them using apktool.
PeterCxy said:
TARGET_KERNEL_OFFSET should normally always be 0x00008000. Also, your other offset values seem to be wrong too -- those values from `unpack_bootimg` cannot be filled in directly to BoardConfig.mk. Instead, you need to subtract BOARD_KERNEL_BASE from them (e.g. BOARD_RAMDISK_OFFSET should be 0x55000000 - 0x40078000, which is 0x14f88000, the same as mine). In fact, I think those parameters should be exactly the same for XL and L. Other than that, I don't think I can see much of a problem about your makefiles.
Click to expand...
Click to collapse
Still giving me errors.
So I tried a very unconventional approach: I just copied the file myself into the mentioned "out/target/product/Atom_XL" folder.
For now it's still compiling. Fingers crossed.
PeterCxy said:
However, note that not all of my historical commits represent a compilable state of the device tree. I'd suggest you start directly from the latest state and just replace whatever is relevant instead of starting over. And there should not be much that needs changing at all except device names, fingerprints and the proprietary vendor files.
Click to expand...
Click to collapse
I just reached your biggest commit yet.
Can you tell me how you got the list of needed files? I hope it's not through trial-and-error.
Except for the values in "setup-makefiles.sh" only the "proprietary-files.txt" seems to be device specific. Is there anything else I need to be aware of in this commit?
P.S.: I know it is tedious to go through your commits one by one but I want to learn something of it not just simply copying what you did. To get a feeling where the biggest pitfalls are and what you did to circumvent them.
a-dead-trousers said:
Still giving me errors.
So I tried a very unconventional approach: I just copied the file myself into the mentioned "out/target/product/Atom_XL" folder.
For now it's still compiling. Fingers crossed.
I just reached your biggest commit yet.
Can you tell me how you got the list of needed files? I hope it's not through trial-and-error.
Except for the values in "setup-makefiles.sh" only the "proprietary-files.txt" seems to be device specific. Is there anything else I need to be aware of in this commit?
P.S.: I know it is tedious to go through your commits one by one but I want to learn something of it not just simply copying what you did. To get a feeling where the biggest pitfalls are and what you did to circumvent them.
Click to expand...
Click to collapse
> Still giving me errors.
Looks like that dtb.img error was totally my fault -- it was due to my jerry-rigged solution of using prebuilt dtb image that conflicted with one of Lineage's update in August and I haven't built the ROM for a month. Now I have fixed it in the latest commit.
> Can you tell me how you got the list of needed files?
All of those files are for VoLTE support and I started with the list from a commit in Redmi Note 7 Pro's device tree that imported those VoLTE blobs, and then added what was missing one by one (when something is missing the Phone process will crash and you can see what got missing in the logs). I don't think the list will be any different on Atom XL so you can just use the one in my device tree.
Hi.
Thanks to you everything is running smoothly here. But what bugs me is that TWRP is not working on our devices.
Although for the Atom there is a possibility: https://forum.xda-developers.com/android/development/twrp-modded-to-unihertz-atom-t3885793
Before I want to go public with my build I wanted to solve this last "mystery".
So I tried to include it in my current source tree according to the (official?) guide but some errors prevented me from a successful build.
Naturally I asked for some guidance at the most reasonable places I know of but got nothing so far:
https://forum.xda-developers.com/showpost.php?p=83443611&postcount=4622
https://forum.xda-developers.com/showpost.php?p=83455271&postcount=4623
https://github.com/TeamWin/android_bootable_recovery/issues/70
I even tried different repositories (omnirom/android_bootable_recovery) and revisions (android-9.0) but these resulted in missing library "type" (static vs. shared) errors so I assume these are too old for LineageOS 17.1
What I want to know is how you managed to get TWRP to built for your device even though the touchscreen wasn't working?
Did you use your LineageOS source tree or one of the many "minimal" manifests? If so, which one would be the "best" to use?
wkr ADT
@PeterCxy and @a-dead-trousers
Thanks for all the work on this so far. I've got an Atom L and have gotten the ROM's PeterCxy posted running on them as in the OP. Do either of you have a quick step-by-step workflow of how you got all the Lineage sources set up and built into the various ROMs? I'd like to be able to build the ROMs from scratch and understand the process.
If I can get caught up to where you two are at with the builds, I can help debug, test and work through issues.
dirtylimerick said:
[MENTION=5351691] Do either of you have a quick step-by-step workflow of how you got all the Lineage sources set up and built into the various ROMs? I'd like to be able to build the ROMs from scratch and understand the process.
If I can get caught up to where you two are at with the builds, I can help debug, test and work through issues.
Click to expand...
Click to collapse
I documented my steps to setup up the build environment in the readme of my repo:
https://github.com/ADeadTrousers/android_device_Unihertz_Atom_XL
But leave out the TWRP part. It isn't working yet mostly because TeamWin/android_bootable_recovery and LineageOS/android_bootable_recovery are too similar.
To figure out all the bits and pieces needed for the device I followed the commit log of @PeterCxy build.
Hi, @PeterCxy.
Finally I was able to build a TWRP recovery and surprise, surprise the touchscreen isn't working.
But during my attempts to get a working TWRP build I came acros a guide that explains how to patch the kernel to get the touchscreen to work.
https://forum.hovatek.com/thread-27132.html
So I tried to follow it but failed to identify the "end" of the zipped Image-file (step 18) to remove the payload from the gz-file. Regardless of which of the null-bytes I use for cutting I always get a warning from 7-zip that there is still data at the end.
Do you know a better approach to achieve this whole patching? Maybe even come up with a scripting solution to easily apply this patch in later builds?
wkr ADT
a-dead-trousers said:
Hi, @PeterCxy.
Finally I was able to build a TWRP recovery and surprise, surprise the touchscreen isn't working.
But during my attempts to get a working TWRP build I came acros a guide that explains how to patch the kernel to get the touchscreen to work.
https://forum.hovatek.com/thread-27132.html
So I tried to follow it but failed to identify the "end" of the zipped Image-file (step 18) to remove the payload from the gz-file. Regardless of which of the null-bytes I use for cutting I always get a warning from 7-zip that there is still data at the end.
Do you know a better approach to achieve this whole patching? Maybe even come up with a scripting solution to easily apply this patch in later builds?
wkr ADT
Click to expand...
Click to collapse
There is no sane way to solve the problem without kernel source code. Basically the stock kernel just does not load the touch screen driver in recovery mode. That patching guide is pretty out of date and I imagine it won't work on most recent kernels. The only proper way is to pressure Unihertz to actually obey GPLv2 and release their kernel source code. Or maybe someone can try reverse-engineering the kernel, but at least I won't do it because it'll just be too much of a hassle.
PeterCxy said:
There is no sane way to solve the problem without kernel source code. Basically the stock kernel just does not load the touch screen driver in recovery mode. The only proper way is to pressure Unihertz to actually obey GPLv2 and release their kernel source code.
Click to expand...
Click to collapse
I'm with you on this one, but as long as we don't have the source code we need to resort to other means to achieve our goals.
PeterCxy said:
That patching guide is pretty out of date and I imagine it won't work on most recent kernels.
Click to expand...
Click to collapse
Yeah it's from way back in 2019
Anyway, with a little bit of tinkering I was able to modify my kernel to load the touchscreen driver in recovery mode.
Here is the device tree and the manifest i used.
I wouldn't recommend to use it in it's current state at all though because the fstab needs a little bit of tinkering. Everything seems to be either unordered or not mounted properly and I fear anything you do in there now will mess up the whole device. BUT I got the touchscreen goin for me which is nice.
PeterCxy said:
Or maybe someone can try reverse-engineering the kernel, but at least I won't do it because it'll just be too much of a hassle.
Click to expand...
Click to collapse
As soon as I have everything sorted out that needs to be fixed on my build (e.g. signing, radio, included gapps working properly, TWRP) I want to dig deeper into the kernel.
There are some devices with Helios P60 out there from other vendors which offer kernel sources.
P.S.: I also uploaded a HOW-TO in my device tree.
If you or someone else wants to try it. Also if you want to you can send me a "symbl.txt" (see to the HOW-TO) extracted from your device then I can do the patching for the Atom_L too.
a-dead-trousers said:
I'm with you on this one, but as long as we don't have the source code we need to resort to other means to achieve our goals.
Yeah it's from way back in 2019
Anyway, with a little bit of tinkering I was able to modify my kernel to load the touchscreen driver in recovery mode.
Here is the device tree and the manifest i used.
I wouldn't recommend to use it in it's current state at all though because the fstab needs a little bit of tinkering. Everything seems to be either unordered or not mounted properly and I fear anything you do in there now will mess up the whole device. BUT I got the touchscreen goin for me which is nice.
As soon as I have everything sorted out that needs to be fixed on my build (e.g. signing, radio, included gapps working properly, TWRP) I want to dig deeper into the kernel.
There are some devices with Helios P60 out there from other vendors which offer kernel sources.
P.S.: I also uploaded a HOW-TO in my device tree.
If you or someone else wants to try it. Also if you want to you can send me a "symbl.txt" (see to the HOW-TO) extracted from your device then I can do the patching for the Atom_L too.
Click to expand...
Click to collapse
Happy to hear that you were able to figure the touchscreen out. I tried to port TWRP at the very beginning when I started tinkering with the device but quickly grew frustrated and just ported Lineage Recovery instead. I guess I might try patching the kernel image too at some point later.
BTW, for TWRP to work with devices released after Android 10, I'm pretty sure you need an extra set of patches that are not yet fully merged to the main TWRP repository. I remember there's some guy providing another manifest with all the patches applied but I couldn't remember the name.
Hi.
I just officially announced my build for the Atom XL:
https://forum.xda-developers.com/android/development/rom-lineageos-17-1-unihertz-atom-xl-t4171407
Could you please put a link in your first post for those in search of the Atom XL and found your thread instead. Thanks.
wkr ADT
hi @PeterCxy.
During my daily usage of the phone I encountered a strage problem:
The audio jack isn't working. Plugging in some headphones I get this slight click in the earpieces when the circuits connect but nothing else happens. Neither a "headphone" icon in the status bar nor hearing anything coming from the headphones itself. The main speaker of the phone keeps playing the music. Using bluetooth everything is working as expected though. So I used logcat to see if something is coming up during plugging in but nothing "catchy" shows up in the logs. My guess is that some (vendor?) service is missing or not started during booting. Next I checked If something shows up on logcat during boot but I'm not sure for what to look exactly. There are quite a few errors and warnings though. In my despair I started to "fix" the "avc: denied" (SEPolicy) entries. Thats when I found a specific error reguarding VoLTE. Maybe this would fix the problems you had with VoLTE in enforcing mode:
https://github.com/ADeadTrousers/an..._Atom_XL/blob/master/sepolicy/private/init.te
(The line with "socket_device:sock_file")
My provider doesn't support VoLTE so I'm not sure if this helps or not. Maybe you could check it.
Anyway can you please tell me if your device's audio jack is working or not?
If you're (by some mysterious coincidence) not affected by this, can you at least give me some pointers for what to look for to get this fixed on my side.
The Internet Is not very helpful when searching for "android audio jack" or something similiar.
Thanks in advance.
wkr ADT

DEVICE WIFI MAC ADDRESS UNAVAILABLE

A couple of weeks ago my phone crashed out of nowhere and QUALCOLM CRASHDUMP MODE was displayed. I got it fixed but since then my wifi isn't turning on. Bluetooth works just fine. Its only the wifi that is causing problem. a few days later it again crashed which forced me to move to a custom ROM; lineage OS. I thought it might fix the issue, but invain. My phone just wont tun on the wifi. The about section says device wifi mac address unavailable. I used busy box and terminal emulator as suggested in one of the post to know the original MAC address but its value tuned out something like this hwdr 00:00:00:00
Any help guys?
.... test MCDKernel.... fixed my WLAN Problem
Release mcd r16 · mcdachpappe/android_kernel_oneplus_sdm845
Two-in-One kernel image installer: The installer detects your current installed OS (OxygenOS / custom ROM) and flashes the correct image file. Prerequisite: An updated firmware isn't needed anymor...
github.com
lamahgra said:
.... test MCDKernel.... fixed my WLAN Problem
Release mcd r16 · mcdachpappe/android_kernel_oneplus_sdm845
Two-in-One kernel image installer: The installer detects your current installed OS (OxygenOS / custom ROM) and flashes the correct image file. Prerequisite: An updated firmware isn't needed anymor...
github.com
Click to expand...
Click to collapse
Can you please tell me step by step process of how to do it. I seem to be messing up somewhere. Pleasseee *_*
flash mcd kernel zip via twrp
mcd-kernel= https://github.com/mcdachpappe/android_kernel_oneplus_sdm845/releases/tag/r17
lamahgra said:
flash mcd kernel zip via twrp
mcd-kernel= https://github.com/mcdachpappe/android_kernel_oneplus_sdm845/releases/tag/r17
Click to expand...
Click to collapse
please can you tell me step by step process. I don't know much about this. I can follow commands tho *_*
OnePlus 6 (enchilada)
Disclaimer:Team Win strives to provide a quality product. However, it is your decision to install our software on your device. Team Win takes no ...
twrp.me
lamahgra said:
OnePlus 6 (enchilada)
Disclaimer:Team Win strives to provide a quality product. However, it is your decision to install our software on your device. Team Win takes no ...
twrp.me
Click to expand...
Click to collapse
update : didnt work. ANy other thing i could try?

Categories

Resources