Linux NOOB; Where to extract Device Tree, Vendor, Kernel? - Android Q&A, Help & Troubleshooting

I'm running Ubuntu 16.4 in VirtualBox and I'm trying to follow this guide for creating a custom ROM. Problem is, I am completely new to Linux and I'm literally copying and pasting command line. I don't understand what everything does. I'm just kind of doing it for now, learning as I go. So far, everything has worked fine. But now, I'm stuck at this part:
Now before starting with Building guide you have to Download your Device Identity That is has follows
1) Device Tree
2) Vendor
3) Kernel
The Above files are very Vital Parameters of building they specify your device and its Characteristics.
Now you might think from where you have to download those files?
Don't be confused its simple Search in our device forum for CM Tree and Kernel and Vendor. The Dev of CM for your Device forum will specify it in his ROM thread.
Click to expand...
Click to collapse
I found my device's device tree on github: https://github.com/j03lpr86/android_device_samsung_afyonltetmo
What do I do with it? Download the zip and put it somewhere and then extract it somewhere? If so, where? Or do I use the "Clone with HTTPS" link? If so, how do I execute it in the terminal?
Same questions with the vendor I found: https://github.com/j03lpr86/android_vendor_samsung_afyonltetmo
As for the kernel, what do I do for that? XDA doesn't have my device listed (Galaxy Avant). I downloaded the stock ROM from Sammobile. Do I extract kernel.img from that? If so, where do I place it?
There are just too many assumptions that the author of the guide makes and I don't understand what to do at this point.

have you looked on git hub for them?

Related

Compiling AOSP from source

Hiya I am interested in compiling my own version of the android project from the latest sources for Hero but I am having a little bit of trouble, I have been attempting to follow this guide android.modaco.com/index.php?showtopic=301857&view=findpost&p=1179830 but it does not seem to make a lot of sense to me. For instance there is no .repo/local_manifest.xml file only a .repo/manifest.xml file and editing this as outlined gives me an error. Could somebody point me in the direction of a fairly noob friendly guide for this kind of stuff, thanks a lot.
Conb123
P.S Sorry about the dodgy link, newbie restrictions prevented me from formatting it properly
this should be in Q&A Section not development really. But im looking for this too! installed ubuntu using Wubi set up JDK,SDK testsign etc and repo but god knows how to do it all! I only want to port cyanogenROM
follow this: http://source.android.com/download
when you got everything synced you can basically type "make" and watch it compile for a while. i managed to do it with just above zero knowledge about compiling.
if you want the cyanogen sources try it with the according repo. i have zero idea about vendor overlays, as i needed to compile only the recovery (watched two hours of eclair compiling, then was told i need cupcake sources and can compile the recovery only...)
Yes I am aware of how to get sources and how to compile them, I am fairly well versed in linux. But I do not know how I can compile it into a usable rom for hero.
the result of the compiling are image files that can be flashed to the phone: system.img etc. you can extract them using unyaffs.
I ran the make command, but i really have no idea what to do from there. What is the end result of doing the first make command? Im fairly sure that it is not a single .img file you can flash onto your phone. You need to make a kernal if i am correct(anyone know how to do this?)
the result of the compiling is at least a system.img. if you compiled it correctly you can flash that to /system partition. further you need a boot.img, which also contains the kernel. the the rom-cooking howto in dev section how to create one, or just get one from a working rom.
fwiw, the .img files are in out/target/product/generic/ (although there probably is a device specific directory in there if you handled the vendor overlay correctly. <- this is just a guess, i have actually no idea).
Wanna link us to that how to thread? I cant seem to find a complete one with working links.
http://forum.xda-developers.com/showthread.php?t=551711

[Q] [SOLVED] How to Modify/Recompile/Rebuild a Kernel

