yashsingh1/xdaforums huggingface dataset:
[Android General] AlaskaLinuxUser:
Great question.

This is certainly something that I would put under the 'advanced' category. If I understand correctly, you mean to write a device tree from scratch, say for a device that doesn't have any custom roms, right?

The principle behind it is very simple, but the implementation of it can be rather rigorous. Essentially, you would be completing several tasks like this:

1. Figure out exactly which hardware is in your phone/tablet.

2. "Borrow" another device tree that has the same SoC for reference, or just refer to another tree for tree structure.

3. Get hardware and app packages that equate to each and every hardware piece of the phone/tablet.

4. Use the vendor files extraction tool to grab all of the vendor blobs off of the device.

5. Build it, pull logs, fix errors, repeat.

The theory behind this sounds incredibly simple, but this is the kind of thing that developers can spend months working on. In some cases, some of the hardware may be so obscure that they never get finished. Or they may be able to "bring up" the device, but some of the hardware will not function. I don't say this to discourage you, in fact, if you are up for the challenge, that is what Android development is really all about! However, first I recommend that you get a strong working knowledge of devices, rom building, kernel modding, device trees, repo sync, etc., and that is what this video series will hopefully help people get started with. Perhaps we can find a really good dev to make an advanced video series with stuff like this. :D

If I could recommend just a little preview into how that might work, take a look at the kernel video for adding sound modifications. While that is only for the kernel, it helps show how one might deduce what hardware is on the phone/tablet, and where to look for information, drivers, and code. You would be doing that, but for all parts of the device tree, not just the kernel.

Interesting. So, in my video series, you might note that I use 'make clean' rather than 'make clobber'. Theoretically, both are the same, but I recommend the 'make clean' command due to using it across several Android generations and across numerous Android custom roms and have had consistent results. Make commands are literally at the mercy of the make file writer, and they could specify them to mean different things. IMHO, 'make clean' always gets the job done right.

That said, make clobber should have worked. Two questions:

1. After this error, is the out folder still full of stuff?

2. If so, right click on any file in the out folder and view permissions. Is it you, the user, or someone else, like a different user, or root?

I have only seen this when you accidentally build as root or under a different build account, or when using external media, like a USB drive that you 'owned' or mounted as a different user. To fix this, you could do many things, but an easy one might be to set up as usual and run 'sudo make clean' to use root permission to empty the out folder, then build as a non-root user without the sudo command, e.g. as normal per the instructions.

Hope that helps!
[Android General] #Henkate:
I highly recommend Google Cloud Platform (GCP). I've been using it since about 1 year or more (I'm not really sure). My clean builds are done in about 45-55 mins with GCP and ccache.

Few days ago, I've got out of my free credits (from the free trial), then I've deleted my two instances, disabled billing account for my project and then closed billing account. Then I've went back to instances and I've seen the option with free trial again. Clicked on it, clicked next blabla and then I've got another 300 free credits on the same google account and same banking card xD. I don't know if it's a bug or not nor if it's legal or illegal, but they've offered me that option and I've accepted it xD.

Here's a guide about how to build from phone with GCP: [GUIDE]How To Build A ROM Using A Phone. The important part there is that it's telling you how to ssh to the google instance and about using gdrive to upload your builds to Google Drive.

If you wanna make the trees on your phone too (lol), then I suggest Termux terminal, where you can install git and then push your changes to github etc. I'd recommend a PC though, since you do it much faster there.
[Android General] David_J_Meyers:
thank you so much for this informative guide. can you please tell me if this guide also works for android oreo? :)
[Android General] AlaskaLinuxUser:
Yes, it does cover Oreo.
[Android General] RebelLion_:
You don't know how long I have searched for a way to do this and you just gave me everything I could need in a single post (technically lol). Thanks for all your work and dedication. It's really helpful and inspiring to beginning developers like myself. Especially lacking a computer, I was only hoping to build a kernel on my mid-end phone, but this might have me developing rooms sooner than I thought!
[Android General] shan9656:
[MENTION=7026648]AlaskaLinuxUser[/MENTION]

When building for Shamu there are no build scripts running, it just shows the target product details and exits
[Android General] Craz Basics:
Just wanna say thanks, this is a pretty solid tutorial library. I'm really considering beginning to build ROMs again. This time it won't be from system dumps :)
[Android General] AlaskaLinuxUser:
So after you run breakfast, it shows the target than exits. Right? Then, the next command you need to run is make, which will make the target.

