[WIP][TeamCanjica][GUIDE] Porting MIUI v5 to our device [JB] - Galaxy S Advance I9070 Q&A, Help & Troubleshooting

This is device specific but you can use this to port to another device, just use the proper stuffs. This is a help for the new users who wants to collaborate and learn a bit, I can't promise you that doing this ypur rom will boot easy, I didn't ported v5 yet but the process is closer to v4 porting so reading, researching and using the head, maybe, you will make a bootable port.. Just give it a shot and try. More people involved on the same project will make more easy everything so work together and respect each other, don't be a noob/kanger/idiot..
This will cover from kernel built to framework patch. So you will:
• Build CM kernel for MIUI
• Port MIUI diffing and patching the 'framework' and copying the propper files to make it bootable
• Learn a bit about how Android works
• Learn how to debug and make/use reverse enginnearing
• Spend more time porting than being with a girl and friends? C'mon, get a life..
O.S.:
• Windows 7 - You will use it for almost everything
• Ubuntu 13.04 (x64 bit) (Yes, use this one just because I say it) - You will use it for kernel building
Software (Windows only):
• Notepad++ - For 'build.prop'
• WinMerge - For smalis diff., I don't care if Notepad++ have 'compare' plugin, WinMerge is the best for methods blocks compare
• Smali/Baksmali tool - The best in this case to decompile the framework
• WinRAR or 7zip - Seriously? C'mon, I don't need to tell you why you will use this..
• Android SDK - For 'adb' tool
Done!! You're ready to start with this, so buy a Coke or a beer or whatever you want, buy cigarrs and time, you will need a looot of time, this is not hard but takes to much time testing, fixing, pushing, testing again, fixing again, reading and paying attention..
This is a 'Work In Progress' guide 'cus I am at work rite nao, so I can't make all the guide now but I will continue this as soon as possible.. I will do the guide first and then I will add some pic's and examples to make it more easy to understand the whole proccess so stay tuned..
Credits:
@frapeti, @diego-ch and Team Canjica for supporting me, staying with me, teaching me, for everything I learned whit them. This were nothing without them, for real!!
@Lens_flare for the 'How to port..' bible he made of MIUI, this were nothing without him too, you guys should thanks him!!
@xboxfanj for teaching me a lot too in a lot of MIUI related stuff and other things too
And for everyone who was in my way of MIUI porting 'school', teaching me, helping me, guideing me, for everything!! Sorry if I forgott some one, tell me and I will be glad to add it here.
ⓣⓐⓟⓐⓣⓐⓛⓚ

