yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] ThePiGuy:
Yes I am particularly familiar with the LG G4 ;)

I'm going to call the base directory of your android source code [android]

android_device_lge_g4 should go to [android]/device/lge/g4

(hopefully you can see some correlation between those as a lot of repos used in android are named like this)

android_device_lge_g4-common goes to [android]/device/lge/g4-common

Titan-Kernel-LG-G4 goes to [android]/kernel/lge/msm8992

Have a look at the manifest here as there are a few more that need to be included - I think the two that aren't are at the bottom

https://github.com/Suicide-Squirrel/local_manifests/blob/lineage-16.0/roomservice.xml
[Android Software/Hacking General [Developers Only]] 4ngl09669:
In fact I was very happy when I saw that you had created this guide, if I'm not mistaken you worked on the G4!

A premise, I'm Italian, so I'm not writing in my first language. hope be understanding :)

So in summary, if I have X_Y_Z, will I have to put it (in most cases) in the X / Y / Z folder? (I had suspicions seeing the files and the manifest)

So in code for Ubuntu I should:

cd ~ / X / Y / Z
repo init -u [url]https://github.com/X/Y/Z[/url]
repo sync

So if I would like to download from github android_device_lge_g4 I would have to do it this way (in my case I called the Android root folder, and the folder where I downloaded all the PE lineage code) [actually I didn't want to change, after downloading la lineage hahaah]:

cd ~ / android / lineage / device / lge / g4-common
repo init -u [url]https://github.com/Suicide-Squirrel/android_device_lge_g4-common/tree/lineage-17.0_kessaras[/url]
repo sync

This should allow me to download the files directly to the appropriate folder. I should repeat this for everyone:

1) android_device_lge_g4

2) android_device_lge_g4-common

3) Titan-Kernel-LG-G4

But, I should also download and put in the appropriate folders:

1) LOS STUFF

2) power HAL patch

3) MISC (without the last 2, as the EP has the GApps included, and these are used to enter the alternative F-droid store, and a Backup function)