Or, if you run make and it exits, is there an error?

Glad you are enjoying the tutorial, I hope it helps, and I really hope to get another generation of builders pointed in the right direction. With all those phones out there, we need some more people working on custom Roms!
[Android General] shan9656:
Thanks

---------- Post added at 05:37 AM ---------- Previous post was at 04:58 AM ----------

Ran the make command now this is happening

Validating file 'frameworks/base/packages/InputDevices/res/raw/keyboard_layout_ukrainian.kcm'...

No errors.

Success.

[ 1% 541/36176] host Java: tagsouplib (out/host/c...j/JAVA_LIBRARIES/tagsouplib_intermediates/classes)

Note: Some input files use unchecked or unsafe operations.

Note: Recompile with -Xlint:unchecked for details.

[ 1% 556/36176] host Java: antlr-runtime (out/hos...AVA_LIBRARIES/antlr-runtime_intermediates/classes)

Note: Some input files use unchecked or unsafe operations.

Note: Recompile with -Xlint:unchecked for details.

[ 1% 673/36176] Lex: aidl <= system/tools/aidl/aidl_language_l.ll

FAILED: /bin/bash -c "prebuilts/misc/linux-x86/flex/flex-2.5.39 -oout/host/linux-x86/obj/STATIC_LIBRARIES/libaidl-common_intermediates/aidl_language_l.cpp system/tools/aidl/aidl_language_l.ll"

flex-2.5.39: loadlocale.c:130: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.

Aborted

[ 1% 673/36176] host Java: guavalib (out/host/com...obj/JAVA_LIBRARIES/guavalib_intermediates/classes)

warning: [options] bootstrap class path not set in conjunction with -source 1.7

Note: Some input files use or override a deprecated API.

Note: Recompile with -Xlint:deprecation for details.

Note: Some input files use unchecked or unsafe operations.

Note: Recompile with -Xlint:unchecked for details.

1 warning

[ 1% 673/36176] target Java: core-all (out/target...obj/JAVA_LIBRARIES/core-all_intermediates/classes)

Note: Some input files use or override a deprecated API.

Note: Recompile with -Xlint:deprecation for details.

Note: Some input files use unchecked or unsafe operations.

Note: Recompile with -Xlint:unchecked for details.

ninja: build stopped: subcommand failed.

build/core/ninja.mk:148: recipe for target 'ninja_wrapper' failed

make: *** [ninja_wrapper] Error 1
[Android General] AlaskaLinuxUser:
Well, I'm not sure by just looking at the logs. You should take each line and run it through a web search like Google, and see if others are having a similar problem.

Off the top of my head, I wonder, is the firmware written for your kernel? Is it written for the right version of Android? You say it works in Marshmallow and Nougat, they may need to update the firmware to be compatible with Oreo, since many things changed with that revision of Android.

Also, since this is vendor specific, I think contacting that vendor's contact or help department would be your best bet.
[Android General] zelendel:
Off topic but I hope you are OK. That was a major one. Hope you and your family are safe.
[Android General] AlaskaLinuxUser:
Thanks, but I'd be more worried about you. The quake was 350 miles away from here. But I felt the ground "roll" as the "shock wave" went by.... Looks like a couple of roads in your town collapsed! Stay safe down there!
[Android General] Svirusx:
I tried last version of htc_9271.fw tested, new kernel panic

Tried too search another peoples who have problem like it but anyone had problem with atheros driver.

I haven't found any topic with atheros drivers with oreo in stock samsung ROM.

I think i must further use Nougat ;/
[Android General] zelendel:
Yeah it has been crazy. They called out the national guard.

http://cloud.tapatalk.com/s/5c01c15d98cb5/received_1863406263788656.jpeg?
[Android General] DJABHipHop:
How would I set up device tree with mulitble device that use the same CPU, GPU, Manufactor, Brand and not the same specs exp like Camera sensor, Display size, optinal specs like NFC, IR blaster, optinal Sensor and diffrent partion sizes?

exp tablet with WiFi and one with LTE but same Spect or Diffrent Spect but same manufactor, brand, same SOC and same or diffren series.
[Android General] AlaskaLinuxUser:
Great question.

This happens a lot. The way you do this is to make a "common" tree, and then a few small "specific" trees.