Hi everyone.
I'd really like to know the steps to modify, recompile and finally build a kernel zip to flash on our O1.
For instance, I'm downloading the ThunderG Kernel from mik_os here: https://github.com/mik9/ThunderG-Kernel
But I really dont know how to procede.
The programming language seems to be C++, but...
Which compiler should I use to compile it?
The source code is 100+ Mb sized, how can I build the kernel in a simple zip to let me flash it through custom recovery?
I'm really new to all this, I've little experience in C/C++/Java programming, and I'd really like to know how to procede.
An example of initial use I'm interested in, is summing up various fixes from different kernel's and make a unique kernel to flash on my phone.
For the real example:
This: http://forum.xda-developers.com/showthread.php?t=929941
plus this: http://forum.xda-developers.com/showpost.php?p=11166426&postcount=47 (waiting for source from the author)
I'd be really glad to see a newbie (not completely ^^) step-by-step guide doing everything from Windows platform.
I already read other topics on this argument, but none of them had a real guide that could be useful to anyone.
I want to thank you in advance
I'm interested too!
To start with change ur pc os to ubuntu 10.10
ccdreadcc said:
To start with change ur pc os to ubuntu 10.10
Click to expand...
Click to collapse
Couldn't Compiling and building a source code be done from any platform?
As far as I know it should (though I'm not an expert ^^).
I'd like to know if this can be done from Windows, as I'm not planning to change os at the moment
You can always use a Live CD of Ubuntu 10.10.
badeaioan said:
You can always use a Live CD of Ubuntu 10.10.
Click to expand...
Click to collapse
That's not the problem, I already installed Ubuntu other times, but I did a complete format these days and I'm not planning to install it anymore for now.
I still believe that I dont need it to compile a C/C++ source
I'd like to know the steps so I can say it surely.
If Linux is absolutely needed, I just want to know
I thing, that it can be possible compile on other system (cygwin + compilers, library, ...) but you will must download huge dependent software/library/source code. It probably will have same size as whole system :-/
Ok you convinced me, let's say I want to do it on ubuntu, could someone make a guide for everyone?
that would be great!
Sent from my LG-P500 using XDA App
I use gcc for compiling stuff. How to turn the compiled stuff into a package (for flashing) however, is what I don't know
What I would also like to know is how to incorporate a kernel into a ROM. That would shed some light. Thanks to whoever answers this!
The ThunderG package includes a lot of things, do I have to compile the "kernel" folder only to build a kernel for flash?
I really don't know how to procede... ^^
I'm installing Ubuntu 10.10 right now trough wubi..
Sippolo said:
Couldn't Compiling and building a source code be done from any platform?
Click to expand...
Click to collapse
No, especially the kernel source code makes heavily use of filename case sensitivity.
In linux abcd.e and abcD.e are different files- in windows they are not.
Extract a linux Kernel in windows and you will see what I mean.
So even if you got the cross compilers and libs together you will not be able to compile the kernel.
Cygwin is a way- but you could also run XUbuntu with VirtualBox which easier.
The best and fastest is a native linux system.
Sippolo said:
The ThunderG package includes a lot of things, do I have to compile the "kernel" folder only to build a kernel for flash?
Click to expand...
Click to collapse
Get the android ndk, extract it and append the folder with "arm-eabi-gcc" to your system path (export PATH=$PATH:"$NDKPATH/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin").
Extract Thunderg_Kernel.tar.gz, go to the directory and run "make thunderg-perf_defconfig" that will create a .config for the kernel. Or grab your O1 config from /proc/config.gz (per adb, ftp server app, copy with file manager to sd card...) and move it to $kerneldir/.config.
Have a look at "make menuconfig" and then try "make zImage".
Maybe you must install a few dependencies with synaptic (when you are using ubuntu).
kpbotbot said:
I use gcc for compiling stuff. How to turn the compiled stuff into a package (for flashing) however, is what I don't know
What I would also like to know is how to incorporate a kernel into a ROM. That would shed some light. Thanks to whoever answers this!
Click to expand...
Click to collapse
Load mik_os' touchscreen fixed kernel and extract the zip file.
Delete the cert* and manifest* files under META-INF.
Change the zImage under Kernel maybe the kernel modules (system/lib/modules) too.
ZIP it all together again (directory structure must be the same as in mik_os' zip).
To sign read this: http://www.robmcghee.com/android/creating-an-android-update-zip-package/
or this: http://www.londatiga.net/it/how-to-sign-apk-zip-files/
hello, first of all to compile a kernel you need to config this kernel (enabling the drivers you are intersted in, kernel tweaks... and so on)
to do that (on linux) go to your kernel directory and run this command
make menuconfig
this would run the gui config for the kernel where you can configure the kernel.
anyway every board or device has it's own configureations os the kernel can handel the hw on this device you can start gussing what are the right configurations for the P500 which is not an option at all hehehe
or you can use the predefind config included in the Thunderg kernel
to use that config go to the kernel folder and run this command
make thunderg-perf_defconfig
this command will configure the kernel with the predefind configuration
after that you need to compile the kernel using a cross platform compiler, the machine you are working on is x86 but P500 mobile have an ARM cpu so you can't just compile the kernel for your machine and run it on the mobile to do that find a cross compiler on the net (i use the CodeSourcery) then compile your kernel using this command
make CROSS_COMPILE={path to the corss compiler bin}
after finishing the compile process (first time it would take a while) you will find a file called "zImage" which is the kernel for the ARM cpu under the directory arch/arm/boot inside your kernel directory
then to flash that image to your device you need to create your own ROM and sign it then flash it using the coustom recovery.
hopt that this info is useful and sorry for any wrong information
Thanks everyone
I found out that android ndk solution was much easier and straightforward.
Now I've my zImage ready in "ThunderG-Source/arch/arm/boot/" directory (not in the kernel directory as waleedq stated?).
Now I cant understand the meaning of "signing" my kernel to a custom ROM, I'm using the custom recovery from http://forum.xda-developers.com/showthread.php?t=844483
I've read the two articles above about signing an application .apk to your rom and generate an update package.
But here I dont have an apk but a zImage which I really dont know how to use ^^
Isn't there a way to directly create the kernel update zip file and flash it with custom recovery?
P.S. Surfing on the web I found this link, might be useful to someone: part1: http://lazydroid.com/2010/06/how-to-compile-kernel-part-1/ part2: http://lazydroid.com/2010/06/how-to-compile-kernel-part-2/ It just explains what you have already explained though
Sippolo said:
Thanks everyone
I found out that android ndk solution was much easier and straightforward.
Now I've my zImage ready in "ThunderG-Source/arch/arm/boot/" directory (not in the kernel directory as waleedq stated?).
Click to expand...
Click to collapse
Your "kernel" directory has the name "ThunderG-Source"
It is all ok- waleedg didn't mean the "kernel/kernel" directory
Sippolo said:
Isn't there a way to directly create the kernel update zip file and flash it with custom recovery?
Click to expand...
Click to collapse
Read my post more thoroughly (I have edited it)
Yeah I did understand what you wrote in that reply, just was wondering what is "signing" actually, but I found out when doing it
Now I've my signed kernel update to flash
I used the SignApk jar program to do it, it's fast and I've everything already done and ready for future signing (certificate and key must not be remade each time as far as I see, I just need to sign each new zip with the already present certificate/key).
Thank you everyone, now I'm finally done with this request, it's solved
Side Question to waleedq: will you publish the code of your workaround for axis inversion? I'm curious which source file handle these things, should be /drivers/input/touchscreen/mcs6000_ts.c, am I wrong?
Sippolo said:
Yeah I did understand what you wrote in that reply, just was wondering what is "signing" actually, but I found out when doing it
Now I've my signed kernel update to flash
I used the SignApk jar program to do it, it's fast and I've everything already done and ready for future signing (certificate and key must not be remade each time as far as I see, I just need to sign each new zip with the already present certificate/key).
Thank you everyone, now I'm finally done with this request, it's solved
Side Question to waleedq: will you publish the code of your workaround for axis inversion? I'm curious which source file handle these things, should be /drivers/input/touchscreen/mcs6000_ts.c, am I wrong?
Click to expand...
Click to collapse
yes i am publishing the code , today if i got some spare time
and about the mcs6000_ts.c yes this is the driver that handel our screen
here is the workaround source code
https://github.com/waleedq/ThunderG-Kernel/blob/thunderg_oc/drivers/input/touchscreen/mcs6000_ts.c
i just forked nik_os kernel and added my workaround code to it so now all the features are implemented
waleedq said:
here is the workaround source code
https://github.com/waleedq/ThunderG-Kernel/blob/thunderg_oc/drivers/input/touchscreen/mcs6000_ts.c
i just forked nik_os kernel and added my workaround code to it so now all the features are implemented
Click to expand...
Click to collapse
That's perfect, thank you
you are welcome my friend hope that someone will make it better than this stage

[Q] How would I compile a custom kernel with custom ROM

I just went through the process of compiling a custom ROM and they used a stock kernel. I would like to incorporate a different kernel when I compile and instead of the stock. I know I could compile them separately and have them flash together but I want one zip to flash. Just would like to go through the process to learn.
Any help on how to do this or what I have to do when compiling?'
Thanks.
MAXGEN said:
I just went through the process of compiling a custom ROM and they used a stock kernel. I would like to incorporate a different kernel when I compile and instead of the stock. I know I could compile them separately and have them flash together but I want one zip to flash. Just would like to go through the process to learn.
Any help on how to do this or what I have to do when compiling?'
Thanks.
Click to expand...
Click to collapse
One of the easiest ways of doing this would be to take the boot.img thats contains the custom kernel you want and deleting the stock boot.img containing the stock kernel in your .zip file and replacing that with the boot.img of the custom kernel. Essentially you are just swapping the boot.img file in the .zip files with the one containing the custom kernel rather then the stock kernel. Let me know if you need me to explain things further or have any other questions I'll be happy to help you out.
shimp208 said:
One of the easiest ways of doing this would be to take the boot.img thats contains the custom kernel you want and deleting the stock boot.img containing the stock kernel in your .zip file and replacing that with the boot.img of the custom kernel. Essentially you are just swapping the boot.img file in the .zip files with the one containing the custom kernel rather then the stock kernel. Let me know if you need me to explain things further or have any other questions I'll be happy to help you out.
Click to expand...
Click to collapse
Thanks for the response.
I have to first compile the custom kernel then it seems like an easy process after that. I'm going to try to compile Franco kernel for nexus 5 if u heard of it. Its been pretty good for me.
Any tips for compiling another project or Franco kernel would be great!? I will make a separate folder for that kernel git project and compile it there.
I also want to use tool chain like Linaro and maybe Sabermod but those are for nexus 4, maybe I can port it over.
MAXGEN said:
Thanks for the response.
I have to first compile the custom kernel then it seems like an easy process after that. I'm going to try to compile Franco kernel for nexus 5 if u heard of it. Its been pretty good for me.
Any tips for compiling another project or Franco kernel would be great!? I will make a separate folder for that kernel git project and compile it there.
I also want to use tool chain like Linaro and maybe Sabermod but those are for nexus 4, maybe I can port it over.
Click to expand...
Click to collapse
Franco kernel is an excellent kernel can't really go wrong with it. On your other note, Linaro is not Android device specific it can be used to compile kernels for a plethora of devices, I would recommend taking a look at this great guide on how to use Linaro to compile your kernel and how to customize the Linaro toolchain to suit your needs.
shimp208 said:
Franco kernel is an excellent kernel can't really go wrong with it. On your other note, Linaro is not Android device specific it can be used to compile kernels for a plethora of devices, I would recommend taking a look at this great guide on how to use Linaro to compile your kernel and how to customize the Linaro toolchain to suit your needs.
Click to expand...
Click to collapse
So I tried following the post. Just not sure about a lot of things and got confused and couldn't compile.
So what I'm trying first before I use the LInaro tool chain is to try to compile the Franco kernel without it. I clone Franco hammerhead git and link the arm-eabi-4.6 toolkit
make hammerhead_defconf
make -j7
Seem to compile with no errors, took a minute though which seems quick but not sure where it exported to.
Tried looking in the arch/arm/boot/ but no look.
I want compile a boot.img as well.
MAXGEN said:
So I tried following the post. Just not sure about a lot of things and got confused and couldn't compile.
So what I'm trying first before I use the LInaro tool chain is to try to compile the Franco kernel without it. I clone Franco hammerhead git and link the arm-eabi-4.6 toolkit
make hammerhead_defconf
make -j7
Seem to compile with no errors, took a minute though which seems quick but not sure where it exported to.
Tried looking in the arch/arm/boot/ but no look.
I want compile a boot.img as well.
Click to expand...
Click to collapse
I would recommend trying the following procedure:
Code:
mkdir franco
cd franco
git clone https://github.com/franciscofranco/hammerhead.git
After the clone operation completes rename the cloned folder to hammerhead or make sure it named hammerhead.
Now make sure your are in the franco folder you created and run the following commands:
Code:
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6
export PATH=$(pwd)/arm-eabi-4.6/bin:$PATH
export ARCH=arm
export SUBARCH=arm
export CROSS_COMPILE=arm-eabi-
cd hammerhead
make hammerhead_defconfig
make -j4
Once it finishes this you should now have a zimage outputted in the path arch/arm/boot/zImage. To make the process of putting your zimage and module together run the following commands:
Code:
mkdir ~/franco/kernel_output
cp ~/franco/hammerhead/arch/arm/boot/zImage ~/franco/kernel_output/zImage
find ~/franco/hammerhead -name "*.ko" -exec cp {} ~/franco/kernel_output \; (You may have to run the command without the ";")
You should now have everything you need to make a boot.img. Let me know how it goes and if you still have questions.
Thanks for your help, W-XC (curious what that means and you have flying shoe is it because you run? You running in the next Boston Marathon?)
The kernel is actually using 4.7 so I just used the right git. I also found out it wasn't compiling because there was any error in that specific driver for CPU governor. The dev actually was about to push a fix and supposedly it will be push tomorrow but shared the commit so I was able to make the fix manually. Either case it compiles now. Working on step 2 which is to compile into the ROM.
I was curious you seem to know your stuff. Are you kernel dev? How did you gain your knowledge? I wanna learn more about Android OS and linux kernel? I taken basic OS classes in college so a lot of introduction to concepts but nothing on coding it though. Any books or anything you can recommend on any of these areas or anything closely related worth knowing? Thanks again.
For making a boot.img I tried the following. What would you suggest for mkbootimg?
I used this script to get my ramdisk.
http://www.enck.org/tools.html
But I'm little confused on where do you get the script for mkbootimg?
Is it from the android source or is it generated when you build the kernel or is it some script that someone made?
I found this posting for building a kernel with mkbootimg but the dilemmaI"m no having is what is correct commands for building.
http://www.droidforums.net/forum/rescue-squad-guides/31452-how-compile-your-own-kernel.html
The dev mention some commands in a posting several months ago.
http://forum.xda-developers.com/showpost.php?p=47167725&postcount=291
That might be a way to go but the argument doesn't take with the mkbootimg from the droid forums. Syntax is not right so it makes me think that mkbootimg is unique.
MAXGEN said:
Thanks for your help, W-XC (curious what that means and you have flying shoe is it because you run? You running in the next Boston Marathon?)
The kernel is actually using 4.7 so I just used the right git. I also found out it wasn't compiling because there was any error in that specific driver for CPU governor. The dev actually was about to push a fix and supposedly it will be push tomorrow but shared the commit so I was able to make the fix manually. Either case it compiles now. Working on step 2 which is to compile into the ROM.
I was curious you seem to know your stuff. Are you kernel dev? How did you gain your knowledge? I wanna learn more about Android OS and linux kernel? I taken basic OS classes in college so a lot of introduction to concepts but nothing on coding it though. Any books or anything you can recommend on any of these areas or anything closely related worth knowing? Thanks again.
Click to expand...
Click to collapse
MAXGEN said:
For making a boot.img I tried the following. What would you suggest for mkbootimg?
I used this script to get my ramdisk.
http://www.enck.org/tools.html
But I'm little confused on where do you get the script for mkbootimg?
Is it from the android source or is it generated when you build the kernel or is it some script that someone made?
I found this posting for building a kernel with mkbootimg but the dilemmaI"m no having is what is correct commands for building.
http://www.droidforums.net/forum/rescue-squad-guides/31452-how-compile-your-own-kernel.html
The dev mention some commands in a posting several months ago.
http://forum.xda-developers.com/showpost.php?p=47167725&postcount=291
That might be a way to go but the argument doesn't take with the mkbootimg from the droid forums. Syntax is not right so it makes me think that mkbootimg is unique.
Click to expand...
Click to collapse
The W-XC in my avatar stands for Watertown Cross-Country which is the team I used to run on and the flying shoe with the track wings represents our track team, as I love to run I thought it was a fitting avatar. As far as running the Boston marathon I am not running this year but I would love to someday, I am unfortunately not in good enough form to run a marathon right now due to a prolonged battle with an injury I sustained last spring, but I'll keep training and keeping running!
I'm glad you were able to make the fix on the kernel, often times errors that seem to pop out of nowhere are related to fixes not being pushed to the repository you were syncing and using to build at the time. Thank you for the nice compliment it is greatly appreciated, I am not a kernel developer just an overall aspiring developer who loves everything Android related and trying to contribute and help others however I can. I would say 99% of my knowledge of everything Android related has come from XDA and hours upon hours of Googling things related to kernel development, reading about something not understanding something then Googling the parts I didn't understand, piecing together things then Googling more things to help me understand, after a while you slowly start putting the pieces of knowledge together as you learn more and then you still keep learning. For resources on learning kernel development I would recommend learning the C programming language as it is the building block of kernel development. A great resource for learning C is the free online e-book Learn C The Hard Way. Another critical element of understanding Android kernel development is the Linux Kernel and it's drivers which is why I would recommend taking a look at Linux Device Driver's Third Edition, while parts of it are outdated the fundamental concepts are still very much applicable. As far as pure Android Kernel aspects and Linux Kernel aspects go the free-electrons group has some invaluable presentations that cover these subjects as well as other critical areas of embedded development that relate to kernels.
For the mkbootimg binary I would recommend downloading these unpack, repack, ramdisk tools. They have proven invaluable for me when working with img files and kernels. Download the scripts and binaries and put them in your ~/bin folder and make sure to give them the proper permissions that way they will be in your path and you can use them properly. Once you have them installed I would recommend obtaining a copy of the Nexus 5's latest boot.img (The factory images Google Provides should have it in the images .zip file included in the factory image). After doing that decompile the stock boot.img file using the umkbootimg binary, this should present you with an output of a ramdisk and a zimage. Next, take the zimage you compiled with the franco kernel source and replace the stock boot.img zimage with the zimage you compiled from franco kernel. Then run the mkbootimg binary with command (In terminal it should give you the command to easily re-pack the boot.img) to re-pack your new boot.img. The output of the new boot.img will have the default name new_boot.img or similar name. Re-name this file to boot.img and delete the old boot.img from your .zip file of your ROM and swap in the boot.img file you just created. You have now included the custom kernel you wanted in your ROM.
As always let me know if you still have questions I'll be happy to answer them :good:.
Thank you so much!!! Probably going to have to take some time to digest everything but definitely will have more questions when I'm done.
Quick question, do you have see "C" being replace? I have read some C code but haven't not yet coded anything in C. I been told that low level access you get with C is not comparable with other languages. I guess you would have to go to ASM to get even more access. ASM personally I run from it, probably should do more of it for practice. We do a lot of high level language C++, java, python and some others in school but no C. I probably can't avoid not being comfortable in it? C is not going to be replace by anything in future??
MAXGEN said:
Thank you so much!!! Probably going to have to take some time to digest everything but definitely will have more questions when I'm done.
Quick question, do you have see "C" being replace? I have read some C code but haven't not yet coded anything in C. I been told that low level access you get with C is not comparable with other languages. I guess you would have to go to ASM to get even more access. ASM personally I run from it, probably should do more of it for practice. We do a lot of high level language C++, java, python and some others in school but no C. I probably can't avoid not being comfortable in it? C is not going to be replace by anything in future??
Click to expand...
Click to collapse
You are correct in that to get even more low level access you start getting into assembly territory. What makes assembly difficult and what makes people from run form it is unlike very high level languages such as Python, Java, etc. it is much less human readable and a lot closer to machine language (Binary code), however like anything practice makes perfect the more you practice with a language the easier things get and the more confidence you have in programming things with it. If you really want to customize and develop kernels C is a must there is no getting around that unfortunately. As far as C being replaced with anything in the future, will it ever be replaced, probably as is the case with technology, but as far as it being replaced with anything equivalent or better in the next 10-20 years I doubt it, as it would take years to develop a new standard and even longer to be adopted and standardized to the point C is used and accepted today.

Errors when try to compile anything....

Hello guys, i have a problem and really want to solve it because i am bored of errors and i want to compile roms/recovery and other
I have successfully set up build evinrovment and downloaded cm 12 sources.
I have downloaded from github and synced via terminal the kernel of device and the device files.
But, when i do the command . /build/envsetup.sh terminal not show me "you're building on linux".
Anyway, if i do: lunch aosp_e2303-userdebug, same as suggested in vendorsetup.sh file of the device folder, linux give me that:
Don't have a product spec for "xxx" (xxx is for indicate the codename of device)
But i have all folders in /cm12/device
How can i solve it? Please help me....
Did you download the vendor files? Iirc they are not on github, they are on Sony's developer website. They are called device binaries or something like this. The m4 aqua is not on the list, but if you download one of the latest for any device you'll have the files there
Thank you, later i will try with these files... Now my ubuntu (not know why) not boot.

Question about compiiling TWRP for a new phone

Hi,
I'm totally new to android custom ROM development scene, and one of the first things I really wanted to do was to be able to create TWRP recovery for any device that I could possibly own.
As such, I started doing my research. I've read a lot of guides and the more I read the guides, the more I seem to get lost on what to do... :crying:
By far, the best guide I've read is this one :
https://forum.xda-developers.com/android/software/guide-how-to-compile-twrp-source-step-t3404024
So far I've 'repo sync'ed twrp-6.0 from 'minimal sources', so what I understand is that I have a build environment to build an android ROM, but now I have to tweak several files to match it to my device.
In the tutorial, it says that I need to have 3 directories set up correctly.
1. kernel
2. device
3. vendor
I have a device SM-J5108.
My first goal was to correctly set up the 'device' directory. So I set off to look for a pre-made 'device' that's similar to my model. I landed on this page.
https://github.com/TeamWin/android_device_samsung_j7ltespr
It's for Galaxy J7, but it had the simplest directory & file structure so I decided to use this one.
However, I think it would be wise to get configs for the BoardConfig.mk from this repository.
https://github.com/TeamWin/android_device_samsung_j5nltexx
Next, I would download the original firmware from somewhere like 'updato.com', and rip off the original kernel from that file. then I would replace the 'kernel' file in the repository with that one.
I would do the same with the ramdisk.
Up to this point, am I on the right track?
And another thing that questions me is since I've ripped off the kernel and ramdisk, is the '/home/username/NameOfTheFolder/kernel/vendor/devicename' folder from the guide not needed at all?
And the third folder in the guide, '/home/username/NameOfTheFolder/vendor/vendor/devicename'.
From my understanding, this folder needs to contain all proprietary libraries & .ko and other stuff specific to the device that is not mounted by the ramdisk.
And from this guide :
https://web.archive.org/web/2016111...ro#Collect_any_available_existing_source_code
It tells me to use 'extract-files.sh' to automate the process of extracting these files. But I'm not entirely sure if I can just use a universal 'extract-files.sh' for this.
Could I use 'extract-files.sh' from any Samsung device repository such as this one?
https://github.com/omnirom/android_device_samsung_i9300
Or do I have to build a new 'extract-files.sh' just for this device...?
After settings up these two folders, I should just
Code:
cd ~/NameOfTheFolder
source build/envsetup.sh
lunch
Type the number of your device and press enter. For example in my case the number 16 is my device
mka recoveryimage ---> This command will start the compilation of the recovery.
And a recovery image should be ready to be flashed on the device right?
Thanks!

Categories

Resources