4) REMOVALS (must be at TOP) (? I have no idea what it is and what it is for)
[Android Software/Hacking General [Developers Only]] ThePiGuy:
Yes I got the initial lineage 15.1 ROM working for the G4 (using kessaras's sources, and with help from both steadfasterX and kessaras)

So it looks like you are getting a little bit confused with regards to the repo tool.

repo init -u

is used to set the main android source code directory. This should be used once, and only once.

For example, for PixelExperience:

repo init -u https://github.com/PixelExperience/manifest -b 10

where -b ten is the branch of PE that you want to build.

Once inside, I'd recommend going to the local manifest as described in the main part of the guide, and using the manifest from suicide squirrel (as in this case I know that it works). I'd then alter any ROM specific ones (those that use remote="lineage") to (if possible) use PE equivalent ones from their github.

It looks like you are trying to build A10 so you want this as your basis: https://github.com/Suicide-Squirrel/local_manifests/blob/lineage-17.0/roomservice.xml

Beware though - A10 hasn't been released yet for a reason - it's still got some major bugs
[Android Software/Hacking General [Developers Only]] 4ngl09669:
Hi, sorry but I don't understand. So, are you telling me to open the local PE manifest, and replace all the lines (which I can replace) with those taken from the Suicide-Squirrel manifest? (All this after downloading the source code of PE)
[Android Software/Hacking General [Developers Only]] ThePiGuy:
Ok so make sure you fully read the OP of this thread, as it answers a reasonable amount of your above question.

When you repo sync, it downloads the full source code for the ROM (but nothing device specific).

You can then create a file in .repo/manifests (I think, it's in the OP) called local_manifest. That's where the suicide squirrel manifest goes. From there, modify the suicide squirrel manifest to use PE where possible
[Android Software/Hacking General [Developers Only]] 4ngl09669:
EDIT: Not worked, the problem its the same : --> fatal: remote lineage already exists with different attribute

From an analysis, it seems that the error was due to the lineage name, I changed this name to local_manifest, and currently it has synchronized. Except occasionally from this other error:

git@github.com: permission denid (publickey)

fatal: could not read from remote respository

And

Error: cannot fetch Titan-kernel-LG-G4 from ssh://git@github.com/Suicide-Squirrel/Titan-kernel-LG-G4

EDIT : It looks like I solved it by renaming the "suicide" link from ssh to https
[Android Software/Hacking General [Developers Only]] ThePiGuy:
Ah yeah that would do it. So now you should have the sources synced and can follow the guide to try and get PE working :)
[Android Software/Hacking General [Developers Only]] 4ngl09669:
I'm back to bother you again :)

the second part of the guide, I didn't understand it well, just rename the files from Lineage to PixelExperience?

Because I tried to issue the source

build / envsetup.sh

command and then just

Brunch

(to see if it came out in the command list).

In the end I gave the command to build, but it only gave me mistakes. So in other words, do I just have to rename the files of the device trees in the h815 folder (I have this device model, and for this I am interested in building initially)? (first step)

while, for second action, what should I do in <rom> .dependancies? What should I add to the local manifest?
[Android Software/Hacking General [Developers Only]] SnowFuhrer:
I've been trying to build havoc for my device(a5) but keep getting this error.

============================================
[1/1] /home/snowfuhrer/AOSP/havoc-2/out/soong/.minibootstrap/minibp /home/snowfuhrer/AOSP/havoc-2/out/soong/.bootstrap/build.ninja
[1/1] /home/snowfuhrer/AOSP/havoc-2/out/soong/.bootstrap/bin/soong_build /home/snowfuhrer/AOSP/havoc-2/out/soong/build.ninja
FAILED: /home/snowfuhrer/AOSP/havoc-2/out/soong/build.ninja
/home/snowfuhrer/AOSP/havoc-2/out/soong/.bootstrap/bin/soong_build -t -l /home/snowfuhrer/AOSP/havoc-2/out/.module_paths/Android.bp.list -b /home/snowfuhrer/AOSP/havoc-2/out/soong -n /home/snowfuhrer/AOSP/havoc-2/out -d /home/snowfuhrer/AOSP/havoc-2/out/soong/build.ninja.d -o /home/snowfuhrer/AOSP/havoc-2/out/soong/build.ninja Android.bp
panic: package "android/soong/generator" already has a package context

goroutine 1 [running]:
github.com/google/blueprint.NewPackageContext(0x8a37e3, 0x17, 0x8aa62c, 0x21)
/home/snowfuhrer/AOSP/havoc-2/build/blueprint/package_ctx.go:99 +0x464
android/soong/android.NewPackageContext(0x8a37e3, 0x17, 0xc4200d7f68, 0x79376e)
/home/snowfuhrer/AOSP/havoc-2/build/soong/android/package_ctx.go:33 +0x35
ninja: build stopped: subcommand failed.
19:34:56 soong bootstrap failed with: exit status 1

Im sure its a simple mistake, but i cant figure it for the life of me. Anyone have an idea? Thanks
[Android Software/Hacking General [Developers Only]] TheForce:
When you're going to build 2 versions of a build, is it then wise to also make 2 directories, for example: /android/lineage9 and /android/lineage10 or can you make the 2 builds in one directory /android/lineage ???

Thank you for making this thread.

Solved: I have to make 2 maps.
[Android Software/Hacking General [Developers Only]] davortes2:
couldn't compile

-Predator-G3-572:/media/data/lineage_17.1$ brunch lineage_dream2lte-userdebug

Looking for dependencies in device/samsung/dream2lte

Looking for dependencies in device/samsung/universal8895-common

Looking for dependencies in hardware/samsung

hardware/samsung has no additional dependencies.

Looking for dependencies in kernel/samsung/universal8895

kernel/samsung/universal8895 has no additional dependencies.

Looking for dependencies in packages/resources/devicesettings

packages/resources/devicesettings has no additional dependencies.

============================================

PLATFORM_VERSION_CODENAME=REL

PLATFORM_VERSION=10

LINEAGE_VERSION=17.1-20200304-UNOFFICIAL-dream2lte

TARGET_PRODUCT=lineage_dream2lte

TARGET_BUILD_VARIANT=userdebug

TARGET_BUILD_TYPE=release

TARGET_ARCH=arm64

TARGET_ARCH_VARIANT=armv8-a

TARGET_CPU_VARIANT=exynos-m1

TARGET_2ND_ARCH=arm

TARGET_2ND_ARCH_VARIANT=armv8-a

TARGET_2ND_CPU_VARIANT=cortex-a53.a57

HOST_ARCH=x86_64

HOST_2ND_ARCH=x86

HOST_OS=linux

HOST_OS_EXTRA=Linux-5.3.0-40-generic-x86_64-Ubuntu-18.04.4-LTS

HOST_CROSS_OS=windows

HOST_CROSS_ARCH=x86

HOST_CROSS_2ND_ARCH=x86_64

HOST_BUILD_TYPE=release

BUILD_ID=QQ1B.200205.002

OUT_DIR=out

============================================

============================================

PLATFORM_VERSION_CODENAME=REL

PLATFORM_VERSION=10

LINEAGE_VERSION=17.1-20200304-UNOFFICIAL-dream2lte

TARGET_PRODUCT=lineage_dream2lte

TARGET_BUILD_VARIANT=userdebug

TARGET_BUILD_TYPE=release

TARGET_ARCH=arm64

TARGET_ARCH_VARIANT=armv8-a

TARGET_CPU_VARIANT=exynos-m1

TARGET_2ND_ARCH=arm

TARGET_2ND_ARCH_VARIANT=armv8-a

TARGET_2ND_CPU_VARIANT=cortex-a53.a57

HOST_ARCH=x86_64

HOST_2ND_ARCH=x86

HOST_OS=linux

HOST_OS_EXTRA=Linux-5.3.0-40-generic-x86_64-Ubuntu-18.04.4-LTS

HOST_CROSS_OS=windows

HOST_CROSS_ARCH=x86

HOST_CROSS_2ND_ARCH=x86_64

HOST_BUILD_TYPE=release

BUILD_ID=QQ1B.200205.002

OUT_DIR=out

============================================

[ 99% 627/628] finishing build rules ...

FAILED:

build/make/core/main.mk:1319: warning: Host modules should be in PRODUCT_HOST_PACKAGES, not PRODUCT_PACKAGES

Offending entries:

dtbhtoolExynos

build/make/core/main.mk:1319: error: Build failed.

15:39:53 ckati failed with: exit status 1

#### failed to build some targets (01:30 (mm:ss)) ####
[Android Software/Hacking General [Developers Only]] C0nvert:
Hey Guys i have a question

if i have LOS 13 for my Device (MI PAD 2) and have all the necessary Code for it, can i build e.g los 17.1 with it?

https://github.com/latte-dev
[Android Software/Hacking General [Developers Only]] ThePiGuy:
Switching between Android versions is very different to swapping out the ROM base on the same Android version.

The kernel needs to have pieces applied to it (without that it won't even get far enough to give logs for debugging) and given that you are working with an Android 6 base, there is no guarantee that the A6 blobs will work with A10.

I'm not particularly experienced with this and therefore will not be able to provide help, however if you do want to continue I'd suggest trying to get 14.1 working first, then 15.1 etc (don't jump straight to 17.1)
[Android Software/Hacking General [Developers Only]] C0nvert:
Thanks Mate for your wuick response.

Maybe then an other question

if i have the source code of an opensource app and it no got android 6 support deleted (stable Version) but a version before it had android 6 support, is it possible to add it somehow back?

There was major changes to the ui, thats why i want the stable version
[Android Software/Hacking General [Developers Only]] ThePiGuy:
I don't know about apps unfortunately
[Android Software/Hacking General [Developers Only]] suking89:
Dear ThePiGuy,

I get a problem here. while i build the lineageos 17.1 for oneplus 7 pro , it build success. But, i install the zip file into the deivce ,it can not boot-up success. i donot know why,Could you help me?

Otherwise, I get the offical zip file to install into the device ,it works well.

thanks!
[Android Software/Hacking General [Developers Only]] ThePiGuy:
So if I'm honest, this probably isn't the correct place for this question, and I've also not dealt with building for A/B devices such as the OP7 Pro.

However, I will check: Did you follow these instructions https://wiki.lineageos.org/devices/guacamole/build

If so, when you follow install instructions make sure to swap the recovery image they mention there with your boot.img (inside the OUT folder) and to sideload your unofficial lineage.zip afterwards.

As a further point, if you use gapps ensure you reboot to recovery (but not the OS) after flashing lineage and then flash the gapps.
[Android Software/Hacking General [Developers Only]] suking89:
thanks a lot!

"If so, when you follow install instructions make sure to swap the recovery image they mention there with your boot.img (inside the OUT folder) and to sideload your unofficial lineage.zip afterwards."

this means i need to flash the boot.img from OUT forder and then sideload The zip file,right?

To flash The boot.img,i use commands as "fastboot flash boot boot.img " in The bootloader mode. is it right?Or need to goto The recovery mode?but how to Do it?thanks for you help!
[Android Software/Hacking General [Developers Only]] ThePiGuy:
Ok, so first please bear in mind I have never done this myself (I own an LG G4 which is an A-only device, so it has a separate persistent recovery partition).

But yes, from what I can gather you want to get into bootloader mode (so fastboot commands work). Then flash boot.img to the boot partition. Then reboot directly (this being important) into recovery - there might be an option in the bootloader screen, if not "fastboot reboot" followed immediately by the recovery key combination.

Once in recovery, follow the lineage instructions as usual, substituting the official zip for your home-built one.

As a further point, it could be worth asking for clarification either in the official device XDA thread or on their subreddit /r/lineageos. I know it's regarding an unofficial build, but it's regarding their official build instructions so I think you could get away with it.
[Android Software/Hacking General [Developers Only]] dbzdivik:
[MENTION=3775701]thepieguy[/MENTION]

How do you suggest to build ROM for a device which doesn't have any ROM, device tree publicly available?

Just device which is rooted.
[Android Software/Hacking General [Developers Only]] ThePiGuy:
Unfortunately I can't help there. Developing the sources from scratch is a much more complicated task (and one I have never even attempted before).

As a hint, the kernel sources will be from your manufacturer (in theory due to the GPLv2 licensing of the Linux Kernel, it should always be made available).

The blobs required will be from your stock firmware, however you can often (I believe) adapt the device tree from a similar device (similar being same chipset and similar features, not necessarily from the same manufacturer).

Unfortunately that's all I've got, but hopefully it'll help ;)

P.S. I think you tagged another XDA user :D, I'm ThePiGuy not ThePieGuy
[Android Software/Hacking General [Developers Only]] thepieguy:
I started reading the thread for several minutes thinking "what the heck I don't even..." before I figured it out. Messing with a guy early on a Monday morning not cool... :laugh::laugh:
[Android Software/Hacking General [Developers Only]] suking89:
the zip file also can not be well to boot up the device. The differences between self-build zip and officical zip :

1.official zip file size is 700M +, and self-build zip file size is 500M +

2.unzip the file ,the config below is inside the official vendor_manifest.xml but not in self-build vendor_manifest.xml:

<hal format="hidl">

<name>vendor.qti.gnss</name>

<transport>hwbinder</transport>

<fqname>@1.2::ILocHidlGnss/gnss_vendor</fqname>

<fqname>@2.1::ILocHidlGnss/gnss_vendor</fqname>

<fqname>@3.0::ILocHidlGnss/gnss_vendor</fqname>

</hal>

<hal format="hidl">

<name>android.hardware.gnss</name>

<transport>hwbinder</transport>

<fqname>@1.1::IGnss/default</fqname>

<fqname>@2.0::IGnss/default</fqname>

</hal>

<hal format="hidl">

<name>android.hardware.gnss</name>

<transport>hwbinder</transport>

<fqname>@1.0::IGnss/gnss_vendor</fqname>

</hal>

3.official payload.bin is 700M+ , self-build payload.bin is 500M+.

I think this may have errors while building the source codes. but ,i get the codes following the https://thinkpadder1.github.io/lineage_wiki/devices/guacamole/build . And then extract-files.sh to get files from device with some files dimissed,so i modify a little config to make sure the build can be successful. I do not know where is the errors.
[Android Software/Hacking General [Developers Only]] TheForce:
panic: package "android/soong/generator" already has a package context

Hello ThePiGuy,

I am trying to build blissroms for osprey.

I have downloaded the source, did repo sync all without problems

I did make a roomservice-file within all for downloading device-, vendor- and kernel-needings.

I followed with

$ . build/envsetup.sh

$ lunch lineage_osprey-userdebug

All went welll upto:

$ blissify lineage_osprey-userdebug

---------------

Then I got this error:

[100% 3/3] /home/F/android/blissroms-q/out/soong/.bootstrap/bin/soong_build /home/F/

FAILED: /home/F/android/blissroms-q/out/soong/build.ninja

/home/F/android/blissroms-q/out/soong/.bootstrap/bin/soong_build -t -l /home/F/android/blissroms-q/out/.module_paths/Android.bp.list -b /home/F/android/blissroms-q/out/soong -n /home/F/android/blissroms-q/out -d /home/F/android/blissroms-q/out/soong/build.ninja.d -globFile /home/F/android/blissroms-q/out/soong/.bootstrap/build-globs.ninja -o /home/F/android/blissroms-q/out/soong/build.ninja Android.bp

panic: package "android/soong/generator" already has a package context

goroutine 1 [running]:

github.com/google/blueprint.NewPackageContext(0xa277fe, 0x17, 0xc000111a60, 0x1)

/home/F/android/blissroms-q/build/blueprint/package_ctx.go:100 +0x4bd

android/soong/android.NewPackageContext(0xa277fe, 0x17, 0x0, 0x0)

/home/F/android/blissroms-q/build/soong/android/package_ctx.go:33 +0x35

lineage/soong/generator.init.ializers()

/home/F/android/blissroms-q/vendor/lineage/build/soong/generator/generator.go:40 +0x36

15:56:39 soong bootstrap failed with: exit status 1

--------------

I can not find anything when I google "panic: package "android/soong/generator" already has a package context"

When I try to 'solve' the problem by # or // in the beginning of the lines from both files

package_ctx.go:100 and package_ctx.go:33 Then I get other errors.

Do you have any idea how to solve this problem?

Regards
[Android Software/Hacking General [Developers Only]] ThePiGuy:
I haven't come across this issue personally and therefore I don't have that much to suggest

This thread came up when searching github for the error (https://github.com/Cosmic-OS/platform_manifest/issues/29), possibly that might help?
[Android Software/Hacking General [Developers Only]] HafidzRadhival:
Can I build customrom without manifest and only use the existing device tree?
[Android Software/Hacking General [Developers Only]] ThePiGuy:
So you need the device tree, vendor and kernel as a bare minimum.

If they need anything else, it should be documented in the .dependencies file.

Then you will need the roms manifest (obtained with repo sync). A manifest for your device is not necessary as long as you manually clone the correct repos from the .dependencies
[Android Software/Hacking General [Developers Only]] akira_yuki:
Hi!! I'm trying to build LineageOS 14.1 from source code for a ROM that is actually working on my phone (Motorola Moto E 1 - Condor), this just as a sanity check in order to have the whole environment configurated properly but I'm stuck on the envsetup.sh because it is not in any directories.

I followed the steps on https://wiki.lineageos.org/devices/condor/build which are pretty similar to those you posted here but neither works, I appreciate if you give me a hand on this.

Thank you.
[Android Software/Hacking General [Developers Only]] ThePiGuy:
Have you made sure you are in the root of your android directory.

If you synced the source code to ~/android/lineage, make sure you are trying to run ~/android/lineage/build/envsetup.sh
[Android Software/Hacking General [Developers Only]] akira_yuki:
[MENTION=8699949]ThePiGuy[/MENTION] thank you for your reply, yes, I checked for that, I just have a ".repo" directory, but, I think my problem is lack of disk space on the VM, I'm currently reinstalling using a 150 GB of space for it, I will try again and I will provide my feedback (Debian 10 64-bit with no Xwindow).

I hope to be in the right path since I have this Motorola Xoom almost got into the trash. I really appreciate if you can share any tricks or tips on how to port LineageOS to a tablet.

Thank you.
[Android Software/Hacking General [Developers Only]] ThePiGuy:
Ah ok, yes if there was just a .repo then chances are it didn't finish syncing (it downloads to the .repo folder and then moves the folders outside it once it reaches the checkout stage of the repo sync).

Unfortunately I have very few tips on porting a new device as I have only ever built devices with sources already available. Your best bet is to see if anybody has any sources for the unsupported device and then modify those to your needs.
[Android Software/Hacking General [Developers Only]] respectablenoob:
hey, I'm trying to build for Samsung device. I have acquired the Device tree, vendor and kernel source. Im stuck at how to put these device specific files in my build. I knwo how to download the source but can you please help me on how to add these files to the build. Thanks and thank you so much for this guide you are helping new people in android.
[Android Software/Hacking General [Developers Only]] ThePiGuy:
Have a look at the stuff regarding local manifest in the first post.

If they are in the correct place, then you can use the build commands as usual and it shouldn't throw any issues (it might try and download the source from the official repos if you are missing one of the dependencies though so make sure you have all of them)
[Android Software/Hacking General [Developers Only]] respectablenoob:
Thanks, I'll look into that. Also, a question. Can I build on a 4gb ram and HDD laptop? Or does it have to be beefy?
[Android Software/Hacking General [Developers Only]] ThePiGuy:
4GB is too small I'd say. I built with 8 when I did it a few years ago and that was tight.

HDD will be slow, but if you are happy to leave it for 5-6 hours it might be ok. Primarily space is the issue as each build can be 200G or so now

Edit: I built on a desktop with a HDD and with 8gb ram, quad core etc it would be about 4hrs. Depending on how old your laptop is the CPU could be really quite slow
[Android Software/Hacking General [Developers Only]] respectablenoob:
Thanks for replying, I have a Pentium silver so I might wait till I can afford a better PC. In the meantime, thanks for this guide, it's very helpful.
[Android Software/Hacking General [Developers Only]] ThePiGuy:
No worries, and glad you've found the guide helpful :)
[Android Software/Hacking General [Developers Only]] malikwaqas758:
PRODUCT_COMPATIBILITY_MATRIX_LEVEL_OVERRIDE legitimately

Determine Framework Compatibility Matrix Version in gadget show by adding an objective level ascribe to the root component <manifest>. In the event that PRODUCT_COMPATIBILITY_MATRIX_LEVEL_OVERRIDE is 26 or 27, you can include "target-level"="1" to your gadget show.

how to actualize this?

---------- Post added at 06:01 AM ---------- Previous post was at 05:59 AM ----------

Thanks all of you to share your thoughts its very impressive and get my answer
[Android Software/Hacking General [Developers Only]] ThePiGuy:
I'm sorry, I haven't encountered that so I don't know
[Android Software/Hacking General [Developers Only]] respectablenoob:
Help:(

Sorry for being such a noob I hope I'm not wasting your time. But it is the local makefile/manifest included in the Device tree or do we make it ourselves?
[Android Software/Hacking General [Developers Only]] ThePiGuy:
No worries, that's what this thread is here for ;)

The local manifest can either be created by you or supplied by a third party.

For example, this one for the LG G4 (https://github.com/LGgFour/local_manifests/tree/lineage-17.0) will let you build lineage 17, if you want to change it to a different rom you can just swap out the lineage references to the new ROM (assuming the repos exist like for like)

However sometimes these aren't provided and then you will need to make one yourself

Edit: in any case, it will not be supplied inside the device tree if it exists and will be provided in some other way, e.g a new GitHub repo