An example is the Samsung galaxy s4.

You have the jf-common tree, and then a jfltetmo, jfltexx, and jfltevzw tree. All three specific trees have very little in them, and call the jf-common tree for the majority of the building.

The jf-common tree keeps the stuff that is the same, or common for these phones, like the CPU, GPU, etc, stuff. The specific trees keep the unique or uncommon stuff, like ril (radio) stuff, or unique sensors, or unique settings.

Hope that helps! :good:
[Android General] DJABHipHop:
Thank for the advice, But what about when ther not the the same model or screeen size but same series, brand, cup, gpu, same partition for boot and recovery, can that be done as a video series so I can see how I can do it from scratch. Or
[Android General] mehrshad.shafaghi:
Well, based on my current setup, that wouldn't be possible cause my main storage device is a 256GB SSD on which I'm dualbooting both W10 and Ubuntu.

So the only way will be to store them on my hdd which has plenty of free space. Would that be possible?
[Android General] AlaskaLinuxUser:
It still works the same. In the common tree, just add the parts that are always common, and in the specific tree, the parts that are specific.

If they are so different that this doesn't work, then you should just make a specific tree for each one. :good:
[Android General] AlaskaLinuxUser:
Yes, you can store the android source on an external USB drive if you want, it will make the build slower though. :good:
[Android General] zelendel:
Yes it is possible. I dual boot the same thing. a 256gb m2 drive for OS and a 1tb drive for source and all data files. Only my OS is on the SSD. Mind you that you lose alot of the bonuses for using a SSD by doing it that way but as long as you are dual booting with that small of an SSD then you will be stuck. Im about to move my whole linux set up to a separate HD and just use that.
[Android General] DJABHipHop:
Can someone help cleaning up the code and structuring it the official LineageOS because it one big mess divece are fine but android_device_samsung_msm8226_common & android_device_samsung_matisse_common look like storm went over and mess it up

https://gitlab.com/galaxy-tab-4
[Android General] AlaskaLinuxUser:
DJ,

I think you need to elaborate. I don't understand what you are asking us to do. Are you saying that you made messy code, or someone else did?
[Android General] DJABHipHop:
some else did but never mind I finily figure out after tomorrow i'll repost thr repo because some one to tell me is my device tree structure is properly done
[Android General] rajesh@xda:
Need help @ AlaskaLinuxUser :

unofficial builds are build in test key. I want to change to my own release key for my build. I am working on lineage 15.1 build and my build is successful. I am stuck in signing my build.:confused:

I am fresher in rom building. I followed above guide but i couldnt understand clearly https://wiki.lineageos.org/signing_builds.html

i am able to pass this $ "mka target-files-package dist" and got the out zip at out/dist. How to sign..?

Any videos or guides by you regarding signing the build with own release key..thanks:)
[Android General] AlaskaLinuxUser:
Are you an "Official" builder for your lineage device? If not, why would you want to sign your rom with your keys? I'm not saying you can't, I'm just asking why. :confused: If your build is not an official build, because you are not a recognized official maintainer for that rom/device, then you don't need to sign the rom.

[*]Is twrp really necessary to build a rom?

Nope. However, it is much easier to test your rom if you have TWRP so you can flash it without going into fastboot or using flashify.

[*]when its com to samsung devices what else can I add to make the rom run better on older devices while extend battery life beside kernel mods?

For older roms, kernel mods are probably your best battery saving bet. With enough skill, you could modify the Android OS and add features from newer versions of Android, but it is labor intensive and requires a lot of knowledge. There are root apps that help, like greenify, etc. You could try adding those to your rom.

[*]I'm I missing anything else in my device tree for samsung device or I'm I all good?

Does it boot and does everything work? If that is true, then you have all you need. If that is not true then there is more that you need.

[*]When I the rom build my rom build fine but when i flash it it won't get pasts the samsung logo and i don't know why:confused:

Did you pull logs or tombstones? (I have videos on how to do that on my channel.)

[*]Also I was hoping you can do a video series on fixing bad or incomplete device tree done devlopers and what it take to redo/fix porelly writen or incomplete to the lineage/cm device stander. I mean a series on what you would do to continue an abandoned project in hopes of fixing all the bugs or at least have a working version of The Source others can help patch the bugs