Building the kernel:
MIUI can boot with CM or AOSP kernel but you will need to change/add a few lines in it for MIUI. You have 2 ways to do those changes, unpacking the kernel or build it. Just because I am so nice and want you guys to take the most harder way because is the best way to learn and understand moaar all this I will tell you how to build the kernel from source, beside that is better this than unpacking and repacking the kernel. Let's start initializing the environment:
• Install the Android SDK and set it up (the instructions are on his own web page so I will not explain this)
• Open a 'Shell' (is the same as 'Terminal Emulator' on Android) and copy/pasta this:
Code:
$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
$ sudo apt-get update
$ sudo apt-get install sun-java6-jdk
This step will install the Java JDK. After that, you will have to install a couple packages, so, again, copy/pasta this:
Code:
$ sudo apt-get install git gnupg flex bison gperf build-essential \
zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
libgl1-mesa-dev g++-multilib mingw32 tofrodos \
python-markdown libxml2-utils xsltproc zlib1g-dev:i386
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
After the required packages were installed, will be time to install 'repo', so copy/pasta this:
Code:
$ mkdir -p ~/bin
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
'CCACHE' (this will speed a lot the build proccess!!)
-TO BE ADDED-
Reboot your PC and boot again in Ubuntu. Now is time to sync the source, so open a 'Shell' again and copy/pasta this:
Code:
$ mkdir -p ~/android/system/
$ cd ~/android/system/
$ repo init https://github.com/TeamCanjica/android.git -b cm-10.1
$ repo sync -j4
$ ./vendor/cm/get-prebuilts
$ . build/envsetup.sh
$ cd frameworks/av
$ git fetch http://review.cyanogenmod.org/CyanogenMod/android_frameworks_av refs/changes/21/46421/3
$ git cherry-pick FETCH_HEAD
$ cd ../..
$ cd system/core
$ git fetch http://review.cyanogenmod.org/CyanogenMod/android_system_core refs/changes/32/45032/3
$ git cherry-pick FETCH_HEAD
$ cd ../..
At this point you will be able to build just the kernel or a fully CM10.1 rom. Maybe, when syncing and cherry picking ends, you wanna do again:
Code:
$ repo sync
Just to be sure that the entire source is fine.. Now, let's make some changes in the kernel. We will need to add the 'shelld' service, add 'framework_ext.jar' and make adb insecure:
* 'shelld' service and 'framework_ext.jar'
We will need to add this service (without this, Theme manager will not work or the launcher will FC, in example..) into the 'init.rc'. Watch the source https://github.com/TeamCanjica/android_system_core/blob/cm-10.1/rootdir/init.rc, that is the 'init.rc', now pay attention to the path of that file "android_system_core/rootdir/init.rc", that shows you where the file is, so in your PC will be on "android/system/core/rootdir/init.rc", that's the file we will use to add this service so open it scroll down to the bottom and add this at the end:
Code:
service shelld /system/xbin/shelld
class main
Now we will add 'framework_ext.jar' so press on the keyboard 'Ctrl+F' (search tool) and find 'export BOOTCLASSPATH', you will find something like this:
Code:
export BOOTCLASSPATH /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar
Done? Fine, now to you have to add
Code:
:/system/framework/framework_ext.jar
between ':/system/framework/framework.jar' and ':/system/framework/telephony-common.jar', so the entire line should be:
Code:
export BOOTCLASSPATH /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar[B]:/system/framework/framework_ext.jar[/B]:/system/framework/telephony-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar
Got it? Nice, that's all in the 'init.rc', now we can make it insecure or just build the kernel as 'eng' flag (Why 'eng' and not 'userdebug'? 'cus 'eng' will always be insecure), but if you wanna make it insecure just do this:
-TO BE ADDED-
Whitout this step, you will never be able to do logcats so you will never know why keeps bootlooping.. Interesting rigth? Jejeje
Now, fiiinaallyyy, let's build the kernel. Open a Shell and more copy/pasta:
Code:
$ cd ~/system/android/
$ . build/envsetup.sh
$ lunch cm_janice-eng
$ mka bootimage
Done, leave it building.. Could take 10~30 min. or even more.. You can pick the product on '/out' folder, the Shell will tell you where the file is anyway. Pick the kernel and copy to Windows partition through explorer (Why? You will need it and will not be able to pick it from Windows due to unsupported 'extx' partition from Windows).
Done with Ubuntu, time to get hands on Windows, so boot it up. The next step is the base of this 'cruzade' (LOL).
Our device, Advance or Janice or GT-I9070 (whatever), have a HDPI density so we will need to work with HDPI roms. First of all, we will use 2 roms:
* CM as base for port(called 'base' from now)
* MIUI as rom to port, obviouslly xD (called 'port' from now)
Download both of those roms, most newer CM build and MIUI. For MIUI, download most newer rom of any HDPI device based on 4.2.2 (yes, 4.2.2, so no place here for any CM10 build, CM10.1 only allowed). In MIUI v4 port I used 'crespo' (or better known as 'Nexus S') MIUI rom 'cus that device and the Advance have the same screen and density but the main issue is that I found just one MIUI rom for Nexus S based on 4.2 and I was unable to make it boot (I didn't worked hard anyway, just focused on the kernel only and minnor changes) so I can't be sure if that MIUI will be bootable, anyway if you find any other MIUI rom or wanna try with another rom is fine, but I recommend same screen and density. If you choose, in example, a XHDPI rom to port be prepared to face some oversized UI, but if you can deal with that then is fine for me, just be sure that is 4.2.2 based, no 4.1.2. I found this MIUI, maybe is the best shot:
http://en.miui.com/download-4.html
{
"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"
}
'Developer' version (not in the image case, that dev. version are v4, the third are v5.. Nevermind, the image is just illustrative) will be better 'cus MIUI came with his native root admin but in the 'stable' version they sometimes deactivate that, in 'developers' no, so you will not face any root headache.. =P
Let's see what we already did:
* Installed all the tools for Windows
* Installed Android SDK
* Installed Java
* Installed all the needed packages
* Synced the CM source for the kernel
* Modded and built the kernel
* Downloaded latest stable CM10.1 for base and MIUI for port
* Donated a beer to me and my awesome Canjica crew
* Sent me your credit card number
Nah, just kidding in the latest 2 points. I'm trying to make you laugh, this make this heavy work more funny instead of boring. Did you realized all the stuffs you did? Be proud that you already made too much and hope you learn a bit more about all this Android world, not about coding, just about necessary tools, how to set it up, the proccess, etc..
Now that we already have the kernel ready and we have the base rom and the port rom we will start with the most simple proccess, copy/pasta the necessary files. As @Lens_flare shared to everyone in his excellent guide (trust me, you will use more that guide than this one, here you have a more detailed proccess for one specific device, there you have a more detailed fixes of almost every 'framework' issue, so he really deserves a hugh thanks guys). Take the CM zip file and unpack it on a new folder (I always make a new folder on desktop called 'MIUI v'x' - 'device', in example: 'MIUI v5 - Advance', got it? Great!). We will basically drag and drop some files from port zip file into base project folder (the 'project folder' will be the folder you made and where you unpacked the base rom to work with it). Now you will have 2 folders, 'META-INF' and 'system', and 1 kernel, 'boot.img'.
Let's talk about it:
* 'META-INF' folder have the necessary files to make it flashable through CWM/TWRP recovery, the most important is the 'updater-script' because it have the 'instructions' and 'how will install' the rom
* 'system' folder, hmm, well, this have the system, should I have to explain something about this folder? =P
* 'boot.img' file is the kernel so no need to explain anything about it too
Now that you have those 3 folders/file, let's continue with the copy/pasta of neccessary files:
* Delete 'boot.img'
* Open 'system' folder and delete 'apps', 'fonts', 'framework' and 'media' folders
We will need those folders but the MIUI ones, so take those folders from port rom zip file and paste in 'system' of the project folder. Do not overwrite those folders, just remove the CM ones and add the MIUI ones.
Now, in the port rom zip file, go to '/system/etc' and copy this files:
* telocation.idf
* yellowpage.db
* secomxregistry
* pinyinindex.idf
* unicode_py_index.td
* permission_config.json
* spn-config.xml
And paste it on '/system/etc' folder in the project folder. Now you can overwrite those files and if you can't find any of the listed files in the port rom, just ignore it.
Now, '/system/etc/permissions' of port rom zip file. Some users, me too for v4, took this files:
* com.nxp.mifare.xml
* com.google.android.media.effects.xml
* com.google.widevine.software.drm.xml
* com.google.android.maps.xml
And placed in '/system/etc/permissions' of the project folder. The main issue is that I never saw those files in MIUI v5, that's why some users directly copy all the files from that folder, so let's try this, copy all files from '/system/etc/permissions' in port rom zip file except:
* handheld_core_hardware.xml
* platform.xml
Do the same with the '/system/lib' folder, copy this files:
* content-types.properties
* libFreqFilter.so
* libaudiofp.so
* libffmpeg_xm.so
* libffplayer_jni.so
* libimageutilites_jni.so
* libjni_resource_drm.so
* liblbesec.so
* liblocSDK_2.5OEM.so
* liblocSDK_2_5OEM.so
* libmp3lame.so
* libpatcher_jni.so
* libphotocli.so
* libshell*.so
And paste in '/system/lib' folder. Again, if you have to overwrite any of those files, do it and if you can't find any oh those files in the port rom zip file then just ignore it.
Now, in the port rom zip file go to '/system/xbin' and take this two files:
* shelld
* su
Like before, drag and drop in '/system/xbin' on the project folder and overwrite it. Done? Excellent, now we are going to work with the 'build.prop' located in '/system' on the project folder. Open it with 'Notepad++' and search this lines:
* ro.build.id​
* ro.build.display.id​
* ro.build.version.incremental
* ro.config.ringtone​
* ro.config.notification_sound​
* ro.config.alarm_alert
We need to set these lines with proper values:
Code:
​
ro.build.id=MIUI​
ro.build.display.id=MIUI​
ro.build.version.incremental=x.x.x​
ro.config.ringtone=MI.ogg​
ro.config.notification_sound=FadeIn.ogg​
ro.config.alarm_alert=GoodMorning.ogg
'x.x.x': this value can be setted with your birthday if you want it but will be better if we set the proper value to remember what MIUI build was used to port. To be more clear, watch the image I posted a couple lines up near of the red 'PORTED ROM', below the author you will see this: 'Version 3.12.6 ( V5 )'. The '3.12.6' is the incremental number and means this:
* '3' -> 2013
* '12' -> December
* '6' -> Day 6 of the current month
Got it? Great. Now you know how to set that value, the rest leave it like I posted.
Now, pick the 'boot.img' already compiled on Ubuntu and place it on the project folder. Done? Great, now you can select 'META-INF', 'system' and 'boot.img' files and compress it in a '.zip' file with WinRAR. Remember to select it as a zip file and Normal compression. Name that zip file as you want it, I always named as "MIUI vx - Test 1".
Finally you have the zip file, of course will booloop 'cus the framework were not diffed and patched, here is when 'adb' is crucial, from now we will work with 'smali'backsmali' and 'adb' tools.
To fix it step by step, you have 2 methods, one of them is flash the rom and make logs looking the error that cause the bootloop or patch the commons smali's first and then look the errors that cause the bootloop. Those smali's are inside of 'framework.jar' and 'services,jar' located on '/system/framework'. So, create 2 folders, the first one called 'CM' and the second one called 'MIUI'. Now open the original CM zip file and extract 'framework.jar' and 'services.jar' on CM folder. Do the same with the original MIUI zip file, pick those 2 files and extract it but on MIUI folder. Now we need to put a copy of 'smali' and 'baksmali' tools files on both folders. Done? Ok, now let's decompile the 'framework.jar' first opening the CM folder and a cmd window (just press 'Mayus' on keyboard and left click on any clean space on CM folder and select 'Open a command prompt here...' or go to 'Start' and write 'cmd' on search toolbox, open it and use 'cd' command to go to the CM folder). Now on the 'cmd' run this command:
Code:
java -jar baksmali.jar -b framework.jar -o framework.jar.out
Leave it finish and you will have a new folder called 'framework.jar.out', open it and you will find all the smalis in those folders. Do the same with the MIUI framework, open the folder, open a cmd and run that command. Ok, now it's time to overwritte the common smali files from CM folder to MIUI. Those common smali's files are this:
* android/content/res/PackageRedirectionMap*.smali
* android/hardware/Camera*.smali
* android/media/AudioFormat.smali
* android/net/wifi/wifichannel.smali
* android/net/wifi/wifinative.smali
* android/os/SystemProperties.smali
* android/view/Gles20*.smali
* android/view/inputmethod/inputmethodinfo*.smali
* android/webkit/html5*.smali
* android/webkit/selectactionmodecallback.smali
* com/android/internal/app/ActivityTrigger.smali​
You can just take those smali's and overwritte it. The next step will be add/patch missing 'methods' (the 'methods' are blocks of code), you only need to add the missing methods, not modify anything, I mean, if 'x' are not present in the MIUI smali, you will have to add it, here is where Winmerge gets in. The smalis you will have to patch are:
* android/content/res/AssetManager.smali
* android/media/AudioFormat.smali
* android/webkit/WebSettingsClassic.smali
So compare those files with the CM ones and add from CM smalis to MIUI smalis always. That's all with 'framework.jar', now we will patch 'services.jar', so again, overwrite from CM smali files to MIUI files this files:
* com/android/server/input/InputManagerService*.smali​
After that you will have to patch 'PowerManagerService.smali' located at 'com/android/server/power'. Search the block '.method private static native nativeCpuBoost(I)V​' and add it from CM to MIUI one. Done? Nice, now compile 'framework.jar' and 'services.jar' doing this from a Shell (or cmd or whatever you call it):
Code:
java -jar smali.jar framework.jar.out
and
Code:
java -jar smali.jar services.jar.out
Running those commands you will compile both files again and you will have as result a file called 'out.dex', that file will have to replace the 'classes.dex' inside of both '.jar' files (framework and services). So, to make it easyer, compile 'framework.jar', rename 'out.dex' result to 'classes.dex', open 'framework.jar' and drag and drop 'classes.dex' from folder to 'framework.jar' zip file overwritting the one inside, then do the same with 'services.jar'. Done? Great, now pick 'framework.jar' and 'services.jar' and paste in the rom in 'framework' folder. Excellent, now is time to flash the rom and start making logs. This is the most heavy step 'cus you will have to test, find the error (for sure will be a smali framework error), patch it and then flash it, agaain, test, search the error in logs, patch it too, and flash it, that's why is heavy, is a repetitive proccess. You will have to do that one, two, three, four, five times until properlly boot.
ⓣⓐⓟⓐⓣⓐⓛⓚ

And this too (=
ⓣⓐⓟⓐⓣⓐⓛⓚ

so...

sinan5858 said:
so...
Click to expand...
Click to collapse
Do you have any idea what you just said??
Be respectful and thankful to him for creating that thread to help the noobs to develope MIUI..:good::good:

Fed , im waiting

I know you guys are waiting this but I was out the past weekend and this week I will be really busy, in fact, my job is killing me, tomorrow gotta go sooner than always because I have to do a lot of stuffs but I promise I will finish this this week.. Sorry guys for making you wait too much but, please, understand me!! =(
Enviado desde mi C6602 mediante Tapatalk

fedevd said:
I know you guys are waiting this but I was out the past weekend and this week I will be really busy, in fact, my job is killing me, tomorrow gotta go sooner than always because I have to do a lot of stuffs but I promise I will finish this this week.. Sorry guys for making you wait too much but, please, understand me!! =(
Enviado desde mi C6602 mediante Tapatalk
Click to expand...
Click to collapse
Ahha , No problem dude
Take Ur Time <3

Updated 2nd post and still adding some stuffs, gimme a break to take a shower and rest in my bed now xD
EDIT: A bit more info added..
EDIT2: More info added..
Enviado desde mi C6602 mediante Tapatalk

Ehm... to download / test it?? Sorry for the question
Cyanogenmod 10.2

giec said:
Ehm... to download / test it?? Sorry for the question
Cyanogenmod 10.2
Click to expand...
Click to collapse
Download/test it what????

giec said:
Ehm... to download / test it?? Sorry for the question
Cyanogenmod 10.2
Click to expand...
Click to collapse
Do you even read? This is a GUIDE how to port MIUI.
I have will to do it, but do not have enought time to do it like it should. I work rom 12 - 8 monday-friday by PC, and after that I do not have such concentration to continue with development. So Fedevd decided to make guide on our forum, that we could work together.

shut_down said:
Do you even read? This is a GUIDE how to port MIUI.
I have will to do it, but do not have enought time to do it like it should. I work rom 12 - 8 monday-friday by PC, and after that I do not have such concentration to continue with development. So Fedevd decided to make guide on our forum, that we could work together.
Click to expand...
Click to collapse
Kids, moar kids everywhere!! =P
Added more info on 2nd post, still incomplete anyway, still toooooo much info to add =/
Hope you guys work togheter if you want MIUI v5, like I did with my great Team Canjica, 5 heads are better than 1, so...

I have some experience (little, but better than nothing ) in compiling and I already have cm10.1 sources in my pc :good: so I could try, maybe next weekor before christmas
Sent from my iPad using Tapatalk

Thst will be good.. I am doing this for anyone who wanna port it, knowing or not knowing about it.. (=
Enviado desde mi C6603 mediante Tapatalk

Thx -.-
Cyanogenmod 10.2

Finished the basics steps to port MIUI, still have to add some images, make more clear some steps, add minnor stuffs, explain a bit more some minnor stuffs and correct some symbols but with this you can now start porting. If someone do not understand something or some step are difficult, just leave comments here and I will try to help you. 3rd post is reserved for common logs errors to make it more easier later for other new users. So, let's start porting this great ROM and I wish lucky for all of you with this heavy and lazy work =P

I failed :/
phone had been connected to abd for 20 minutes and all i got is this
--------- beginning of /dev/log/system
[ 12-24 08:37:30.830 1802: 1802 I/Vold ]
Vold 2.1 (the revenge) firing up
[ 12-24 08:37:30.830 1802: 1802 D/Vold ]
Volume sdcard0 state changing -1 (Initializing) -> 0 (No-Media)
[ 12-24 08:37:30.830 1802: 1802 D/Vold ]
Volume sdcard1 state changing -1 (Initializing) -> 0 (No-Media)
[ 12-24 08:37:30.830 1802: 1802 D/Vold ]
Volume usbdisk0 state changing -1 (Initializing) -> 0 (No-Media)
[ 12-24 08:37:30.860 1802: 1827 D/Vold ]
Volume sdcard0 state changing 0 (No-Media) -> 2 (Pending)
[ 12-24 08:37:30.860 1802: 1827 D/DirectVolume ]
DirectVolume::handlePartitionAdded -> MAJOR 179, MINOR 1, PARTN 1
[ 12-24 08:37:30.860 1802: 1827 D/DirectVolume ]
DirectVolume::handlePartitionAdded -> MAJOR 179, MINOR 2, PARTN 2
[ 12-24 08:37:30.870 1802: 1827 D/DirectVolume ]
DirectVolume::handlePartitionAdded -> MAJOR 179, MINOR 3, PARTN 3
[ 12-24 08:37:30.870 1802: 1827 D/DirectVolume ]
DirectVolume::handlePartitionAdded -> MAJOR 179, MINOR 4, PARTN 4
[ 12-24 08:37:30.870 1802: 1827 D/DirectVolume ]
DirectVolume::handlePartitionAdded -> MAJOR 179, MINOR 5, PARTN 5
[ 12-24 08:37:30.870 1802: 1827 D/DirectVolume ]
DirectVolume::handlePartitionAdded -> MAJOR 179, MINOR 6, PARTN 6
[ 12-24 08:37:30.870 1802: 1827 D/DirectVolume ]
DirectVolume::handlePartitionAdded -> MAJOR 179, MINOR 7, PARTN 7
[ 12-24 08:37:30.870 1802: 1827 D/Vold ]
Volume sdcard0 state changing 2 (Pending) -> 1 (Idle-Unmounted)
[ 12-24 08:37:30.870 1802: 1827 D/DirectVolume ]
DirectVolume::handlePartitionAdded -> MAJOR 179, MINOR 8, PARTN 8
[ 12-24 08:37:30.870 1802: 1827 W/Vold ]
Duplicate state (1)
[ 12-24 08:37:30.880 1802: 1827 D/DirectVolume ]
DirectVolume::handlePartitionAdded -> MAJOR 179, MINOR 9, PARTN 9
[ 12-24 08:37:30.880 1802: 1827 W/Vold ]
Duplicate state (1)
[ 12-24 08:37:30.880 1802: 1827 D/DirectVolume ]
DirectVolume::handlePartitionAdded -> MAJOR 179, MINOR 10, PARTN 10
[ 12-24 08:37:30.880 1802: 1827 W/Vold ]
Duplicate state (1)
[ 12-24 08:37:30.880 1802: 1827 D/DirectVolume ]
DirectVolume::handlePartitionAdded -> MAJOR 179, MINOR 11, PARTN 11
[ 12-24 08:37:30.880 1802: 1827 W/Vold ]
Duplicate state (1)
[ 12-24 08:37:30.880 1802: 1827 D/DirectVolume ]
DirectVolume::handlePartitionAdded -> MAJOR 179, MINOR 12, PARTN 12
[ 12-24 08:37:30.880 1802: 1827 W/Vold ]
Duplicate state (1)
[ 12-24 08:37:30.880 1802: 1827 D/DirectVolume ]
DirectVolume::handlePartitionAdded -> MAJOR 179, MINOR 13, PARTN 13
[ 12-24 08:37:30.880 1802: 1827 E/DirectVolume ]
Invalid 'PARTN' value
[ 12-24 08:37:30.880 1802: 1827 D/DirectVolume ]
DirectVolume::handlePartitionAdded -> MAJOR 179, MINOR 14, PARTN 14
[ 12-24 08:37:30.880 1802: 1827 E/DirectVolume ]
Invalid 'PARTN' value
[ 12-24 08:37:30.880 1802: 1827 D/DirectVolume ]
DirectVolume::handlePartitionAdded -> MAJOR 179, MINOR 15, PARTN 15
[ 12-24 08:37:30.880 1802: 1827 E/DirectVolume ]
Invalid 'PARTN' value
[ 12-24 08:37:30.880 1802: 1827 D/DirectVolume ]
DirectVolume::handlePartitionAdded -> MAJOR 179, MINOR 16, PARTN 16
[ 12-24 08:37:30.880 1802: 1827 E/DirectVolume ]
Invalid 'PARTN' value
[ 12-24 08:37:30.880 1802: 1827 D/DirectVolume ]
DirectVolume::handlePartitionAdded -> MAJOR 179, MINOR 17, PARTN 17
[ 12-24 08:37:30.880 1802: 1827 E/DirectVolume ]
Invalid 'PARTN' value
[ 12-24 08:37:30.880 1802: 1827 W/Vold ]
Duplicate state (1)
[ 12-24 08:37:30.880 1802: 1827 W/Vold ]
Duplicate state (1)
[ 12-24 08:37:30.880 1802: 1827 W/Vold ]
Duplicate state (1)
[ 12-24 08:37:30.880 1802: 1827 W/Vold ]
Duplicate state (1)
[ 12-24 08:37:30.880 1802: 1827 D/Vold ]
Volume sdcard1 state changing 0 (No-Media) -> 2 (Pending)
[ 12-24 08:37:30.880 1802: 1827 D/DirectVolume ]
DirectVolume::handlePartitionAdded -> MAJOR 179, MINOR 97, PARTN 1

Try this, run:
Code:
adb logcat -c
and then
Code:
adb logcat >nameoflog.txt
and see if now the log works better..
Enviado desde mi C6603 mediante Tapatalk

Can anybody help me please?
I want to Copy this in Terminal emulator in windows but it doesn't work
$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"

Related

[GUIDE] Build CM10 kernel from source + wkpark's RAM hack

For any CM10 ROM, except new bootloader one, hackfest, and CM10.1
This tutorial shows you how to build CM10 kernel from RC and the CM team's source(it is their work), and using wkpark's ramhack patch or other patches
If you are uncomfortable in building the kernel, you use my flashable sample kernel at the end of the post, which uses 56 MB RAM hack.
Pre-requistes:
A Linux system
An internet connectionc
Some time and patience
But the time required for downloading resources, and building once everything is set up, is only a fraction of the time required for a full CM10 ROM
You can follow this guide, with or without having built CM10 following Raum1807's excellent CM10 building guide. At one of the places, the difference occurs whether you had built CM10 before or not, and I have listed it at that place
For a first time build, you need to follow all the steps, but 2nd time onwards, you can skip to the build step or RAM hack setting step
Instructions:
STEP 1: SETTING UP THE ENVIRONMENT
Install any CM10 ROM on the device (old bootloader, non-hackfest, non-CM10.1 one)
If you already have CM10 environment set up, skip to "Create an environment variable..." part
Install development support packages:
Debian based Linux distributions (like Ubuntu)
64bit systems:
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
libgl1-mesa-dev g++-multilib mingw32 openjdk-6-jdk tofrodos \
python-markdown libxml2-utils schedtool pngcrush xsltproc zlib1g-dev:i386
then
Code:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Red Hat based Linux distributions
32bit and 64bit systems:
git gnupg java-1.6.0-openjdk-devel flex bison gperf SDL-devel esound-devel wxGTK-devel zip curl ncurses-devel zlib-devel gcc-c++ glibc-devel
64bit only:
glibc-devel.i686 libstdc++.i686 zlib-devel.i686 ncurses-devel.i686
Setting up Java (thanks to Raum for the java setup guide)
You need a Java Development Kit for building CM10. Recommended is the SUN JDK 6. As of writing the most recent version is SUN JDK 6 Update 37.
1. Download the jdk-6u37-linux-i586.bin from the Oracle/Sun Java Download Area. If you are on 64-bit Ubuntu as I am, you should grab jdk-6u37-linux-x64.bin.
2. Make the bin file executable:
Code:
$ chmod +x jdk-6u37-linux-x64.bin
3. Extract the bin file:
Code:
$ ./jdk-6u37-linux-x64.bin
4. Move the extracted folder to this this location:
Code:
$ sudo mv jdk1.6.0_37 /usr/lib/jvm/./jdk-6u37-linux-x64.bin
5. Install the new Java source in system:
Code:
$ sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk-6u37-linux-x64.bin/bin/javac 1
$ sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk-6u37-linux-x64.bin/bin/java 1
$ sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk-6u37-linux-x64.bin/bin/javaws 1
$ sudo update-alternatives --install /usr/bin/javadoc javadoc /usr/lib/jvm/jdk-6u37-linux-x64.bin/bin/javadoc 1
$ sudo update-alternatives --install /usr/bin/javah javah /usr/lib/jvm/jdk-6u37-linux-x64.bin/bin/javah 1
$ sudo update-alternatives --install /usr/bin/javap javap /usr/lib/jvm/jdk-6u37-linux-x64.bin/bin/javap 1
$ sudo update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/jdk-6u37-linux-x64.bin/bin/jar 1
6. Select the default Java version for your system:
Code:
$ sudo update-alternatives --config javac
$ sudo update-alternatives --config java
$ sudo update-alternatives --config javaws
$ sudo update-alternatives --config javadoc
$ sudo update-alternatives --config javah
$ sudo update-alternatives --config javap
$ sudo update-alternatives --config jar
7. Check Java version:
Code:
$ java -version
8. Verify the symlinks. Javac, Java, Javaws, Javadoc, Javah, Javap and Jar should all point to the new Java location and version:
Code:
$ ls -la /etc/alternatives/java* && ls -la /etc/alternatives/jar
Now,
If you have CM10 source fetched already (if you have built cm10)
If the directory name where the cm10 source exists is "cm10" (as in Raum's building guide)
Create an environment variable denoting the location of the android toolchain as follows:
Code:
export CCOMPILER=${HOME}/cm10/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
Or else, replace the path/name if yours is different
(If your arm-eabi version is not 4.4.3, check the folder name and change it accordingly)
If you do not have cm10 source on your pc, then you need to download the ARM EABI Toolchain separately
Download link, ready to extract
If above does not work, download from official site here
Download and extract then, create an environment variable denoting the location of the toolchain as follows:
Code:
export CCOMPILER=[extraction directory]/bin/arm-eabi-
Download Kernel Source Code:
Code:
mkdir -p ~/kernel
cd ~/kernel
Now download RC's CM10 kernel source
In terminal, do
Old bootloader:
Code:
git clone git://github.com/CyanogenMod/lge-kernel-star.git -b jellybean
New bootloader:
Here, pengus77 has made the necessary changes in his repo, so we fetch from that
Code:
git clone git://github.com/pengus77/lge-kernel-star.git
Thus, there should be a folder named "lge-kernel-star" inside /kernel folder
Then in terminal, cd to that directory "lge-kernel-star"
Code:
cd lge-kernel-star
Getting the config file
The next step is to copy the file "/kernel/lge-kernel-star/arch/arm/configs/cyanogenmod_p990_defconfig" to "/kernel/lge-kernel-star and rename it to ".config"
using the command:
Code:
cp arch/arm/configs/cyanogenmod_p990_defconfig .config
(Thanks to tonyp for the tip!)
STEP 2: CONFIGURATION
Configure the build:
Code:
make ARCH=arm CROSS_COMPILE=$CCOMPILER oldconfig
If it happens to ask anything, just accept the defaults at every step by pressing enter.
STEP 3: APPLYING PATCHES
Applying patches like wkpark's RAM hack patch
If you skip this step, the kernel will work, but you'll have a completely stock kernel without RAM hack or other tweaks
Download wkpark's two patches from here and here, and put them in your /kernel directory
Code:
cd ~/kernel
Now to apply the patches, we use the patch command like this:
Code:
patch -Np1 -d lge-kernel-star < patchname.patch
(replace patchname with name of the patch file)
Here, -N is for ignoring patches that seem to be already applied or reversed
p<num> Strip the smallest prefix containing num(here num=1) leading slashes from each file name found in the patch file
In this case, num=1 according to the path names in wkpark's patch, and in a lot of cases, the value of 1 is common
-d is to change to the directory immediately, before doing anything else
You need to apply wkpark's two patches one by one (0001-..., then bootloader-...)
If you get errors while patching, if they are basic errors like file not found etc. then you should manage to fix it yourself.
But if you get errors like "HUNK ... failed",
try
Code:
patch -Np1 --ignore-whitespace -d lge-kernel-star < patchname.patch
A "HUNK ignored" is ok, if patch was attempted previously, since that file might have been successfully patched last time
if a HUNK still fails, then read the troubleshooting guide
Setting RAM hack size (If you skipped the above patching step, dont do this)
wkpark's patch makes it possible for you to set ramhack size in kernel command line parameter.
The cmdline parameter has to have the full boot.img command line parameters, which you can obtain from dmesg. I have done it for you, so you can save time on that
Here's how it looks for the old bootloader: (for the new one, ignore this)
Code:
<5>[70:01:01 00:00:00.000] Kernel command line: loglevel=0 muic_state=1 CRC=10203036179a93 brdrev=1.0 uniqueid=37c7006421f6097 video=tegrafb console=ttyS0,115200n8 usbcore.old_scheme_first=1 tegraboot=sdmmc tegrapart=recovery:35e00:2800:800,linux:34700:1000:800,mbr:400:200:800,system:600:2bc00:800,cache:2c200:8000:800,misc:34200:400:800,userdata:38700:c0000:800 [email protected] vmalloc=128M androidboot.mode=normal androidboot.hardware=star androidboot.serialno=37c7006421f6097
Paste the line starting from loglevel=0 till the end (serialno) into .config file in lge-kernel-star folder in
CONFIG_CMDLINE="<here>"
Insert a carveout size in between vmalloc and androidboot.mode
Determing carveout size: carveout=<152 - RAM hack size>M
For example, if RAM hack size is 56, then carveout is 96M
So in that case, the cmdline is like this:
old bootloader:
Code:
CONFIG_CMDLINE="loglevel=0 muic_state=1 CRC=10203036179a93 brdrev=1.0 uniqueid=37c7006421f6097 video=tegrafb console=ttyS0,115200n8 usbcore.old_scheme_first=1 tegraboot=sdmmc tegrapart=recovery:35e00:2800:800,linux:34700:1000:800,mbr:400:200:800,system:600:2bc00:800,cache:2c200:8000:800,misc:34200:400:800,userdata:38700:c0000:800 [email protected] vmalloc=128M carveout=96M androidboot.mode=normal androidboot.hardware=star androidboot.serialno=37c7006421f6097"
new bootloader:
Code:
CONFIG_CMDLINE="tegraid=20.1.4.0.0 [email protected] carveout=152M android.commchip=0 vmalloc=128M androidboot.serialno=037c7006421f6097 video=tegrafb no_console_suspend=1 console=ttyS0,115200n8 debug_uartport=lsport,-3 androidboot.mode=normal usbcore.old_scheme_first=1 [email protected] [email protected] muic_state=0 tegraboot=sdmmc tegrapart=recovery:35e00:2800:800,boot:34700:1000:800,mbr:400:200:800,persist:600:2bc00:800,cache:2c200:7f00:800,misc:34200:400:800,userdata:38700:c0000:800,bcttable:0:600:800,bootloader:100:300:800,data/ve:f8800:1400:800,system:34c000:40000:800 "
and save the file
Dont set carveout too low, or else some gpu-intensive stuff may not work properly.
STEP 4: BUILDING THE KERNEL
In terminal,
Code:
cd ~/kernel/lge-kernel-star
Code:
make ARCH=arm CROSS_COMPILE=$CCOMPILER -j`grep 'processor' /proc/cpuinfo | wc -l`
This step may take a while, depending on your computer. Took ~5-10 mins for the first build for me, and ~1 min for the second build onwards.
If it asks in the terminal "use default config?" then say "y", if not, then ignore this
If you get some error and the building aborts within a few seconds, try the "Create environment variable part" again, and then return back directly to the build step.
After it is done, you should have a kernel stored in ~/kernel/lge-kernel-star/arch/arm/boot/zImage
Preparing the flashable zip for the kernel
Some compiled modules need to be included so that problems like wifi not switching on dont occur.
They are:
drivers/misc/bthid/bthid.ko
drivers/scsi/scsi_wait_scan.ko
drivers/net/wireless/bcm4329/wireless.ko
They will be used while preparing the flashable zip below.
Thanks to feav's compiled modules and benee's anykernel updater for star, all this is ready-made and you can simply:
Download the sample kernel zip attached below and replace /kernel/zImage and and the above modules in system/lib/modules/hw in that with yours, edit updater-script if you want.
Your flashable zip is now ready
STEP 5: FLASHING AND TESTING THE KERNEL
Put the sample kernel below as a backup in case your kernel does not boot and you need a working phone immediately.
Flash the kernel in recovery, wipe cache, dalvik cache and reboot.
If the phone goes past the LG logo screen(s) and into the bootscreen of the ROM, then it should work
Then you can check "kernel version" in settings->about phone to see your kernel information,
and you can see the new RAM size (which should be 342 MB + RAM hack size) in some app like battery dr saver, or antutu benchmark's system info.
If it doesnt work, make sure you have followed the entire guide properly and then ask queries
If you want to revert to another kernel, flash that kernel in recovery, or for stock kernel, flash your ROM.
Keeping kernel source up to date (for building again later after RC has made changes to the source):
Code:
cd ~/kernel/lge-kernel-star
git pull
This will update your source with the latest commits by RC. Then you can rebuild the kernel by doing the "create environment variable" and then skip directly to the build stage
Standard disclaimer:
I am not responsible if anything goes wrong with your phone or anything else.
Credits:
aremcee/RC and the rest of the CM team for all their work. This is their kernel you are building
wkpark for his valuable contributions, including the ramhack patches and cracking the new bootloader
benee for his Anykernel updater for star, and other tweaks
feav for his compiled wifi modules
pengus77 for the work to make it suitable for the new bootloader
Download links for sample kernels:
SAMPLE 56 MB RAMHACK KERNEL
SAMPLE 32 MB RAMHACK KERNEL
SAMPLE 24 MB RAMHACK KERNEL
Troubleshooting guide:
1. Patch failure
HUNK failed means that a particular file was not patched to some problem. In this case, a .rej file is saved in the same folder as the file to be patched, and it contains the stuff not patched.
Do not neglect "failed" hunk since it means a partially applied patch(some files patched, some files not), and may cause problems. "Ignored hunk" is ok, if the patch had been attempted before on a file and had succeeded on that file last time.
To manually patch the failed hunk, go that file where the hunk failed (has same name as .rej file without .rej extension)
For example, if .rej file is board-star.c.rej, and it contains the following sample lines (look for lines beginning with '+' and remove the + before adding, similar for -) go to board-star.c, and add the lines manually like this:
Code:
#if defined (CONFIG_STAR_REBOOT_MONITOR) || defined (CONFIG_BSSQ_REBOOT_MONITOR)
#define RAM_RESERVED_SIZE 100*1024
/* Force the reserved_buffer to be at its old (Froyo/GB) location
for reboot to work with the older bootloader */
if (strstr(saved_command_line, "brdrev=")) {
extern void *reserved_buffer;
pr_info("The older bootloader detected\n");
if (memblock_end_of_DRAM() > 0x17f80000) {
if (memblock_reserve(0x17f80000, RAM_RESERVED_SIZE)) {
pr_err("Fail to get reserved_buffer for the older bootloader\n");
} else {
pr_info("Change reserved_buffer for the older bootloader\n");
reserved_buffer = phys_to_virt(0x17f80000);
}
} else {
pr_info("Change reserved_buffer\n");
reserved_buffer = ioremap(0x17f80000, RAM_RESERVED_SIZE);
}
}
#endif
This was in the .rej file, and is to be added immediately after
Code:
#if defined(CONFIG_LGE_BROADCAST_TDMB)
star_dmb_init();
#endif /* CONFIG_LGE_BROADCAST */
in board-star.c (and before the next #if defined or closing bracket)
Similarly, the - lines to be deleted and + lines are to be added in that failed hunk file
(do this manual stuff only if hunk fails)
2. If ramhack kernel fails, but normal kernel works:
From your pc, in terminal do
adb shell dmesg > dmesg.txt
or from your phone, in android terminal emulator, do
dmesg > /sdcard/dmesg.txt
Copy it from your dmesg.txt starting from loglevel=0 till the end (serialno)
Look for a line in dmesg.txt which resembles this:
Code:
<5>[70:01:01 00:00:00.000] Kernel command line: loglevel=0 muic_state=1 CRC=10203036179a93 brdrev=1.0 uniqueid=37c7006421f6097 video=tegrafb console=ttyS0,115200n8 usbcore.old_scheme_first=1 tegraboot=sdmmc tegrapart=recovery:35e00:2800:800,linux:34700:1000:800,mbr:400:200:800,system:600:2bc00:800,cache:2c200:8000:800,misc:34200:400:800,userdata:38700:c0000:800 [email protected] vmalloc=128M androidboot.mode=normal androidboot.hardware=star androidboot.serialno=37c7006421f6097
Use your own phone's parameters instead of this and then set carveout size.
3. Problem with config file:
Pulling kernel config from device:
You need to retrieve a working kernel config from the device, and unzip it.
For that, connect your phone to your pc, enable USB debugging if it was disabled, and then in terminal
Code:
adb pull /proc/config.gz ~/kernel/lge-star-kernel-jellybean/config.gz
cat config.gz | gunzip > .config
Alternatively, you can pull the .config from the newest boot.img
Code:
scripts/extract-ikconfig boot.img > .config
Changes and updates:
25/12/12:
Added changes to be made for the new bootloader (in red color)
24/12/12:
Updated the guide, added some fixes and changes
22/12/12:
Slightly modified version of wkpark's 2nd patch (bootloader one) which may possibly fix one of the errors and may remove need for manually adding some lines
Last one
rugglez.....you rock mate....
I am not sure if I will really do something as I am getting old(lolz) and if I understand enough....
but thanks mate, for keeping spirits alive for this device
rugglez,
Did you see these posts: http://forum.xda-developers.com/showpost.php?p=34600723&postcount=189
http://forum.xda-developers.com/showpost.php?p=34601277&postcount=192
Did you experienced any ploblem with USB?
SREEPRAJAY said:
rugglez.....you rock mate....
I am not sure if I will really do something as I am getting old(lolz) and if I understand enough....
but thanks mate, for keeping spirits alive for this device
Click to expand...
Click to collapse
There are always some things worth experiencing once in life, like if you are an Android user, building a ROM and a kernel. You have experienced it with your wonderful AF kernel, thats important
feav said:
rugglez,
Did you see these posts: http://forum.xda-developers.com/showpost.php?p=34600723&postcount=189
http://forum.xda-developers.com/showpost.php?p=34601277&postcount=192
Did you experienced any ploblem with USB?
Click to expand...
Click to collapse
USB works fine, both adb and mass storage
This guide may seem intimidating, but trust me, once you complete it the first time, you'll find it really simple from the next build onwards.
Uploaded a slightly modified version of wkpark's 2nd patch (bootloader one) which may possibly fix one of the errors and may remove need for manually adding some lines. Updated link in OP and attached here too.
I tried the sample kernel and my camera stops functioning and so with other apps such as contacts, they don't start at all. Im on dec 20 nightly. Could it be the ramhack size? Maybe 32mb will suffice. Just saying.
Thanks to this, will probably try this next week..
aldyu said:
I tried the sample kernel and my camera stops functioning and so with other apps such as contacts, they don't start at all. Im on dec 20 nightly. Could it be the ramhack size? Maybe 32mb will suffice. Just saying.
Thanks to this, will probably try this next week..
Click to expand...
Click to collapse
Uploaded 32 MB ram hack kernel for those having problem with camera, try it out.
Download link 32MB RH
Update:
Added 24MB version too. Here you go:
24MB RH kernel
Thanks rugglez, 32 mb rh is ok so far, cm10 is way smoother and can still play nfs most wanted. Btw, can you apply the patch for double lg logo too by wkpark?
Sent from my P990-CM10
After installing the new kernel, if some apps still don't work or there any lag, disable "force gpu rendering" and "disable hardware overlays" in developer settings.
Thank you for your work! Just flashed the 32mb version without any problem. On cm7 the 48mb ramhack was the biggest without breaking 720p recording. Maybe you should give it a try!
Uhm download a kernel zip file?
How about git clone?
Sent from my Nexus 7 using xda app-developers app
tonyp said:
Uhm download a kernel zip file?
How about git clone?
Sent from my Nexus 7 using xda app-developers app
Click to expand...
Click to collapse
Git clone size = ~440mb
Zip size = 120mb which extracts to that same size
Takes more time to download more for people like me with slow Internet, no other reason
Hi rugglez, got the ff. error when installing the required packages, Im on ubuntu 12.10 x64.
Note, selecting 'libsdl1.2-dev' instead of 'libsdl-dev'
Package sun-java6-jdk is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'sun-java6-jdk' has no installation candidate
E: Unable to locate package libwxgtk2.6-dev
E: Couldn't find any package by regex 'libwxgtk2.6-dev'
How to fix? Thanks.
aldyu said:
Hi rugglez, got the ff. error when installing the required packages, Im on ubuntu 12.10 x64.
Note, selecting 'libsdl1.2-dev' instead of 'libsdl-dev'
Package sun-java6-jdk is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'sun-java6-jdk' has no installation candidate
E: Unable to locate package libwxgtk2.6-dev
E: Couldn't find any package by regex 'libwxgtk2.6-dev'
How to fix? Thanks.
Click to expand...
Click to collapse
Can you install the dependencies from Raum's CM10 building thread here?
Follow steps 1 and 2 there.
Let me know if that works, ive updated the guide's step 1(setting up environment)
Installing the dependencies from this guide was the only thing i didnt test, since i had the CM10 environment set up already
a step is missing from this guide.
adb pull /proc/config.gz ~/kernel/lge-star-kernel-jellybean/config.gz
cat config.gz | gunzip > .config
Click to expand...
Click to collapse
then
mv config arch/arm/configs/<your_config_name>_defconfig
make ARCH=arm CROSS_COMPILE=$CCOMPILER oldconfig
make <your_config_name>_defconfig
make ARCH=arm CROSS_COMPILE=$CCOMPILER menuconfig
Click to expand...
Click to collapse
then continue...
if you don't make the default config the compiler throws out some errors.
ps: nice guide btw
rugglez said:
Git clone size = ~1.5gb
Zip size = 440mb which extracts to that same size
Takes forever to download more than a gig for people like me with slow Internet, no other reason
Click to expand...
Click to collapse
Hmm.. downloading it now and wondering why it's only 120mb, not 440mb as you said.
rugglez said:
Can you install the dependencies from Raum's CM10 building thread here?
Follow steps 1 and 2 there.
Let me know if that works, ive updated the guide's step 1(setting up environment)
Installing the dependencies from this guide was the only thing i didnt test, since i had the CM10 environment set up already
Click to expand...
Click to collapse
Thanks, ok now using your updated guide.
Btw, did you happen to upload a copy of the kernel zip file? Downloading from github takes forever, only 8 kb/s.
aldyu said:
Thanks, ok now using your updated guide.
Btw, did you happen to upload a copy of the kernel zip file? Downloading from github takes forever, only 8 kb/s.
Click to expand...
Click to collapse
Just use "git clone git://github.com/CyanogenMod/lge-kernel-star.git", it should give you better download speed than for the zipped archive.
I synced the whole CM10 source tree on the remote buildbox in about 5-10 minutes - so github does provide great downspeed
@rugglez: You should add to the OP that you don't have to use adb to get the kernel config, it's already there
arch/arm/configs/cyanogenmod_p990_defconfig
Please refer to the old cm7 kernel how to by pastime: http://forum.xda-developers.com/showthread.php?t=1227241
I really like the fact that more and more building guides get posted here - and that more and more people are building their own ROMs and kernels these days.
After building (which already is a great start) many people even want to learn more about android development in general. That's the true xda spirit!
Kudos!

[ROM] [DEV ONLY] Ubuntu Phone [TEST] [Xperia T]

This is a port of Ubuntu for Phones for the Xperia T.
THIS IS VERY EXPERIMENTAL STUFF. NOTHING REALLY WORKS AS OF NOW. IT IS A HEAVY WIP.
It's based on the CM10.1 sources and kernel. Those can be found at:
https://github.com/CyanogenMod/android_kernel_sony_msm8x60
https://github.com/CyanogenMod/android_device_sony_blue-common
https://github.com/CyanogenMod/android_device_sony_mint
Also the sources for Ubuntu are at:
http://phablet.ubuntu.com/gitweb
I will be putting up my own modified sources soon.
This is nothing like Android at all. It's nowhere near being a daily either. YOU NEED ADB ACCESS BEFORE YOU CAN EVEN RUN UBUNTU.
PLEASE BACKUP BEFORE INSTALLING THIS ROM.
THIS NEEDS AN UNLOCKED BOOTLOADER.
Installation instructions:
Wipe data
Install the device specific part of Ubutnu
Install the generic Ubuntu part
Reboot to a black screen
Do adb root
Do adb shell and then the following commands:
ubuntu_chroot shell
ubuntu-session
Enjoy the testing!
Screenshots:
Coming up
Download links:
Device specific: http://goo.im/devs/tilal6991/roms/mint/ubuntu/cm-10.1-20130222-UNOFFICIAL-mint.zip
Generic: http://cdimage.ubuntu.com/ubuntu-to...c-demo/quantal-preinstalled-phablet-armhf.zip
Reserved.
wow.keep up awesome work
I shall test this soon, nice work.
Nice, very nice! Congrats tilal6991, I can't wait to get my hands on this device to flash it
Which branches did you build it off?
cm-10.1 or cm-10.1-test (talking about device specific repositories)
cdesai said:
Which branches did you build it off?
cm-10.1 or cm-10.1-test (talking about device specific repositories)
Click to expand...
Click to collapse
Both work. The one I put up was built off cm-10.1-test.
tilal6991 said:
Both work. The one I put up was built off cm-10.1-test.
Click to expand...
Click to collapse
I know, but at this moment cm-10.1 is in a better stage than cm-10.1-test.
cdesai said:
I know, but at this moment cm-10.1 is in a better stage than cm-10.1-test.
Click to expand...
Click to collapse
TBH the only thing worse in test than normal is RIL. And RIL is broken either way in Ubuntu so I thought - oh well...
Cant wait for screens.thanks again Tilal
Good job.
But I prefer the LK bootloader(have a single recovery partition) with Multirom support.
If Xperia T have multirom support, the development and test will be much easier.
I've followed your instructions and the ubuntu session does not start.
This is is the error I get:
Code:
$ adb shell
[email protected]:/ # ubuntu_chroot shell
[email protected]:/# ubuntu-session
Redirecting output to local session logs
/usr/bin/ubuntu-session: line 21: /home/phablet/.ubuntu-session/logs/ubuntu-session.log: No such file or directory
Error, do this: mount -t proc proc /proc
grep: /proc/cpuinfo: No such file or directory
Device=
Starting session bus
Started pulseaudio with pid 455 (0 secs start delay)
Started maliit-server with pid 460 (0 secs start delay)
/usr/bin/ubuntu-session: line 122: 460 Aborted ${service[1]} $arguments &>"$HOME/.ubuntu-session/logs/$binary.log"
Started qml-phone-shell with pid 468 (2 secs start delay)
Got Shell pid = 468
Started chewie_messaging_populate_menu with pid 473 (0 secs start delay)
Started friends-service with pid 478 (0 secs start delay)
/usr/bin/ubuntu-session: line 122: 468 Aborted ${service[1]} $arguments &>"$HOME/.ubuntu-session/logs/$binary.log"
Started manage-address-books.py with pid 509 (2 secs start delay)
Started ofono-setup with pid 551 (12 secs start delay)
Stopping services...
Stopping pulseaudio
/usr/bin/ubuntu-session: line 38: kill: (455) - No such process
Stopping maliit-server
/usr/bin/ubuntu-session: line 38: kill: (460) - No such process
Stopping qml-phone-shell
/usr/bin/ubuntu-session: line 38: kill: (468) - No such process
Stopping chewie_messaging_populate_menu
Stopping friends-service
Stopping manage-address-books.py
/usr/bin/ubuntu-session: line 38: kill: (509) - No such process
Stopping ofono-setup
Killing session bus...
Session stopped.
lilstevie said:
I've followed your instructions and the ubuntu session does not start.
This is is the error I get:
Code:
$ adb shell
[email protected]:/ # ubuntu_chroot shell
[email protected]:/# ubuntu-session
Redirecting output to local session logs
/usr/bin/ubuntu-session: line 21: /home/phablet/.ubuntu-session/logs/ubuntu-session.log: No such file or directory
Error, do this: mount -t proc proc /proc
grep: /proc/cpuinfo: No such file or directory
Device=
Starting session bus
Started pulseaudio with pid 455 (0 secs start delay)
Started maliit-server with pid 460 (0 secs start delay)
/usr/bin/ubuntu-session: line 122: 460 Aborted ${service[1]} $arguments &>"$HOME/.ubuntu-session/logs/$binary.log"
Started qml-phone-shell with pid 468 (2 secs start delay)
Got Shell pid = 468
Started chewie_messaging_populate_menu with pid 473 (0 secs start delay)
Started friends-service with pid 478 (0 secs start delay)
/usr/bin/ubuntu-session: line 122: 468 Aborted ${service[1]} $arguments &>"$HOME/.ubuntu-session/logs/$binary.log"
Started manage-address-books.py with pid 509 (2 secs start delay)
Started ofono-setup with pid 551 (12 secs start delay)
Stopping services...
Stopping pulseaudio
/usr/bin/ubuntu-session: line 38: kill: (455) - No such process
Stopping maliit-server
/usr/bin/ubuntu-session: line 38: kill: (460) - No such process
Stopping qml-phone-shell
/usr/bin/ubuntu-session: line 38: kill: (468) - No such process
Stopping chewie_messaging_populate_menu
Stopping friends-service
Stopping manage-address-books.py
/usr/bin/ubuntu-session: line 38: kill: (509) - No such process
Stopping ofono-setup
Killing session bus...
Session stopped.
Click to expand...
Click to collapse
Try this:
Download https://github.com/Dazzozo/android_...rebuilt/libubuntu_application_api.so?raw=true
adb push it to /system/lib/
Download https://github.com/Dazzozo/android_...lob/ubuntu/prebuilt/ubuntuappmanager?raw=true
chmod 777 it
adb push it to /system/bin/
adb reboot
Then try the commands on the OP again.
can we install it on locked bootloader ?
sahil00150 said:
can we install it on locked bootloader ?
Click to expand...
Click to collapse
No
Sent from my LT30p using Tapatalk 2
feeling sad cause my bootloader is not unlockable
Is there any plans for full working/stable release ?
I wantto try it(maybe later) but i am noob :silly:
leonidas_s1 said:
Is there any plans for full working/stable release ?
I wantto try it(maybe later) but i am noob :silly:
Click to expand...
Click to collapse
It's only a preview build so there is only so much devs can do at the moment. It's more of a proof of concept currently
Sent from my LT30p using Tapatalk 2
matt4321 said:
It's only a preview build so there is only so much devs can do at the moment. It's more of a proof of concept currently
Sent from my LT30p using Tapatalk 2
Click to expand...
Click to collapse
Thank you for your answer!
I hope someone can try to fix it sometime..
To be able to try it!
tilal6991 said:
Try this:
Download https://github.com/Dazzozo/android_...rebuilt/libubuntu_application_api.so?raw=true
adb push it to /system/lib/
Download https://github.com/Dazzozo/android_...lob/ubuntu/prebuilt/ubuntuappmanager?raw=true
chmod 777 it
adb push it to /system/bin/
adb reboot
Then try the commands on the OP again.
Click to expand...
Click to collapse
I get teh same issue. But i cant download the files.Page is not found

LineageOS 15.0 Self-Builder's thread

This is the thread where people trying to build LineageOS themselves communicate. Communication up until now happend inside the "[ROM+Kernel][Unofficial][Unified]LineageOS 15.0[8.0.0]" thread. Picking the important parts in all the user-talk was hard.
So here we go, lets get this **** build.
Short summary - I try to build from LineageOS sources, taking roomservice from LineageOS and - except for blobs from muppets - not using any external repos. If you try to build from akhilnarang's sources, please note that in your post.
Anyways, I wrote this:
mad-murdock said:
If you build from vanilla laos sources, with roomservice, you must "repopick -t kryo-libc" after repo sync to get rid of those soong "arch.arm64.kryo" errors. see https://review.lineageos.org/#/q/branch:lineage-15.0+topic:kryo-libc
credits go to dianlujitao who was so kind to answer my question.
also, in device/oneplus/oneplus3/lineage.mk there is a reference to vendor/cm which you must change to vendor/lineage
then another error happen
Click to expand...
Click to collapse
And got a reply here:
joshndroid said:
Are you referring to the cmsdk/api/7.txt needed by blah/blah/checkpublicapi-cm-last-timestamp is missing and no know rule to make it.
repopicking the lineagesdk-oreo-briungup topic (although it was slated as working) doesn't seem to fix that issue. i must be missing something.
Click to expand...
Click to collapse
No josh, I don't repo-pick that. The error happening for me - which I look into once this is done - is
Code:
[ 99% 1105/1108] glob vendor/qcom/opensource/interfaces/*/Android.bp
[ 99% 1106/1108] glob vendor/qcom/opensource/interfaces/camera/device/1.0/Android.bp
[ 99% 1107/1108] glob vendor/qcom/opensource/interfaces/display/config/1.0/Android.bp
ninja: error: '/opt/develop/lineage-15.0/out/target/common/obj/JAVA_LIBRARIES/org.cyanogenmod.platform.internal_intermediates/link_type', needed by '/opt/develop/lineage-15.0/out/target/common/obj/APPS/OneplusDoze_intermediates/link_type', missing and no known rule to make it
19:31:54 ninja failed with: exit status 1
make: *** [build/core/main.mk:21: run_soong_ui] Error 1
make: Leaving directory '/opt/develop/lineage-15.0'
#### make failed to build some targets (35 seconds) ####
I built a non-booting image of LOS15 a while back, I think it was when they started tagging repositories with LOS15 branch - I still can't seem to boot it myself, so I'll ignore that for a moment.
I do have several word to say about this, for one, I had followed what Google have done to the the CPU arch of Sailfish and Marlin. Making them a generic ARMv8 (for the main arch) and ARMv7 Neon for the secondary arch. Of course, I could've merged the libc changes, but they didn't exist when I started doing the early bringup hence the reason why I stuck myself with Google's way of doing things.
As for the OneplusDoze, I simply commented it out due to the fact that Lineage themselves has yet to bring up the necessary CMHW-related changes. However, this is an experience speaking from about a month ago, I have yet to see whether they have started merging new things connected to CMHW.
I still wonder why my build doesn't boot though. I have done practically everything needed for the bringup, but I'm stuck in this loop where the device would hang on the OnePlus logo before jumping to Fastboot Mode; I suppose someone can help me with this?
F4uzan said:
I still wonder why my build doesn't boot though. I have done practically everything needed for the bringup, but I'm stuck in this loop where the device would hang on the OnePlus logo before jumping to Fastboot Mode; I suppose someone can help me with this?
Click to expand...
Click to collapse
Thanks for your input. Well, it was a month ago. I would try again. Unfortunately, my time is limited, so I have little time to spend on this. Very curious though, if the ROM boots once finished. If not, we still can try the repo's akhilnarang builds from:
akhilnarang said:
Sources
Device tree - https://github.com/akhilnarang/device_oneplus_oneplus3
Vendor - https://github.com/akhilnarang/proprietary_vendor_oneplus
Common tree - https://github.com/akhilnarang/device_oppo_common
Has my Derp kernel builtin
Click to expand...
Click to collapse
My issue is, that ROM is a week behind current development, and somehow I don't want to go back to 7.1.2 - so getting this stuff compiled myself is the best way. Guess thats motivation for most who raised their voice on the 8.0 thread
So I'm getting something like this, will experiment further.
Code:
test/vts/tools/build/tasks/vts_package.mk:216: warning: FindEmulator: cd: vendor/google_vts/testcases: No such file or directory
test/vts/tools/build/tasks/vts_package.mk:216: warning: FindEmulator: cd: vendor/google_vts/testcases: No such file or directory
test/vts/tools/build/tasks/vts_package.mk:216: warning: FindEmulator: cd: vendor/google_vts/testcases: No such file or directory
build/core/base_rules.mk:467: warning: overriding commands for target `/Volumes/android/los/out/host/darwin-x86/cts/android-cts/testcases/libcrash-jni.so'
build/core/base_rules.mk:467: warning: ignoring old commands for target `/Volumes/android/los/out/host/darwin-x86/cts/android-cts/testcases/libcrash-jni.so'
build/core/base_rules.mk:467: warning: overriding commands for target `/Volumes/android/los/out/target/product/oneplus3/testcases/libcrash-jni/libcrash-jni.so'
build/core/base_rules.mk:467: warning: ignoring old commands for target `/Volumes/android/los/out/target/product/oneplus3/testcases/libcrash-jni/libcrash-jni.so'
build/core/base_rules.mk:467: warning: overriding commands for target `/Volumes/android/los/out/target/product/oneplus3/testcases/hello_world_test/hello_world_test'
build/core/base_rules.mk:467: warning: ignoring old commands for target `/Volumes/android/los/out/target/product/oneplus3/testcases/hello_world_test/hello_world_test'
./test/vts/utils/python/archive/Android.mk:28: warning: overriding commands for target `default'
./test/vts/runners/host/tcp_server/Android.mk:19: warning: ignoring old commands for target `default'
./test/vts/utils/python/coverage/Android.mk:28: warning: overriding commands for target `default'
./test/vts/utils/python/archive/Android.mk:28: warning: ignoring old commands for target `default'
build/core/Makefile:34: warning: overriding commands for target `/Volumes/android/los/out/target/product/oneplus3/system/etc/libnfc-brcm.conf'
build/core/base_rules.mk:375: warning: ignoring old commands for target `/Volumes/android/los/out/target/product/oneplus3/system/etc/libnfc-brcm.conf'
build/core/Makefile:34: warning: overriding commands for target `/Volumes/android/los/out/target/product/oneplus3/system/etc/libnfc-nxp.conf'
build/core/base_rules.mk:375: warning: ignoring old commands for target `/Volumes/android/los/out/target/product/oneplus3/system/etc/libnfc-nxp.conf'
[ 96% 29/30] glob frameworks/wilhelm/include/SLES/**/*.h
ninja: error: 'cm-api-stubs-docs', needed by '/Volumes/android/los/out/target/common/obj/PACKAGING/cm_public_api.txt', missing and no known rule to make it
20:00:43 ninja failed with: exit status 1
make: *** [run_soong_ui] Error 1
#### make failed to build some targets (59 seconds) ####
iMac-Micha:los magnum828$
Magnum828 said:
So I'm getting something like this, will experiment further.
Click to expand...
Click to collapse
I've tried Akhil's repos and a cherry pick from ElixiumOS which brings in a blob called libgpustats.so in vendor/oneplus
I get stuck @17% with ninja giving an error with relation to something in audio-caf.
Something to do with audio_hw.c
I ain't no coder so I can't fix it unfortunately. ?
inflames91 said:
I've tried Akhil's repos and a cherry pick from ElixiumOS which brings in a blob called libgpustats.so in vendor/oneplus
I get stuck @17% with ninja giving an error with relation to something in audio-caf.
Something to do with audio_hw.c
I ain't no coder so I can't fix it unfortunately. ?
Click to expand...
Click to collapse
How did you go past the cm-api-stubs ???
Oh man, thanks for seperating this out.
1) I repo sync'd lineage-15.0
2) breakfast oneplus3
3) cloned/checked-out akhil's 3 repo's for device/kernel/vendor replacing what I already had
3a) Dont need repo pick for kryo-libc unless you wanna change main arch in device/boardconfig back to kryo (which is really what it should be)
3b) If you use stock device tree, you may need to edit some files to point to lineage files instead of cm (look at this commit: http://tinyurl.com/y6u844ah)
~4) I might have needed to pull libgpustats from my phone or op3t or something, don't remember on that.
Pretty sure at this point it builds up to ~3-10k files before you run into failures in hardware/qcom/audio, hardware/qcom/display, and hardware/qcom/media.
5) Delete the following folders in hardware/qcom:
audio/audio-caf/display/display-caf/media/media-caf
and clone dianlujitao 3 repo's(specify branch lineage-15.0): hardware/qcom/audio, hardware/qcom/display, and hardware/qcom/media
From here I can compile up to ~35k files before i get failure generating cache.img.
I haven't had time to go back through the error but it might just be a simple "not enough space" error at which point we just need to edit boardconfig to make it think it can have a larger cache img, but im not positive thats the issue/fix. And I havent had time to do anything else from here yet either. Will update when I know more.
After reading all these self test stories I myself tried to build again.
I got this for the first time today, never saw this last time I tried to build [The line in RED]:
Code:
[email protected]:~/Android/AOSP/LineageOS15$ source build/envsetup.sh
including device/generic/car/car-arm64/vendorsetup.sh
including device/generic/car/car-armv7-a-neon/vendorsetup.sh
including device/generic/car/car-x86_64/vendorsetup.sh
including device/generic/car/car-x86/vendorsetup.sh
including device/generic/mini-emulator-arm64/vendorsetup.sh
including device/generic/mini-emulator-armv7-a-neon/vendorsetup.sh
including device/generic/mini-emulator-x86_64/vendorsetup.sh
including device/generic/mini-emulator-x86/vendorsetup.sh
including vendor/lineage/vendorsetup.sh
including sdk/bash_completion/adb.bash
[email protected]:~/Android/AOSP/LineageOS15$ brunch oneplus3
including vendor/lineage/vendorsetup.sh
[COLOR=Red][B]Trying dependencies-only mode on a non-existing device tree?[/B][/COLOR]
Any idea if this will cause any issue or not.
Magnum828 said:
How did you go past the cm-api-stubs ???
Click to expand...
Click to collapse
I was getting errors for libgpustats.
Solved that bit. ?
arnabJ said:
After reading all these self test stories I myself tried to build again.
I got this for the first time today, never saw this last time I tried to build [The line in RED]:
Code:
[email protected]:~/Android/AOSP/LineageOS15$ source build/envsetup.sh
including device/generic/car/car-arm64/vendorsetup.sh
including device/generic/car/car-armv7-a-neon/vendorsetup.sh
including device/generic/car/car-x86_64/vendorsetup.sh
including device/generic/car/car-x86/vendorsetup.sh
including device/generic/mini-emulator-arm64/vendorsetup.sh
including device/generic/mini-emulator-armv7-a-neon/vendorsetup.sh
including device/generic/mini-emulator-x86_64/vendorsetup.sh
including device/generic/mini-emulator-x86/vendorsetup.sh
including vendor/lineage/vendorsetup.sh
including sdk/bash_completion/adb.bash
[email protected]:~/Android/AOSP/LineageOS15$ brunch oneplus3
including vendor/lineage/vendorsetup.sh
[COLOR=Red][B]Trying dependencies-only mode on a non-existing device tree?[/B][/COLOR]
Any idea if this will cause any issue or not.
Click to expand...
Click to collapse
no that 'dependencies-only' notification has no real bearing on the issues that are being seen with building.
Update 1:
Bad luck. I too got stuck at making cache.img.
I got printname too large error. Probably cache.img size error as stated by @HolyAngel.
I have approximately 250GB of free HDD space left just in case it may be of some help to know.
I will now try to search for such an issue and try to fix if I get some fix related to it.
If someone knows anything regarding this and can shed some light on how to get past this it would be really appreciated.
Heres the whole error message:
Code:
14 warnings generated.
[ 55% 46381/83932] Target cache fs image: /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img
FAILED: /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img
/bin/bash -c "(mkdir -p /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache ) && (mkdir -p /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates && rm -rf /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"ext_mkuserimg=mkuserimg.sh\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"fs_type=ext4\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"system_size=3154116608\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"userdata_size=57436708864\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"cache_fs_type=f2fs\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"cache_size=268435456\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"extfs_sparse_flag=-s\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"squashfs_sparse_flag=-s\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"selinux_fc=/home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/ETC/file_contexts.bin_intermediates/file_contexts.bin\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"skip_fsck=true\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (PATH=/home/arnabj/Android/AOSP/LineageOS15/out/host/linux-x86/bin/:\$PATH ./build/tools/releasetools/build_image.py /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/system ) && (size=\$(for i in /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img; do stat --format \"%s\" \"\$i\" | tr -d '\\n'; echo +; done; echo 0); total=\$(( \$( echo \"\$size\" ) )); printname=\$(echo -n \"/home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img\" | tr \" \" +); img_blocksize=270336; twoblocks=\$((img_blocksize * 2)); onepct=\$(((((276824064 / 100) - 1) / img_blocksize + 1) * img_blocksize)); reserve=\$((twoblocks > onepct ? twoblocks : onepct)); maxsize=\$((276824064 - reserve)); echo \"\$printname maxsize=\$maxsize blocksize=\$img_blocksize total=\$total reserve=\$reserve\"; if [ \"\$total\" -gt \"\$maxsize\" ]; then echo \"error: \$printname too large (\$total > [276824064 - \$reserve])\"; false; elif [ \"\$total\" -gt \$((maxsize - 32768)) ]; then echo \"WARNING: \$printname approaching size limit (\$total now; limit \$maxsize)\"; fi )"
error: failed to build /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img from /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache
Running: mkf2fsuserimg.sh /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img 268435456
in mkf2fsuserimg.sh PATH=/home/arnabj/Android/AOSP/LineageOS15/out/host/linux-x86/bin/:/usr/lib/jvm/java-8-openjdk-amd64/bin:/home/arnabj/Android/AOSP/LineageOS15/out/soong/host/linux-x86/bin:/home/arnabj/Android/AOSP/LineageOS15/out/host/linux-x86/bin:/home/arnabj/Android/AOSP/LineageOS15/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin:/home/arnabj/Android/AOSP/LineageOS15/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin:/home/arnabj/Android/AOSP/LineageOS15/development/scripts:/home/arnabj/Android/AOSP/LineageOS15/prebuilts/devtools/tools:/home/arnabj/Android/AOSP/LineageOS15/external/selinux/prebuilts/bin:/home/arnabj/Android/AOSP/LineageOS15/prebuilts/android-emulator/linux-x86_64:/home/arnabj/bin:/home/arnabj/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
make_f2fs -l 268435456 /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img
[ 55% 46386/83932] ld /home/arnabj/Android/AOSP/LineageOS15/out/soong/.intermediates/external/protobuf/aprotoc/linux_x86_64/aprotoc
ninja: build stopped: subcommand failed.
15:58:23 ninja failed with: exit status 1
build/core/main.mk:21: recipe for target 'run_soong_ui' failed
make: *** [run_soong_ui] Error 1
make: Leaving directory '/home/arnabj/Android/AOSP/LineageOS15'
#### make failed to build some targets (04:37:46 (hh:mm:ss)) ####
Original:
Just an update.
Hoping for the best.
I am using Akhilnarang's device sources (kernel & vendor included).
I have replaced hardware_qcom_xyz / hardware_qcom_xyz-caf with hardware_qcom_xyz from Official LineageOS repo instead of that from dianlujitao as posted by HolyAngel.
Also I have cherry picked the required commit in vendor/oneplus3 as stated by inflames91.
The build is under process.
I am already at 52% with 44333 files out of 83932.
As per HolyAngel he/she got stuck at ~35k lines.
I am currently at ~45k lines.
Which is surely better.
I am completely noob on all these things.
I am just reading through different guides and posts here to try to build.
Wish me luck and give suggestions if you think it will be useful for me.
Sent from my OnePlus3 using XDA Labs
arnabJ said:
Update 1:
Bad luck. I too got stuck at making cache.img.
I got printname too large error. Probably cache.img size error as stated by @HolyAngel.
I have approximately 250GB of free HDD space left just in case it may be of some help to know.
I will now try to search for such an issue and try to fix if I get some fix related to it.
If someone knows anything regarding this and can shed some light on how to get past this it would be really appreciated.
Heres the whole error message:
Code:
14 warnings generated.
[ 55% 46381/83932] Target cache fs image: /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img
FAILED: /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img
/bin/bash -c "(mkdir -p /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache ) && (mkdir -p /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates && rm -rf /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"ext_mkuserimg=mkuserimg.sh\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"fs_type=ext4\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"system_size=3154116608\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"userdata_size=57436708864\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"cache_fs_type=f2fs\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"cache_size=268435456\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"extfs_sparse_flag=-s\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"squashfs_sparse_flag=-s\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"selinux_fc=/home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/ETC/file_contexts.bin_intermediates/file_contexts.bin\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (echo \"skip_fsck=true\" >> /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt ) && (PATH=/home/arnabj/Android/AOSP/LineageOS15/out/host/linux-x86/bin/:\$PATH ./build/tools/releasetools/build_image.py /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/obj/PACKAGING/cache_intermediates/cache_image_info.txt /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/system ) && (size=\$(for i in /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img; do stat --format \"%s\" \"\$i\" | tr -d '\\n'; echo +; done; echo 0); total=\$(( \$( echo \"\$size\" ) )); printname=\$(echo -n \"/home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img\" | tr \" \" +); img_blocksize=270336; twoblocks=\$((img_blocksize * 2)); onepct=\$(((((276824064 / 100) - 1) / img_blocksize + 1) * img_blocksize)); reserve=\$((twoblocks > onepct ? twoblocks : onepct)); maxsize=\$((276824064 - reserve)); echo \"\$printname maxsize=\$maxsize blocksize=\$img_blocksize total=\$total reserve=\$reserve\"; if [ \"\$total\" -gt \"\$maxsize\" ]; then echo \"error: \$printname too large (\$total > [276824064 - \$reserve])\"; false; elif [ \"\$total\" -gt \$((maxsize - 32768)) ]; then echo \"WARNING: \$printname approaching size limit (\$total now; limit \$maxsize)\"; fi )"
error: failed to build /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img from /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache
Running: mkf2fsuserimg.sh /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img 268435456
in mkf2fsuserimg.sh PATH=/home/arnabj/Android/AOSP/LineageOS15/out/host/linux-x86/bin/:/usr/lib/jvm/java-8-openjdk-amd64/bin:/home/arnabj/Android/AOSP/LineageOS15/out/soong/host/linux-x86/bin:/home/arnabj/Android/AOSP/LineageOS15/out/host/linux-x86/bin:/home/arnabj/Android/AOSP/LineageOS15/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin:/home/arnabj/Android/AOSP/LineageOS15/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin:/home/arnabj/Android/AOSP/LineageOS15/development/scripts:/home/arnabj/Android/AOSP/LineageOS15/prebuilts/devtools/tools:/home/arnabj/Android/AOSP/LineageOS15/external/selinux/prebuilts/bin:/home/arnabj/Android/AOSP/LineageOS15/prebuilts/android-emulator/linux-x86_64:/home/arnabj/bin:/home/arnabj/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
make_f2fs -l 268435456 /home/arnabj/Android/AOSP/LineageOS15/out/target/product/oneplus3/cache.img
[ 55% 46386/83932] ld /home/arnabj/Android/AOSP/LineageOS15/out/soong/.intermediates/external/protobuf/aprotoc/linux_x86_64/aprotoc
ninja: build stopped: subcommand failed.
15:58:23 ninja failed with: exit status 1
build/core/main.mk:21: recipe for target 'run_soong_ui' failed
make: *** [run_soong_ui] Error 1
make: Leaving directory '/home/arnabj/Android/AOSP/LineageOS15'
#### make failed to build some targets (04:37:46 (hh:mm:ss)) ####
Original:
Just an update.
Hoping for the best.
I am using Akhilnarang's device sources (kernel & vendor included).
I have replaced hardware_qcom_xyz / hardware_qcom_xyz-caf with hardware_qcom_xyz from Official LineageOS repo instead of that from dianlujitao as posted by HolyAngel.
Also I have cherry picked the required commit in vendor/oneplus3 as stated by inflames91.
The build is under process.
I am already at 52% with 44333 files out of 83932.
As per HolyAngel he/she got stuck at ~35k lines.
I am currently at ~45k lines.
Which is surely better.
I am completely noob on all these things.
I am just reading through different guides and posts here to try to build.
Wish me luck and give suggestions if you think it will be useful for me.
Sent from my OnePlus3 using XDA Labs
Click to expand...
Click to collapse
Have you tried commenting out "BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := f2fs" from device/oneplus/oneplus3/BoardConfig.mk?
This might be out of the question and implausible, and possibly would break something, but seeing that you're failing at F2FS cacheimage generation, it might be worth trying. I have never encountered such error, but then again, I hacked around the device tree a bit too much and may have accidentally "fixed" the error myself.
F4uzan said:
Update 1:
Bad luck. I too got stuck at making cache.img.
I got printname too large error. Probably cache.img size error as stated by @HolyAngel.
I have approximately 250GB of free HDD space left just in case it may be of some help to know.
I will now try to search for such an issue and try to fix if I get some fix related to it.
If someone knows anything regarding this and can shed some light on how to get past this it would be really appreciated.
Heres the whole error message:
Have you tried commenting out "BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := f2fs" from device/oneplus/oneplus3/BoardConfig.mk?
This might be out of the question and implausible, and possibly would break something, but seeing that you're failing at F2FS cacheimage generation, it might be worth trying. I have never encountered such error, but then again, I hacked around the device tree a bit too much and may have accidentally "fixed" the error myself.
Click to expand...
Click to collapse
Ok I will try that later tonight.
Also commenting it will be better or changing it to ext4?
Also should I start rebuild from where it got stuck or should I first delete the out directory and start fresh?
___________________________________________
Were you able to complete a working build?
If yes why not share your working device tree?
Sent from my OnePlus3 using XDA Labs
arnabJ said:
Ok I will try that later tonight.
Also commenting it will be better or changing it to ext4?
Also should I start rebuild from where it got stuck or should I first delete the out directory and start fresh?
___________________________________________
Were you able to complete a working build?
If yes why not share your working device tree?
Sent from my OnePlus3 using XDA Labs
Click to expand...
Click to collapse
I haven't tried changing it to EXT4 as I just pieced two and two together and came up with an amateurish solution. Commenting it out would be better, seeing that plenty of device tree doesn't seem to have that specific line anyway.
As for the out directory, I think building dirty is fine but should you encounter an issue, it'd be better if you do a make clean or something to that effect.
Device tree? My device tree has not been updated for about weeks now and most of the solutions there are either hacks or dirty workarounds. And as I have said before, my build compiles but it doesn't boot; I have tried building AOSP and Lineage (which does compiles) but sadly none of them boot. I suspect this is the cause of the device tree which I have hacked around.
F4uzan said:
I haven't tried changing it to EXT4 as I just pieced two and two together and came up with an amateurish solution. Commenting it out would be better, seeing that plenty of device tree doesn't seem to have that specific line anyway.
As for the out directory, I think building dirty is fine but should you encounter an issue, it'd be better if you do a make clean or something to that effect.
Device tree? My device tree has not been updated for about weeks now and most of the solutions there are either hacks or dirty workarounds. And as I have said before, my build compiles but it doesn't boot; I have tried building AOSP and Lineage (which does compiles) but sadly none of them boot. I suspect this is the cause of the device tree which I have hacked around.
Click to expand...
Click to collapse
Ok. I will update with new info when I have any.
Sent from my OnePlus3 using XDA Labs
I changed
BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := F2FS
to
BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4
in boardconfig and cache builds fine now. still compiling. will update when i know more.
IT BUILDS! Got output zip, will upload here for testing.
---------- Post added at 08:31 AM ---------- Previous post was at 08:04 AM ----------
https://drive.google.com/open?id=0B7UqGxB-q5f3VVh1d3dkUjI1Rm8
that is link, haven't tried it, have authentication apps i need to backup first
HolyAngel said:
I changed
BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := F2FS
to
BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := EXT4
in boardconfig and cache builds fine now. still compiling. will update when i know more.
IT BUILDS! Got output zip, will upload here for testing.
---------- Post added at 08:31 AM ---------- Previous post was at 08:04 AM ----------
https://drive.google.com/open?id=0B7UqGxB-q5f3VVh1d3dkUjI1Rm8
that is link, haven't tried it, have authentication apps i need to backup first
Click to expand...
Click to collapse
I did exactly what you did and it compiled successfully.
However, it did not boot into system.
Booted to bootloader.
I used Sultan's kernel as source though.
Maybe that's why?
inflames91 said:
I did exactly what you did and it compiled successfully.
However, it did not boot into system.
Booted to bootloader.
I used Sultan's kernel as source though.
Maybe that's why?
Click to expand...
Click to collapse
could possibly be kernel, i'm using akhilnarangs but haven't tried to boot it yet
HolyAngel said:
I changed
BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := F2FS
to
BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := EXT4
in boardconfig and cache builds fine now. still compiling. will update when i know more.
IT BUILDS! Got output zip, will upload here for testing.
---------- Post added at 08:31 AM ---------- Previous post was at 08:04 AM ----------
https://drive.google.com/open?id=0B7UqGxB-q5f3VVh1d3dkUjI1Rm8
that is link, haven't tried it, have authentication apps i need to backup first
Click to expand...
Click to collapse
Does this boot?

Failed to initialize editor

Hello,
I have fresh install OS
Linux Mint 20 Ulyana (Cinnamon)
and android-studio works propely, except the activity design editor. It yust says: "Failed to initialize editor". For a more information I launched it in terminal.
I tried to reinstall and resyc everything, still not work. Even with a new basic template activity project.
Here is log from terminal:
[email protected] /opt/android-studio/bin $ sh studio.sh
2020-07-19 15:47:21,571 [ 916] WARN - com.intellij.ide.ui.LafManager - List.rowHeight = 0 in Darcula; it may lead to performance degradation
2020-07-19 15:47:21,572 [ 917] WARN - com.intellij.ide.ui.LafManager - Table.rowHeight = 0 in Darcula; it may lead to performance degradation
2020-07-19 15:47:21,572 [ 917] WARN - com.intellij.ide.ui.LafManager - Tree.rowHeight = 0 in Darcula; it may lead to performance degradation
2020-07-19 15:47:21,627 [ 972] WARN - nSystem.impl.ActionManagerImpl - keymap "ReSharper" not found [Plugin: com.android.tools.ndk]
2020-07-19 15:47:24,108 [ 3453] WARN - #com.android.ddmlib - * daemon not running; starting now at tcp:5037
2020-07-19 15:47:24,233 [ 3578] WARN - #com.android.ddmlib - * daemon started successfully
2020-07-19 15:47:24,682 [ 4027] WARN - ugins.textmate.TextMateService - Missing builtin bundles, checked:
/home/martin/.AndroidStudio4.0/config/plugins/textmate/lib/bundles
/opt/android-studio/plugins/textmate/lib/bundles
2020-07-19 15:47:25,121 [ 4466] WARN - com.intellij.util.xmlb.Binding - no accessors for class org.jetbrains.kotlin.idea.highlighter.KotlinDefaultHighlightingSettingsProvider
2020-07-19 15:47:29,314 [ 8659] WARN - com.intellij.util.xmlb.Binding - no accessors for class org.jetbrains.kotlin.idea.scripting.gradle.GradleScriptInputsWatcher$Storage
2020-07-19 15:47:29,330 [ 8675] WARN - com.intellij.util.xmlb.Binding - no accessors for class org.jetbrains.kotlin.idea.core.script.configuration.utils.ScriptClassRootsStorage
2020-07-19 15:47:42,804 [ 22149] WARN - mon.editor.DesignerEditorPanel - Failed to initialize DesignerEditorPanel
java.util.concurrent.CompletionException: java.lang.IllegalStateException: Could not init NlModel. AndroidFacet is unexpectedly null. That might happen if the file does not belong to an Android module of the project.
at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273)
at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280)
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1606)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: Could not init NlModel. AndroidFacet is unexpectedly null. That might happen if the file does not belong to an Android module of the project.
at com.android.tools.idea.common.editor.DesignerEditorPanel.createAndInitNeleModel(DesignerEditorPanel.java:223)
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1604)
... 3 more
Click to expand...
Click to collapse
Solution
MartinK7 said:
Hello,
I have fresh install OS
Linux Mint 20 Ulyana (Cinnamon)
and android-studio works propely, except the activity design editor. It yust says: "Failed to initialize editor". For a more information I launched it in terminal.
I tried to reinstall and resyc everything, still not work. Even with a new basic template activity project.
Here is log from terminal:
Click to expand...
Click to collapse
Newer mind I FOUND a solution
Change in stytes.xml this:
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
to this:
<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">

