Hi guys,
First time posting on XDA so hope I have the right section etc...
I am trying to compile and boot the kernel for the Xiaomi Mi Note 2 and have had some success, but the image created causes the phone to boot into recover. Can I check my build procedure with your please?
The Xiaomi GitHub wiki page has an guide for another phone, which I have followed as far as possible.
Anyway, here are the steps I have taken. Have I missed anything out in terms of configuration?
Step 1: Clone the Xiaomi git repo using:
git clone [email protected]:MiCode/Xiaomi_Kernel_OpenSource.git
Step 2: Checkout the Scorpio branch:
git checkout scorpio-m-oss
Step 3: Get the release tag for the QualComm suported Android Enablement Project: For the Mi Note 2 it I have used LA.UM.5.5.r1-04600-8x96.0.
Step 4: Download the QAEP:
repo init -u git://codeaurora.org/platform/manifest.git -b release -m LA.UM.5.5.r1-04600-8x96.0.xml –-repo-url=git://codeaurora.org/tools/repo.git --repo-branch=caf-stable --depth=1
repo sync -j8
Step 7: Merge Xioami Linux Kernel into QAEP: From the QAEP repo dir...
rm -rf kernel/*
mkdir kernel
cp -rf ~/Mi_Kernel/Xiaomi_Kernel_OpenSource/* kernel/
Step 8: Build Kernel
source build/envsetup.sh
lunch msm8996-userdebug
make bootimage BOARD_USES_LIBC_WRAPPER=true
I found that I had to specify BOARD_USES_LIBC_WRAPPER=true as otherwise there would be a link error in the build as the symbol __propClientDispatchWrite would not be defined. Searching for this symbol I found that it is defined in ./bionic/libc/codeaurora/PropClientDispatchWrite.cpp:48. Looking at the Makefile ./bionic/libc/Android.mk one can see that this file is only compiled if ifeq ($(BOARD_USES_LIBC_WRAPPER),true), hence the need for the extra define in the command line for make.
Step 9: Put kernel image into original
Download the original image and unpack:
adb pull /dev/block/sde36 boot_minote2_original.img
./mkboot boot_minote2_original.img boot_minote2_original
Do that same with mkboot for the image I built and unpack that. Then copy the file kernel from the newly build version into boot_minote2_original and repackage:
./mkboot boot_minote2_original boot_minote2_new.img
Step 9: Attempt to boot new image
adb reboot bootloader
fastboot boot boot_minote2_new.img
And, almost there. The new image boots to a state where I can at least ADB shell into the device. The logcat shows the following significant errors when compared to the logcat of the original xiaomi image:
W SystemServer: ***********************************************
E SystemServer: BOOT FAILURE making display ready
E SystemServer: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.android.server.wm.WindowManagerService.displayReady()' on a null object reference
E SystemServer: at com.android.server.SystemServer.startOtherServices(SystemServer.java:594)
E SystemServer: at com.android.server.SystemServer.run(SystemServer.java:281)
E SystemServer: at com.android.server.SystemServer.main(SystemServer.java:179)
E SystemServer: at java.lang.reflect.Method.invoke(Native Method)
E SystemServer: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:738)
E SystemServer: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:628)
E System : ******************************************
E System : ************ Failure starting system services
E System : java.lang.NullPointerException: Attempt to invoke virtual method 'void com.android.server.wm.WindowManagerService.showBootMessage(java.lang.CharSequence, boolean)' on a null object reference
E System : at com.android.server.am.ActivityManagerService.showBootMessage(ActivityManagerService.java:6474)
E System : at com.android.server.SystemServer.startOtherServices(SystemServer.java:627)
E System : at com.android.server.SystemServer.run(SystemServer.java:281)
E System : at com.android.server.SystemServer.main(SystemServer.java:179)
E System : at java.lang.reflect.Method.invoke(Native Method)
E System : at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:738)
E System : at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:628)
D AndroidRuntime: Shutting down VM
E AndroidRuntime: *** FATAL EXCEPTION IN SYSTEM PROCESS: main
E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.android.server.wm.WindowManagerService.showBootMessage(java.lang.CharSequence, boolean)' on a null object reference
E AndroidRuntime: at com.android.server.am.ActivityManagerService.showBootMessage(ActivityManagerService.java:6474)
E AndroidRuntime: at com.android.server.SystemServer.startOtherServices(SystemServer.java:627)
E AndroidRuntime: at com.android.server.SystemServer.run(SystemServer.java:281)
E AndroidRuntime: at com.android.server.SystemServer.main(SystemServer.java:179)
E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:738)
E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:628)
So, onwards with my investigations but if any one has tips and clues to share, please lemme know
Trying to ask help from StoneTrapper !! He is the only one developer in this forum until now ...
Hey did you ever figure this out? Struggling with my Blu Life One X2 kernel. Compiling it without the QAEP tree boots, but the display goes all glitchy and just shows black. I can adb and everything else works.
Trying your method of QAEP now. Please let me know if you found anything new!
Hey, sorry I hadn't been keeping an eye on this thread.
I don't really use MIUI so haven't tried to compile the kernel for it. The current kernels that are around for these devices are based on generic similar devices with source code taken and adjusted from MiCode where needed.
Since this kernel base is also marshmallow for the more recent MIUI releases it'll need updating for that too.
For building a MIUI kernel your best bet is to take a look at other devices in the same family that currently have third party MIUI kernels. A good example is the DragonXia Kernel which is MIUI compatible. You'll need to add the missing features required for scorpio and add msm8996pro support but between MiCode and various sources it's do-able.
If you're successful and happy with the result then the author may be happy for you to release with permission.
Hi , I have finished building AOSPA for Zenfone 5 , but it bootloop , I need help !!!!
Logcat : https://drive.google.com/file/d/1hFQm7QUijLEuPnFLw6YzgpxQC1P3ZY4-/view?usp=sharing
WVMExtractor: Failed to open libwvm.so: dlopen failed: cannot locate symbol "_Z8WV_SetupRP9WVSessionP12WVFileSourceRKSsR13WVCredentials14WVOutputFormatmPv" referenced by "/system/vendor/lib/libwvm.so"...
01-17 23:03:59.008 221 221 E linker : /system/lib/libmfldadvci.so: has text relocations
01-17 23:03:59.011 221 221 E HAL : load: module=/system/lib/hw/camera.vendor.redhookbay.so
01-17 23:03:59.011 221 221 E HAL : dlopen failed: /system/lib/libmfldadvci.so: has text relocations
MediaPlayer-JNI: dlopen failed: library "libextmedia_jni.so" not found
nguyenhung9x said:
Hi , I have finished building AOSPA for Zenfone 5 , but it bootloop , I need help !!!!
Logcat : https://drive.google.com/file/d/1hFQm7QUijLEuPnFLw6YzgpxQC1P3ZY4-/view?usp=sharing
WVMExtractor: Failed to open libwvm.so: dlopen failed: cannot locate symbol "_Z8WV_SetupRP9WVSessionP12WVFileSourceRKSsR13WVCredentials14WVOutputFormatmPv" referenced by "/system/vendor/lib/libwvm.so"...
01-17 23:03:59.008 221 221 E linker : /system/lib/libmfldadvci.so: has text relocations
01-17 23:03:59.011 221 221 E HAL : load: module=/system/lib/hw/camera.vendor.redhookbay.so
01-17 23:03:59.011 221 221 E HAL : dlopen failed: /system/lib/libmfldadvci.so: has text relocations
MediaPlayer-JNI: dlopen failed: library "libextmedia_jni.so" not found
Click to expand...
Click to collapse
Please don't tell me that you abandoned LineageOS 15 project for this one?
nheolinkin said:
Please don't tell me that you abandoned LineageOS 15 project for this one?
Click to expand...
Click to collapse
I did not give up, but I did not fix ril, I'm researching it , please wait
Hi,
I experienced strange problems when activating the 'cell near' function on Tasker 5.1 to determine current position w/o GPS or google location services (LOS 15.01 03/24, latest modem/firmware).
After a few minutes (or cell changes, idk), the device slows down, finally reboots, and keeps on doing so even after reboot and dalvik/cache cleanup. In the logs, I find hundreds of lines saying
03-27 17:26:18.037 28720 28720 F libc : CANNOT LINK EXECUTABLE "crash_dump32": "/system/lib64/libbacktrace.so" is 64-bit instead of 32-bit
03-27 17:26:18.037 28720 28720 F libc : Fatal signal 6 (SIGABRT), code -6 in tid 28720 (crash_dump32), pid 28720 (crash_dump32)
03-27 17:26:18.040 28722 28722 F libc : CANNOT LINK EXECUTABLE "crash_dump32": "/system/lib64/libbacktrace.so" is 64-bit instead of 32-bit
03-27 17:26:18.040 28722 28722 F libc : Fatal signal 6 (SIGABRT), code -6 in tid 28722 (crash_dump32), pid 28722 (crash_dump32)
03-27 17:26:18.044 28724 28724 F libc : CANNOT LINK EXECUTABLE "crash_dump32": "/system/lib64/libbacktrace.so" is 64-bit instead of 32-bit
03-27 17:26:18.044 28724 28724 F libc : Fatal signal 6 (SIGABRT), code -6 in tid 28724 (crash_dump32), pid 28724 (crash_dump32)
...
Click to expand...
Click to collapse
In the logs, there is no explicit hint about the process that is aborted, but if I disable tasker and reboot, I do not observe any effects like the above.
Google gives only one exact hit on the above log line, but links to a chinese article that is not exacly helpful to me.
@albsat reported in the LOS 15.1 thread:
albsat said:
Finally someone with the same problem. I am not glad but I have the same issue, but currently I am running the Google experience by @sooti.
Click to expand...
Click to collapse
The exact same tasker configuration worked flawlessly on LG G4, Moto G, and Samsung Galaxy Nexus.
Anyone else?
On Llama labs Automate, using the 'Cell tower near?' block shows similar effects: When activating, the system restarts after a while.
Unfortunately, I cannot provide any logs for that.
I have the same problem. I use this function Cell near by on Tasker and the phone is blocked. Disabling Tasker, problems are gone, but this is not the solution.
Now I tried both old and new cell API options of tasker -- same effect.
No wonder there are no replies in the A1 forums for topics like this.
Most of the people here don't read, are mainly interested in MIUI and themes, and ask the same questions over and over again...
My PH-1 reboots randomly, sometimes frequently, and it is accompanied with sudden surge of heat on the in almost the direct center of the phone, on both the front and back sides. This has happened on stock Oreo (from .010 to current stock builds), RR, Lineage OS, AOSiP, and Carbon ROM. I've had it occur while rooted/unrooted, with or without xposed, and have thoroughly wiped device in between new ROMs. And though the device does suddenly get quite hot it can happen when im in a dark cold place or outside in the sun. The only correlation is that it seems to only occur while talking on the phone but length of call is not a factor in that scenario. It could happen 5 times in an hour or in a week.
I'm new to modification, and although green I've made my way through it pretty well thanks to the great forums and tips offered here. Rooting/modding is now much simpler now but this problem has been persisting for almost two months. I've got a logcat from boot to crash taken via ADB (about 2-3 minutes real time) but don't know how to interpret it enough to discover the cause of the problem . Thanks in advance for any help provided. I will post the logcat but I'm not sure of how much to post or how for that matter haha.
Thanks again
That really sounds like a hardware problem if its persisting across ROMs.
Warranty for sure. Most definitely a hardware fault.
jhs39 said:
That really sounds like a hardware problem if its persisting across ROMs.
Click to expand...
Click to collapse
I've taken quite a few logs and there are two consistent segments that I can't get figured out. Any help would be great. The second one has way more variations on the theme and they're grouped. Also, my phone was brand new but NOT purchased from a retailer. I'm assuming I'm outta luck for warranty?
A) 05-17 20:58:36.979 1518 1877 E Diag_Lib: [IMS_FATAL]| 1877 |ims_qmi_register_client : Failed
B) 05-17 20:59:11.372 3949 6262 W Finsky : [102] com.google.android.finsky.billing.a.j.a(48): Got an exception trying to get proto method: java.lang.NoSuchMethodException: getAuthFrequency []
05-17 20:59:11.373 3949 6262 W Finsky : [102] com.google.android.finsky.billing.a.j.a(48): Got an exception trying to get proto method: java.lang.NoSuchMethodException: getUserHasFop []
05-17 20:59:11.374 3949 6262 W Finsky : [102] com.google.android.finsky.billing.a.j.a(48): Got an exception trying to get proto method: java.lang.NoSuchMethodException: getFingerprintValid []
05-17 20:59:11.374 3949 6262 W Finsky : [102] com.google.android.finsky.billing.a.j.a(48): Got an exception trying to get proto method: java.lang.NoSuchMethodException: getDesiredAuthMethod []
05-17 20:59:11.374 3949 6262 W Finsky : [102] com.google.android.finsky.billing.a.j.a(48): Got an exception trying to get proto method: java.lang.NoSuchMethodException: getAuthFrequency []
05-17 20:59:11.375 3949 6262 W Finsky : [102] com.google.android.finsky.billing.a.j.a(48): Got
crixley said:
Warranty for sure. Most definitely a hardware fault.
Click to expand...
Click to collapse
Thank you for the response. Please look at my reply to user below your post. Is any information gathered just from those logs?
It looks like it's constantly polling to register you on the network and failing. What company are you with? Try two things just to satisfy my curiosity:
1) go into mobile network> advanced and change automatically select network to off. Click below and choose your provider yourself from the list.
2) double check the access point name (APN settings)
crixley said:
It looks like it's constantly polling to register you on the network and failing. What company are you with? Try two things just to satisfy my curiosity:
1) go into mobile network> advanced and change automatically select network to off. Click below and choose your provider yourself from the list.
2) double check the access point name (APN settings)
Click to expand...
Click to collapse
I'm on Verizon and step 1, done. It was active so I switched off. Step 2 it lists 2 APN... Verizon (VZWINTERNET) **checked** and Straight Talk Verizon (TRACKFONE.VZWENTP)**not checked**
Now im curious so I'll run logcat and see if similar codes persist. It seems like I'm on the phone nearly every time it happens, don't know if there is a correlation.
Thanks!
KingBeefy said:
I'm on Verizon and step 1, done. It was active so I switched off. Step 2 it lists 2 APN... Verizon (VZWINTERNET) **checked** and Straight Talk Verizon (TRACKFONE.VZWENTP)**not checked**
Now im curious so I'll run logcat and see if similar codes persist. It seems like I'm on the phone nearly every time it happens, don't know if there is a correlation.
Thanks!
Click to expand...
Click to collapse
Would be registering on the network when you make a call, it registers with the nearest tower to you. Let me know if that helps!
crixley said:
Would be registering on the network when you make a call, it registers with the nearest tower to you. Let me know if that helps!
Click to expand...
Click to collapse
So went a few hours with the changes you recommended and it was doing ok so far. The reboots are randomized. Might be 1 time in 36 hours and others its 6 times in an hour. Phone activity, battery life, etc seem to have a wide deviation too. BUT, so far so good. Much of the logcat did look like nothing was throwing a fail code, but this one still popped up enough to notice .
05-21 06:53:19.972 1553 1897 E Diag_Lib: [IMS_FATAL]| 1897 |ims_qmi_register_client : Failed
05-21 06:53:20.335 1050 2263 I WifiHAL : event received NL80211_CMD_VENDOR, vendor_id = 0x1374, subcmd = 0xd
05-21 06:53:21.982 1553 1897 E Diag_Lib: [IMS_FATAL]| 1897 |ims_qmi_register_client : Failed
05-21 06:53:21.984 1553 1897 E Diag_Lib: [IMS_FATAL]| 1897 |ims_qmi_register_client : Failed
05-21 06:53:22.330 1050 2263 I WifiHAL : event received NL80211_CMD_VENDOR, vendor_id = 0x1374, subcmd = 0xd
05-21 06:53:23.991 1553 1897 E Diag_Lib: [IMS_FATAL]| 1897 |ims_qmi_register_client : Failed
05-21 06:53:23.993 1553 1897 E Diag_Lib: [IMS_FATAL]| 1897 |ims_qmi_register_client : Failed
05-21 06:53:24.348 1050 2263 I WifiHAL : event received NL80211_CMD_VENDOR, vendor_id = 0x1374, subcmd = 0xd
05-21 06:53:26.000 1553 1897 E Diag_Lib: [IMS_FATAL]| 1897 |ims_qmi_register_client : Failed
05-21 06:53:26.002 1553 1897 E Diag_Lib: [IMS_FATAL]| 1897 |ims_qmi_register_client : Failed
KingBeefy said:
So went a few hours with the changes you recommended and it was doing ok so far. The reboots are randomized. Might be 1 time in 36 hours and others its 6 times in an hour. Phone activity, battery life, etc seem to have a wide deviation too. BUT, so far so good. Much of the logcat did look like nothing was throwing a fail code, but this one still popped up enough to notice .
05-21 06:53:19.972 1553 1897 E Diag_Lib: [IMS_FATAL]| 1897 |ims_qmi_register_client : Failed
05-21 06:53:20.335 1050 2263 I WifiHAL : event received NL80211_CMD_VENDOR, vendor_id = 0x1374, subcmd = 0xd
05-21 06:53:21.982 1553 1897 E Diag_Lib: [IMS_FATAL]| 1897 |ims_qmi_register_client : Failed
05-21 06:53:21.984 1553 1897 E Diag_Lib: [IMS_FATAL]| 1897 |ims_qmi_register_client : Failed
05-21 06:53:22.330 1050 2263 I WifiHAL : event received NL80211_CMD_VENDOR, vendor_id = 0x1374, subcmd = 0xd
05-21 06:53:23.991 1553 1897 E Diag_Lib: [IMS_FATAL]| 1897 |ims_qmi_register_client : Failed
05-21 06:53:23.993 1553 1897 E Diag_Lib: [IMS_FATAL]| 1897 |ims_qmi_register_client : Failed
05-21 06:53:24.348 1050 2263 I WifiHAL : event received NL80211_CMD_VENDOR, vendor_id = 0x1374, subcmd = 0xd
05-21 06:53:26.000 1553 1897 E Diag_Lib: [IMS_FATAL]| 1897 |ims_qmi_register_client : Failed
05-21 06:53:26.002 1553 1897 E Diag_Lib: [IMS_FATAL]| 1897 |ims_qmi_register_client : Failed
Click to expand...
Click to collapse
Hmmm. Have you flashed any other modems? Might be worth a shot.
crixley said:
Hmmm. Have you flashed any other modems? Might be worth a shot.
Click to expand...
Click to collapse
Teach me master!!!! What resource will you point me to?
KingBeefy said:
Teach me master!!!! What resource will you point me to?
Click to expand...
Click to collapse
Lol
What I would do is full wipe and fastboot flash the latest full file. Seems like OTAs haven't been updating the modem and ROMs wouldn't either I doubt.
You could probably just fastboot flash the modem.img from from the latest fastboot release if you really didn't want to full wipe.
The full wipe doesnt scare me off. I took my lumps teaching myself from scratch and the nuances of the way dual partition devices function has been an interesting learn. I prefer using ADB/fastboot/twrp instead of doing and OTA because of the learning opportunity so I have the latest modem.img from the current Firmware from essentials site. I also use @invisiblek builds. I sent Essential the log and they offered a suggestion as well, saying
I am sending you two troubleshooting steps that.... One of the reasons we need to do this is that when you factory reset your phone you restored backed up information and you signed back into you google account....
Click to expand...
Click to collapse
One of the first things I learned in forums like this one was that until you are ready to go, don't sign in to anything. So I will try and do that. Thanks again for suggestions @crixley
I was having this issue a while back. Every custom rom/kernel caused the processor to lock up at Max frequency randomly thus causing quick overheating no matter how small the load. Performance is amazing through this, but overheating is very annoying. I fixed mine by sticking to stock rooted and not touching the governors or thermal throttling. Maybe I would suggest monitoring your processor with a kernel manager and/or trying to play around with governors and thermal options for now, if you in fact have the same issue, to see if you get something thats stable and sticks. Good luck
I had an issue with mine where it was constantly locking up and rebooting, mostly during multimedia activities like watching YouTube, gaming and even browsing chrome. I never monitored the temperature and it never felt hot to the touch but it just kept happening constantly. I bought it as a refurbished on eBay and was crashing out of the box. It was completely stock Android 8.1.1. Most of the time it would just constantly non stop crash after 30seconds-10minutes of being turned on,. Would just freeze, sit for 30 seconds and then reboot itself. A couple times it lasted sitting idle for 14 hours before crashing and then constantly do it again.
Anyways even though it was a refurbished unit and the seller was not the original owner, it was still under warranty period and was able to be replaced. Just open warranty rma with essential is what I would do. If the serial/imei you provide them is still under warranty they will probably honor it.
Also they gave me that troubleshooting steps too,. Factory reset, start fresh and don't login to your, it's bogus. Still had the same issue on my phone and I actually had to send my phone back twice before they replaced it. The first time I sent it in they said they ran diagnostics that didn't detect any issue, but when I got the phone back it crashed within 10minutes and I never logged into Google. Just a bad hardware issue.
KingBeefy said:
The full wipe doesnt scare me off. I took my lumps teaching myself from scratch and the nuances of the way dual partition devices function has been an interesting learn. I prefer using ADB/fastboot/twrp instead of doing and OTA because of the learning opportunity so I have the latest modem.img from the current Firmware from essentials site. I also use @invisiblek builds. I sent Essential the log and they offered a suggestion as well, saying One of the first things I learned in forums like this one was that until you are ready to go, don't sign in to anything. So I will try and do that. Thanks again for suggestions @crixley
Click to expand...
Click to collapse
I am seeing the same errors. What did Essential say? Did it resolve the errors?
Hi guys
I am continuously experiencing libc errors in the logcat related to properties, e.g.
Code:
02-01 17:18:34.172 14601 14601 E libc : Access denied finding property "vendor.perf.gestureflingboost.enable"
02-01 17:18:34.182 14601 14601 E libc : Access denied finding property "vendor.perf.iop_v3.enable"
02-01 17:16:40.747 14601 14601 E libc : Access denied finding property "vendor.perf.iop_v3.enable.debug"
02-01 17:20:18.167 16326 16400 E libc : Access denied finding property "ro.serialno"
02-01 17:27:31.245 16816 16816 E libc : Access denied finding property "vendor.iop.enable_uxe"
These errors are continuously appearing in my logcat.
Could someone please check if you have this as well, do inside an adb shell:
Code:
> logcat | grep libc
thanks
libc errors also
I do have a libc errors but its not any that you have listed ->
libc: Access denied finding proptery "vendor.debug.egl.swapinterval"
Those logs are related to the perfd if I'm not mistaken, you can ignore it, it's not a problem.
PS: Don't touch the selinux.