There is not a cookie cutter solution to this problem, as each situation will be unique to how much of the tree was done or not. I recommend using the "building a device tree from scratch" video series as a guide, and treat it like a device that you are building from scratch, with some already done bonus material to start with. :good:
[Android General] rajesh@xda:
Due to public test keys in my build i am not able to use some apps ( payment apps ) in my phone. I think those apps check test key on launch and crashes finally ( Though it can be solved by removing this line "ro.build.tags=test-keys" on build.prop ) . Also lineage trust says my phone is not secured ( Alert: Build signed with public keys ) . So,thought to sign the build with my own release keys !

Yes, i am not the official maintainer. But no problem i created my own release keys and certificate locally on my machine and signed my build. Now, No lineage trust alerts and also apps are working fine. . Issue solved:good:

Thanks lot for your kind reply:)
[Android General] AlaskaLinuxUser:
You have a much bigger problem than that of the camera. You currently can't build because it can't find the kernel to build with.

You need to download your kernel source to: kernel/xiaomi/msm8956

and specify a proper build configuration file for it, or it will not build the kernel. Without the kernel, it cannot make the boot image, and thus the build fails.

Good work figuring it out! Sounds like you didn't need my help at all, which is the goal of this thread and my videos! :D

Great job! :highfive:
[Android General] rajesh@xda:
Thanks.:) You are doing the great job :highfive: your guides are most useful and productive:good:
[Android General] DJABHipHop:
Why I'm I getting this error every time I try build the rom for my device