How To Guide How to compile TWRP for the ASUS Zenfone 8

There are a lot of web pages about building your own TWRP image in the internet but at least I did not find a HowTo with all necessary instructions and infos in one place.
Therefor I wrote this little HowTo about building a TWRP image for the ASUS Zenfone 8. The instructions in the HowTo can also be used to create TWRP images for other phones supported by TWRP. The HowTo is for a PC running the Linux OS.
Note that this HowTo can only be used for phones that are officially supported by TWRP.
In the end, creating a TWRP image is also quite easy once you know how it works, thanks to the well-done setup of the development environment by the TWRP developer.
Prereqs
The repositories with the manifests for TWRP are here https://github.com/minimal-manifest-twrp and the repositories with the TWRP files and the device trees for the phones supported by TWRP are here: https://github.com/TeamWin . So you need access to github for creating your own TWRP image.
The tool repo is required to maintain the repositories for TWRP; you can download repo from https://gerrit.googlesource.com/git-repo
It's not necessary to install additional tools for creating an TWRP image -- all necessary tools to create the image are in the repositories for TWRP.
Note
To check if there is a repository with the device tree for another phone for TWRP use the search function on the page https://github.com/TeamWin and search for the device ID of the phone.
To search via script use (I006D is the device ID for the ASUS Zenfone 8):
Bash:
wget "https://api.github.com/search/repositories?q=I006D" -O ./repository_list
Spoiler: search example for the ASUS Zenfone 8
Code:
[ OmniRom 13 Dev - [email protected] /data/develop/android/twrpX ] $ wget "https://api.github.com/search/repositories?q=I006D" -O ./repository_list
--2022-11-27 09:20:27-- https://api.github.com/search/repositories?q=I006D
Resolving api.github.com (api.github.com)... 140.82.121.5
Connecting to api.github.com (api.github.com)|140.82.121.5|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/json]
Saving to: ‘./repository_list’
./repository_list [ <=> ] 46.30K --.-KB/s in 0.01s
2022-11-27 09:20:28 (3.55 MB/s) - ‘./repository_list’ saved [47414]
[ OmniRom 13 Dev - [email protected] /data/develop/android/twrpX ] $
[ OmniRom 13 Dev - [email protected] /data/develop/android/twrpX ] $ grep "full_name" ./repository_list
"full_name": "CaptainThrowback/android_device_asus_I006D",
"full_name": "nguyenhung9xdev2022/android_kernel_asus_I006D",
"full_name": "nguyenhung9xdev2022/android_vendor_asus_I006D",
"full_name": "nguyenhung9xdev2022/android_device_asus_I006D",
"full_name": "asus-development/android_device_asus_I006D",
"full_name": "OpenPecha-Data/I006D4C7E",
"full_name": "dmd79/android_device_asus_I006D",
[ OmniRom 13 Dev - [email protected] /data/develop/android/twrpX ] $
To get the device ID for a phone execute :
Bash:
adb shell getprop ro.product.system.device
e,g.
Code:
#
# on a PC for a connected ASUS Zenfone 8
#
[[email protected] /data/develop/android/twrp]$ adb shell getprop ro.product.system.device
I006D
[[email protected] /data/develop/android/twrp]$
#
# on the ZUK Z2 Pro
#
z2_row:/ # getprop ro.product.system.device
z2_row
z2_row:/ #
The device ID is required for the lunch command used to copy the repositories with the device trees (see below).
Building the ROM
First copy the necessary repositories for building TWRP to your local machine using these commands:
Bash:
#
# create a new directory for the repositories (optional)
#
mkdir twrp
cd twrp
# init the local repositories
#
# As of 27.11.2022 the latest version of the TWRP repositories is 12.1 ;
# to download the default repository version you can omit the parameter "-b twrp-12.1"
# As of 27.11.2022 the repositories for TWRP 12.1 use about 45 GB; to save some
# space (about 12 GB) you could add the parameter --depth=1
#
repo init -u https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp.git -b twrp-12.1
# sync the repositories (Parameter -j8 = use 8 parallel jobs; adjust this parameter to
# the number of CPU available on your PC)
#
repo sync -c -j8 --force-sync --no-clone-bundle --no-tags
Next add the device dependent repositories for the ASUS Zenfone 8.
The format of the parameter for the lunch command is
twrp_<device_id>-eng
So the parameter for the ASUS Zenfone 8 is twrp_I006D-eng.
Bash:
#
# init the environment to build the TWRP image
#
. build/envsetup.sh
export ALLOW_MISSING_DEPENDENCIES=true
lunch twrp_I006D-eng
Spoiler: lunch example
Code:
TWRP Dev - [email protected] /data/develop/android/twrp ] $ lunch twrp_I006D-eng
In file included from build/make/core/config.mk:313:
In file included from build/make/core/envsetup.mk:312:
build/make/core/product_config.mk:160: error: Can not locate config makefile for product "twrp_I006D".
11:35:37 dumpvars failed with: exit status 1
Device I006D not found. Attempting to retrieve device repository from TeamWin Github (http://github.com/TeamWin).
Found repository: android_device_asus_I006D
Checking branch info
Calculated revision: android-12.1
Adding dependency:
Repository: android_device_asus_I006D
Branch: android-12.1
Remote: TeamWin
Path: device/asus/I006D
Syncing repository to retrieve project.
Fetching: 100% (1/1), done in 12.846s
NOT Garbage collecting: 0% (0/1), done in 0.001s
repo sync has finished successfully.
Repository synced!
Looking for dependencies
Adding dependencies to manifest
Adding dependency:
Repository: android_device_asus_sm8350-common
Branch: android-12.1
Remote: TeamWin
Path: device/asus/sm8350-common
Syncing dependencies
Fetching: 100% (1/1), done in 15.848s
NOT Garbage collecting: 0% (0/1), done in 0.001s
repo sync has finished successfully.
Looking for dependencies
device/asus/sm8350-common has no additional dependencies.
Done
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=99.87.36
TARGET_PRODUCT=twrp_I006D
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv8-a
TARGET_2ND_CPU_VARIANT=generic
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-6.0.9-200.fc36.x86_64-x86_64-Fedora-Linux-36-(MATE-Compiz)
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=SP2A.220405.004
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES=device/asus/sm8350-common
============================================
[ TWRP Dev - [email protected] /data/develop/android/twrp ] $
And final build the TWRP image
Bash:
mka bootimage
Spoiler: mka bootimage example
Code:
[ TWRP Dev - [email protected] /data/develop/android/twrp ] $ time mka bootimage
build/make/core/soong_config.mk:197: warning: BOARD_PLAT_PUBLIC_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS instead.
build/make/core/soong_config.mk:198: warning: BOARD_PLAT_PRIVATE_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS instead.
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=99.87.36
TARGET_PRODUCT=twrp_I006D
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv8-a
TARGET_2ND_CPU_VARIANT=generic
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-6.0.9-200.fc36.x86_64-x86_64-Fedora-Linux-36-(MATE-Compiz)
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=SP2A.220405.004
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES=device/asus/sm8350-common
============================================
[ 78% 246/312] including bootable/recovery/Android.mk ...
bootable/recovery/prebuilt/Android.mk:437: warning: vendor_hw: bootable/recovery/prebuilt/relink.sh out/target/product/I006D/recovery/root/vendor/bin/hw
[ 95% 299/312] including system/sepolicy/Android.mk ...
system/sepolicy/Android.mk:57: warning: BOARD_PLAT_PUBLIC_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS instead.
system/sepolicy/Android.mk:62: warning: BOARD_PLAT_PRIVATE_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS instead.
[ 30% 8637/28297] //bionic/libc:libc_bionic clang arch-arm64/bionic/setjmp.S
....
Removing unneeded service: keymaster-4-1-citadel
Service_Cleanup script complete.
[100% 28297/28297] Target boot image from recovery: out/target/product/I006D/boot.img
#### build completed successfully (14:50 (mm:ss)) ####
real 14m50.110s
user 182m6.217s
sys 11m58.492s
[ TWRP Dev - [email protected] /data/develop/android/twrp ] $
Note:
For devices without A/B devices use mka recoveryimage.
The TWRP image will be created in file boot.img the directory ./out/target/product/I006D e.g.:
Code:
[ TWRP Dev - [email protected]t15g /data/develop/android/twrp ] $ ls -ltr out/target/product/I006D/boot.img
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 100663296 Nov 27 12:06 out/target/product/I006D/boot.img
[ TWRP Dev - [email protected] /data/develop/android/twrp ] $
To test the image just boot the phone from the image
Bash:
adb reboot bootloader
sudo fastboot boot out/target/product/I006D/boot.img
And check if the boot was succesfull:
Code:
[ OmniRom 13 Dev - [email protected] /data/develop/android/twrpX ] $ adb shell getprop ro.bootmode
unknown
[ OmniRom 13 Dev - [email protected] /data/develop/android/twrpX ] $
unknown is the expected value here.
Trouble Shooting
On some pages I found a hint that the build scripts require python2 and will not work with python3. But this is most probably not true anymore because building the image with python3 worked without problems.
It's strongly recommended to use separate sessions for compiling OmniROM or TWRP or even different versions of TWRP:
All these build environments define the same commands in the file ./build/envsetup.sh but with different functionality.
As of 27.11.2022 there are only 2 branches in the repository with the manifests for TWRP : version 11 and version 12.1.
If there is no branch for one of these versions in the repositories for the device tree of the phone for which you want to create a TWRP image the lunch command will fail.
The repositories with the manifests for TWRP prior to version 11 can be fetched with this command:
Bash:
# Minimal manifest for building TWRP for devices shipped with Android 5.1 through Android 9.0
#
repo init -u https://github.com/minimal-manifest-twrp/platform_manifest_twrp_omni.git -b twrp-9.0
Note that the lunch command in the old repositories does work different.
Notes:
The URL to the repository with the device tree for a phone is also on the page for the device on the TWRP device list: https://twrp.me/Devices/
See https://unofficialtwrp.com/build-compile-twrp-recovery for other possible settings for the build
see here for How to add additional files to an TWRP image
XDA Forum thread about compiling TWRP: How to compile TWRP touch recovery

Categories

Resources