First steps to build own LOS - LineageOS Questions & Answers

Hello,
that's my first steps to building LOS myself.
In the build instruction is only the branch "cm-14.1" listed, can I use lineage-16, too?
Why I have at the end of compiling an recovery.img and what is the difference between TWRP?
Need I for building the LOS .zip for the proprietary blobs? Where can I find an archive of old LOS-ZIPs?
I have a failure with the compilation, how can I debug this? The error is ninja wrapper.
Can I brick my phone, with wrong setting or actions?

Related

[Q] RIL Development sgh-t999

Hi everyone,
recently I have built and flashed on my sgh-t999 (galaxy S3 US tmobile version) CM11 Nightly. For my pro0ject however I need to modify two libraries of the Radio Interface Layer (RIL), libril.so and libreference-ril.so. I tried to modify the ones in the forlder /hardware/ril/ and build everything again with no results. Any change that I made to those files (such as ril.cpp in the folder libril) would not affect the functionality of the phone.
Finally yesterday I understood that when I build those libraries for the target cm-d2tmo-eng, those files that I have modified are not considered at all! When the libraries are built indeed, the system automatically takes the libril.so and libreference.so present in the vendor folder!
The problem is that those libraries in the vendor folder and already compiled and I cannot modify them. The question is:
Is there any way that I compile those libraries from the source code that I have modified?
Thanks,
brok85
Given that there is a unified D2LTE Build on CM, can you elaborate on what changes you wish to make to these libraries ?
To answer your question, You can do one of two things.
Grab the CM Source Code from the Device Tree of D2LTE. Make your relevant changes and check in the changes if they boot ok on your device. That way those changes will be included in future builds of CM and other Roms that use it.
If you do not wish to do so, then you will have to compile those libraries using C++ Compiler on a *NIX box and replace them in the Vendor folder.
Perseus71 said:
Given that there is a unified D2LTE Build on CM, can you elaborate on what changes you wish to make to these libraries ?
Click to expand...
Click to collapse
Well, as fisrt I just wanted to insert some log to be able to follow the code execution from the logcat or do something similar.
Perseus71 said:
To answer your question, You can do one of two things.
Grab the CM Source Code from the Device Tree of D2LTE. Make your relevant changes and check in the changes if they boot ok on your device. That way those changes will be included in future builds of CM and other Roms that use it.
Click to expand...
Click to collapse
Sorry but I am kind of new on this things. I have already downloaded the source code from the device tree and made my modifications in the files ril.cpp contained in [path-to-android-source]/hardware/ril/libril/ril.cpp. What I did was commenting the whole code within the function RIL_onUnsolicitedResponse() and listenCallback() such that in theory, the phone is not able to display incoming calls for example. However after flashing the re-built android I am still able to receve calls. How can I "check in the changes if they boot ok on my device"?
Perseus71 said:
If you do not wish to do so, then you will have to compile those libraries using C++ Compiler on a *NIX box and replace them in the Vendor folder.
Click to expand...
Click to collapse
I tried to remove the libril.so in the vendor folder and compile again using
# . build/envsetup.sh
# lunch (and select d2tmo)
# mmm [path-to-android-source]/hardware/ril/libril".
The problem is that when I indicate the target after lunch, the compiler looks for the vendor libraries and stop the build. What I am doing wrong?
Sounds like Compiler Dependacy path is set different from the code base. I will look further before commenting.
For when your changes are for the benefit of the community of users, you check in the changed code back to the Device Tree with detailed comments within the code and while checking in.
Perseus71 said:
Given that there is a unified D2LTE Build on CM, can you elaborate on what changes you wish to make to these libraries ?
To answer your question, You can do one of two things.
Grab the CM Source Code from the Device Tree of D2LTE. Make your relevant changes and check in the changes if they boot ok on your device. That way those changes will be included in future builds of CM and other Roms that use it.
If you do not wish to do so, then you will have to compile those libraries using C++ Compiler on a *NIX box and replace them in the Vendor folder.
Click to expand...
Click to collapse
Perseus71 said:
Sounds like Compiler Dependacy path is set different from the code base. I will look further before commenting.
For when your changes are for the benefit of the community of users, you check in the changed code back to the Device Tree with detailed comments within the code and while checking in.
Click to expand...
Click to collapse
Actually this is what I get after deleting
libril.so in vendor/samsung/d2tmo/proprietary/lib/
and after executing mmm /hardware/ril/libril :
No private recovery resources for TARGET_DEVICE d2tmo
make: *** No rule to make target `vendor/samsung/d2tmo/proprietary/lib/libril.so', needed by `/home/brok85/Documents/android/system/out/target/product/d2tmo/system/lib/libril.so'. Stop.
make: Leaving directory `/home/brok85/Documents/android/system'
If u want to build from source, delete the line that copies in vendor-blobs.mk
If u want to copy the blob instead of building it from source, keep the line
It'll be better if u provide us the device and vendor trees links
blackbeard said:
If u want to build from source, delete the line that copies in vendor-blobs.mk
If u want to copy the blob instead of building it from source, keep the line
It'll be better if u provide us the device and vendor trees links
Click to expand...
Click to collapse
I am not sure to understand what should I provide Sorry, as I said I'm kind of new here...
Also, I can not find vendor-blobs.mk...Where it should be?
brok85 said:
I am not sure to understand what should I provide Sorry, as I said I'm kind of new here...
Also, I can not find vendor-blobs.mk...Where it should be?
Click to expand...
Click to collapse
You said you built a cm11 for ur device. So for that you needed the device and the vendor trees. Give the link of those, if they are on the git
And vendor-blobs.mk would be present in the vendor folder under your device folder
blackbeard said:
You said you built a cm11 for ur device. So for that you needed the device and the vendor trees. Give the link of those, if they are on the git
Click to expand...
Click to collapse
Well I have followed the guide in the following page
http://wiki.cyanogenmod.org/w/Build_for_d2tmo
The link from where I have obtained the repository is
$ repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0
and then
$ breakfast d2tmo
blackbeard said:
And vendor-blobs.mk would be present in the vendor folder under your device folder
Click to expand...
Click to collapse
Actually now I think I was able to compile the library following your instructions. Unfortunatly, when I have built and flashed everything in the galaxy S3, I was not able to use the network. Probably some compatibility issue?
When I compiled libril.so, I have obtained it from the folder /hardware/ril/libril which should contain google source code, maybe not compatibale with my device...is it right?
thanks a lot for the help guys
brok85 said:
Actually now I think I was able to compile the library following your instructions. Unfortunatly, when I have built and flashed everything in the galaxy S3, I was not able to use the network. Probably some compatibility issue?
When I compiled libril.so, I have obtained it from the folder /hardware/ril/libril which should contain google source code, maybe not compatibale with my device...is it right?
Click to expand...
Click to collapse
You know, silly question. But just so we can rule out. Did you at any point compiled the CM11 code as is and flashed to the phone ? How did Network behave ? Was everything ok ?
Galaxy S3 is a very open platform with standard hardware and chipsets. So the Default google code should work out of box with it. If you have network issues, then just for kicks you can flash a custom Kernel on top of your compiled CM 11. See how that goes.
Perseus71 said:
You know, silly question. But just so we can rule out. Did you at any point compiled the CM11 code as is and flashed to the phone ? How did Network behave ? Was everything ok ?
Click to expand...
Click to collapse
No silly question at all
I have compiled CM11 as it is and worked perfectly. I could use the network.
Perseus71 said:
Galaxy S3 is a very open platform with standard hardware and chipsets. So the Default google code should work out of box with it. If you have network issues, then just for kicks you can flash a custom Kernel on top of your compiled CM 11. See how that goes.
Click to expand...
Click to collapse
The procedure I have followed is the following one:
1) Delete the llibril.so and libreference-ril.so from the vendor library. These are the pre-compiled vendor libraries that I need to modify.
2) commented the lines from the vendor-blobs.mk that were including those two precompiled libraries.
3) go to android/system/ and run "mmm /hardware/ril/libril" and "mmm /hardware/ril/reference-ril" to obtain the modified libril.so and libreference-ril.so respectively.
4) copied the new libraries just obtained in the vendor folder where the pre-compiled libraries were
5) re-include the lines commented in point 2).
6) run brunch d2tmo
7) flash the .zip obtained
Any mistake?
Perseus71 said:
You know, silly question. But just so we can rule out. Did you at any point compiled the CM11 code as is and flashed to the phone ? How did Network behave ? Was everything ok ?
Click to expand...
Click to collapse
No silly question at all. Yes I have built everything out of the box and worked perfectly. I could use the network.
Perseus71 said:
Galaxy S3 is a very open platform with standard hardware and chipsets. So the Default google code should work out of box with it. If you have network issues, then just for kicks you can flash a custom Kernel on top of your compiled CM 11. See how that goes.
Click to expand...
Click to collapse
I followed the following procedure to include my modified libraries:
1) Eliminate precompiled vendor libraries: libril.so and libreference-ril.so from the vendor folder
2) comment lines in the vendor-blobs.mk that included those two precompiled libraries
3) from /android/system/ executed command "mmm /hardware/ril/librail" and "mmm /hardware/ril/reference-ril" to obtain the modified libril.so and libreference-ril.so
4) copied the new libraries in the vendor folder in the same places were the precompiled libraries were positioned
5) re-include the two lines that were commented in point 2)
6) build everything again with brunch d2tmo
7) flash the .zip obtained
Any mistake?
Unless I am having a brain fart that process seems about right. I wonder if your RIL changes are related to the network
What kind of issues do you see ?
Perseus71 said:
Unless I am having a brain fart that process seems about right. I wonder if your RIL changes are related to the network
What kind of issues do you see ?
Click to expand...
Click to collapse
It cannot even find the network operators. It says that it is impossible to connect and to try later...
mine is the Tmobile version of S3. May this influence?
That would depend on the changes you made. But otherwise not really. The underlying Device tree is unified for all US S3 devices.

How to implement DASH charge in custom build

Hi folks,
i build my own unofficial lineageOS 14.1 roms for my oneplus 3 and this roms working fine.
I also extracted the device specific blobs directly from the latest OxygenOS rom image.
Unfortunately, the DASH charging functionality dont work. During the extraction of the blobs, the extract files script shows an error, that the "dashd" blob couldnt be found from the script. I decided to look into the proprietary-files.txt for any dash related things and there is this line:
-sbin/dashd:rootfs
I cannot find the dashd file in the official Oxygen rom and yeah...i messed up a little bit...
Has someone already implemented the DASH functionality in his own unofficial build? Can someone give me a hint, where to get the missing blob?
Thanks, WeeZel
daWeeZel said:
Hi folks,
i build my own unofficial lineageOS 14.1 roms for my oneplus 3 and this roms working fine.
I also extracted the device specific blobs directly from the latest OxygenOS rom image.
Unfortunately, the DASH charging functionality dont work. During the extraction of the blobs, the extract files script shows an error, that the "dashd" blob couldnt be found from the script. I decided to look into the proprietary-files.txt for any dash related things and there is this line:
-sbin/dashd:rootfs
I cannot find the dashd file in the official Oxygen rom and yeah...i messed up a little bit...
Has someone already implemented the DASH functionality in his own unofficial build? Can someone give me a hint, where to get the missing blob?
Thanks, WeeZel
Click to expand...
Click to collapse
I have found the files in this repository : github.com/OnePlusOSS/android_vendor_oneplus_oneplus3/blob/oneplus3/6.0.1/sbin/dashd
Sorry the forum doesn't allow me to post link ...

Help building Lineageos kernel from source

I'm no expert and just wanted to try and build Mi5s lineageos kernel with just a few minor changes, not the whole rom, but after flashing it doesn't boot.
This is more or less what I've done:
Downloaded lineageos Mi5s source:
https://github.com/LineageOS/android_kernel_xiaomi_msm8996
Downloaded Gooogle's prebuilt toolchain:
https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/
Setup a build system following guides/tutorials from here and there.
Got it to successfully build after a few fixes to source but it doesn't pass the Mi logo.
The 3 images in the output folder are, Image, Image.gz and Image.gz-dtb, from what I've read in various tutorials was to use the Image.gz-dtb image.
So initially I unpacked stock lineageos boot.img and repacked it with my compiled Image.gz-dtb, also I've tried Anykernel2, but it just results in a non booting kernel.
I'm not sure what I'm missing and any help is really appreciated.

Unofficial build help?

I'm trying to build for a device that has no known Android 10 device trees that I can find. I think I fleshed out the trees pretty well by following some sister/cousin devices and extracting a lot of stuff from the rooted phone itself, but my build fails at 2% due to a missing output file. The missing libdss.so file should be built as part of the kernel (whose source I have), but the build clearly isn't happening (or isn't happening in time to be recognized by the build system.)
I tried to build the kernel as a standalone module to see what might be wrong, and in trying to do that I can't seem to resolve all the issues with dependencies for cross-compilation to arm64. I've built for devices with existing trees by cherry-picking what I needed, but I've never built for something from the ground-up like this. I don't want to make the ROM with a pre-built kernel as the end-goal would be to become official. The attached image is the exact error I'm receiving, and the following links are to all of my source repositories that I'm using in addition to the Lineage17.1 base. Any help would be appreciated. I work as a full-time dev by day, I don't mind slogging around in some code if that's what I takes, I've just reached the end of my troubleshooting knowledge here and am not sure what the next step might be.
https://github.com/polaarbear/android_device_motorola_troika_sprout
https://github.com/polaarbear/android_device_motorola_universal9610-common
https://github.com/polaarbear/android_vendor_motorola_universal9610-common
https://github.com/polaarbear/android_kernel_motorola_universal9610

[ROM][UNOFFICIAL][10] e/OS 0.22 q for Motorola One xt1941-4

Following this thread, I recently built e/OS 0.22q for Motorola One xt1941-4 (deen). Please refer to https://e.foundation/e-os/ to learn more about e/OS.
After several weeks of usage this ROM seems to be very useful. Find the zip file with the images of the Andoid 10 version here. Unzip and flash using adb and fastboot. Please use at your own risk!
I used the following repos in my local manifest:
https://github.com/electimon/device_motorola_deen, branch Lineage-17.1
https://github.com/electimon/vendor_motorola_deen, branch Lineage-17.1
https://github.com/100Daisy/android_kernel_motorola_deen, branch android-10-release-qpks30.54-22-13
In addition, I included
https://github.com/LineageOS/android_system_qcom, branch Lineage-17.1
which is obviously needed by some stuff from vendor. Vendor files are from 2019, so if someone could provide a more recent repo, I would be glad to know (last stock rom provided by Motorola is from October 2021)
All credits go to the creators of the LineageOS 17.1 port (link to thread at the top of this post)! Very good job guys!
Works just fine, thanks.
LSV12 said:
Works just fine, thanks.
Click to expand...
Click to collapse
Thanks!
Hi! can you make a tutorial to install this rom? i'm new at the custom roms and idk how to install, and sorry for my bad english, i'm brazillian
01nick07 said:
Hi! can you make a tutorial to install this rom? i'm new at the custom roms and idk how to install, and sorry for my bad english, i'm brazillian
Click to expand...
Click to collapse
I'm sorry, but I have no time and I am not good at making tutorials at all. Please refer to the thread referenced at the beginning of the initial post. There you should find all necessary information. If this is not enough, do some more searching and reading on XDA. If you still feel uncomfortable, stay with the stock rom.
Nice work. You succeeded where I failed
I'm trying to build on top of Q to build a e/os 0.23-R version (I see you actually managed to do this). Are you willing to share your sources (here/github) or just a hint on how to build it?
I tried to compile, but I'm stopped at the beginning of the repo-sync for a duplicate manifest.xml
Thank you.
PS: One thing I stumbled upon and managed to fix is the new way e/os manages the prebuilt apk with git lfs
The build will fail unless these apks are downloaded in a separate step. Here's the relevant info from the docs:
Those building using traditional repo sync method refer android_prebuilts_prebuiltapks_lfs 3
You will have to install git-lfs
sudo apt-get install git-lfs
After completing a repo sync, you will have to run
repo forall -c 'git lfs pull'
xdadevc said:
Nice work. You succeeded where I failed
I'm trying to build on top of Q to build a e/os 0.23-R version (I see you actually managed to do this). Are you willing to share your sources (here/github) or just a hint on how to build it?
I tried to compile, but I'm stopped at the beginning of the repo-sync for a duplicate manifest.xml
Thank you.
PS: One thing I stumbled upon and managed to fix is the new way e/os manages the prebuilt apk with git lfs
The build will fail unless these apks are downloaded in a separate step. Here's the relevant info from the docs:
Those building using traditional repo sync method refer android_prebuilts_prebuiltapks_lfs 3
You will have to install git-lfs
sudo apt-get install git-lfs
After completing a repo sync, you will have to run
repo forall -c 'git lfs pull'
Click to expand...
Click to collapse
Thanks! I wrote a report on the endeavour, where you will find almost everything of what I know.
Motorola One (xt1941-4) „deen“: How to build e/OS 0.22 – Herr Elling
fusselbart.de
Please note that I am not a ROM programmer, nor maintainer, and most of the build process is black box to me. However, I will try to build e/os 1.x after summer...
HerrElling said:
Thanks! I wrote a report on the endeavour, where you will find almost everything of what I know.
Motorola One (xt1941-4) „deen“: How to build e/OS 0.22 – Herr Elling
fusselbart.de
Please note that I am not a ROM programmer, nor maintainer, and most of the build process is black box to me. However, I will try to build e/os 1.x after summer...
Click to expand...
Click to collapse
I read your article and managed to follow it and compile my own e/os. I'm also not an android developer. I did some kernel work in the early days, around Android 2.0 but my path diverged and now I'm completely lost.
Let's keep in touch. If you restart your efforts, I'll be happy to contribute. Meanwhile I'll try my best to get some info from the e/os forums and (pray) the lineageos residual devs.

Categories

Resources