build/core/dex_preopt.mk:74: target `/home/android/lineage-14.1/out/target/product/matissewifi/dex_bootjars/system/framework/@inherit' doesn't match the target pattern

build/core/dex_preopt.mk:74: *** target pattern contains no '%'.

build/core/ninja.mk:166: recipe for target '/home/android/lineage-14.1/out/build-lineage_matissewifi-clobber.ninja' failed

make: *** [/home/android/lineage-14.1/out/build-lineage_matissewifi-clobber.ninja] Error 1

make: Leaving directory '/home/android/lineage-14.1'
[Android General] AlaskaLinuxUser:
$ . build/envsetup.sh

$ lunch lineage_matissewifi-eng

$ make clean

$ make

You need to clean your out directory. This error is typical for building projects where an object that was partially, or wrongly, or incompletely built is being used.

This is also typical if you build something in one environment, and move it to another environment and try to build.

Let me know of this helps.
[Android General] DJABHipHop:
thanks It did help plus all the youtube video as well nope spook to soon now this error happend

build/core/Makefile:162: *** BUILD_FINGERPRINT cannot contain spaces: "generic samsung/lineage_matissewifi/matissewifi:7.1.2/NJH47F/f995bf5066:eng/test-keys".

build/core/ninja.mk:166: recipe for target '/home/android/lineage-14.1/out/build-lineage_matissewifi-clobber.ninja' failed

make: *** [/home/android/lineage-14.1/out/build-lineage_matissewifi-clobber.ninja] Error 1

make: Leaving directory '/home/android/lineage-14.1'
[Android General] AlaskaLinuxUser:
Did you read the error? :silly:

BUILD_FINGERPRINT cannot contain spaces: "generic samsung/lineage_matissewifi/matissewifi:7.1.2/NJH47F/f995bf5066:eng/test-keys".

Your fingerprint has a space between generic and samsung. Delete the space then it will not error. It is in the device tree files. :good:

Does "/home/vamsi/pie/kernel/xiaomi/msm8956/arch/arm64/configs/lineageos_hydrogen_defconfig" exist? That's what it is looking for to build the kernel. :good:
[Android General] heindrix:
Hi sir,

Thanks for your guide that now i can build rom, build kernel, and even customizing them!

Next thing i want to learn and quiet crucial too for performance, how to update OpenGL ES and Vulkan driver properly?

Until yesterday, i try to merge things from here :

https://android.googlesource.com/platform/frameworks/native/+log/master/opengl

https://android.googlesource.com/platform/frameworks/native/+log/master/vulkan

The OpenGL ES commit merge successfully and built with no big issues, but for Vulkan, i see that many things have to be done to make it buildable after doing the merge, so i passed the Vulkan merge and do nothing about it for now.

After successfully updating OpenGL ES commit and build the rom, i try to see the OpenGL ES version driver and the version didn't go up/increment, so i think maybe i made the wrong commit from the wrong tree subs.

I want to ask you about this, maybe you can help, thanks in advance!
[Android General] AlaskaLinuxUser:
Remember, search your logs for the words "error" or "failed" They will tell you the problem. Then punch those errors into a web search and you can usually find the answer. :cowboy:

In your case, notice that the QPerformance javalib.jar is not there, so it can't build the boot.prof file. So, in your device or common tree, you are saying:

PRODUCT_BOOT_JARS += QPerformance

Or something similar. Search your device and common trees (dependencies) for the phrase "QPerformance" and you will likely find the culprit.

Then the question is weather you need it or not. If so, then you need to find something to build that, or pull it from your phone's stock rom. It is a Qualcomm library for CPU performance, if I'm not mistaken.

Thanks and great work building a ROM and kernel! :highfive:

When you update the OpenGL source, does your vendor tree still have OpenGL stuff in it? Sometimes the vendor proprietary files are overwriting the local ones you want or not allowing you to use them. That's where I would look first. As for helping you directly, as you can see I have my hands full here. :D I can't offer too much more help in that area, as I don't know a lot about it without directly looking into it and working on the project. :good:
[Android General] AlaskaLinuxUser:
Quick note for the group:

I have new videos coming out just about every week day on YouTube. You can also get ahead of the curve by looking at my GitLab, where a lot of my videos are before getting posted. I've got a couple of new series coming out, including wrapping up the "building your own super user command running app", there will be a series about "What is ...." covering topics like HAL, BLOBS, and shims. I'm also currently working on another device from scratch video series, but this time there is not TWRP available for it, so I will show the process of building TWRP trees for a phone that has never been built for before, so hopefully you will tag along for that adventure!

Also, please keep in mind that I am just one man. Be sure to search your logs, search your tombstones, and look for key words like "failed" and "error", and run those through a search engine like DuckDuckGo or Google. Usually you will find answers to your problem, because someone else already struggled with it before. I'm glad to help out here when I can, but it helps if you already looked for the answer. If you searched and then can't find the answer, feel free to post it here, and I will try my best to take a look.

Remember, the goal of these videos is to empower (make a stronger and more confident) you to be the developer who can build it on your own or work with other developers to make some great roms and bring updates to older phones, or custom roms to new devices. :D
[Android General] DJABHipHop:
Yes I did just want to know what can cause this error in the first place

https://gitlab.com/users/mweb71/projects

thank I just got it fix by rebooting my machine
[Android General] heindrix:
Well then, i guess i'll try to find out a little deeper.

But really, thanks for your tutorials. :highfive:
[Android General] krishV:
Makefile:130: recipe for target 'sub-make' failed

Makefile:130: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2
make: Leaving directory '/home/vamsi/pie/kernel/xiaomi/msm8956'
[ 16% 12063/74863] //external/llvm/lib/Support:libLLVMSupport clang++ APInt.cpp [linux_glibc]
ninja: build stopped: subcommand failed.
00:51:29 ninja failed with: exit status 1

#### failed to build some targets (03:25:10 (hh:mm:ss)) ####
[Android General] AlaskaLinuxUser:
The error is before that part. That is the result of the error, but not the error itself.
[Android General] DJABHipHop:
I've tried everything and still no luck I'm I doing something wrong

[ 99% 35195/35478] Copy: /home/android/lineage-14.1/out/target/product/matissewifi/system/vendor/lib/libllvm-qcom.so
FAILED: /home/android/lineage-14.1/out/target/product/matissewifi/system/etc/firmware/wlan/prima/WCNSS_qcom_cfg.ini
/bin/bash -c "/home/android/lineage-14.1/out/host/linux-x86/bin/acp -fp device/samsung/matisse-common/wifi/WCNSS_qcom_cfg.ini /home/android/lineage-14.1/out/target/product/matissewifi/system/etc/firmware/wlan/prima/WCNSS_qcom_cfg.ini"
acp: cannot create '/home/android/lineage-14.1/out/target/product/matissewifi/system/etc/firmware/wlan/prima/WCNSS_qcom_cfg.ini': No such file or directory
[ 99% 35195/35478] Copy: /home/android/lineage-14.1/out/target/product/matissewifi/system/vendor/lib/libllvm-qcom.so
ninja: build stopped: subcommand failed.
build/core/ninja.mk:151: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1
make: Leaving directory '/home/android/lineage-14.1'

#### make failed to build some targets (01:16:11 (hh:mm:ss)) ####