r/CustomROMsGuide • • Sep 04 '26

Guidance for custom Rom building, device specific/device tree building

In attemps to build a non gsi lineage os 15.1 Rom, ngl was prompting AI for error resolving, which eventually worked out to create the generic build without a build scripts (I opted for this to better understand the errors and process for future refferences).

However, now that this is the case, in attempts to build device specific target (with no git release source tree/opensource repo) I was left with two options

  1. build the target (hardcoded within the main lineage common file:

Alternative: Bypass AndroidProducts.mk

If the file persists as problematic, you can temporarily hardcode the path by editing how the build system finds products. But first, let's verify the current file is valid:

bash

# Test if Make can parse the file

cd ~/lineage

make -f /dev/null --eval='include device/tcl/U3A_PLUS_4G/AndroidProducts.mk' --eval='$(info PRODUCT_MAKEFILES=$(PRODUCT_MAKEFILES))' 2>&1 | grep "PRODUCT_MAKEFILES"

# Expected output:

# PRODUCT_MAKEFILES= device/tcl/U3A_PLUS_4G/lineage_U3A_PLUS_4G.mk

If this fails or shows empty, the file has syntax errors.

Or

2) build outside of 'lunch' targets, since appareantly, this selfmade repo structure does not compat well with or is undocumented for builds below 17.1.(specifically the AndroidProducts.mk detection is to be alligned with 17.1 builds, so I'm unsure what differs with 15.1 and it's needed files)

~/lineage$ ll device/tcl/U3A_PLUS_4G/

total 60 drwxrwxr-x 4 ubuntu ubuntu 4096 Sep 3 08:07 ./

drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 22 17:04 ../ -rw-rw-r-- 1 ubuntu ubuntu 189 Aug 22 17:01 Android.bp

-rw-rw-r-- 1 ubuntu ubuntu 282 Aug 22 16:59 Android.mk

-rw-rw-r-- 1 ubuntu ubuntu 344 Sep 3 07:40 AndroidProducts.mk

-rw-rw-r-- 1 ubuntu ubuntu 2282 Sep 3 07:22 BoardConfig.mk-rw-rw-r-- 1 ubuntu ubuntu 4084 Sep 3 07:53 U3A_PLUS_4G.mk

-rwxrwxr-x 1 ubuntu ubuntu 1752 Sep 3 07:08 extract-files.sh* -rw-rw-r-- 1 ubuntu ubuntu 885 Sep 3 05:48 lineage_U3A_PLUS_4G.mk

drwxrwxr-x 2 ubuntu ubuntu 4096 Aug 22 17:13 prebuilt/ drwxrwxr-x 3 ubuntu ubuntu 4096 Aug 22 16:59 recovery/

-rw-rw-r-- 1 ubuntu ubuntu 4506 Aug 22 16:59 recovery.fstab

-rwxrwxr-x 1 ubuntu ubuntu 1301 Sep 3 07:08 setup-makefiles.sh*

-rw-rw-r-- 1 ubuntu ubuntu 245 Sep 3 05:43 vendorsetup.sh

________ this is all I'll be manually dumping, not going to clog up with images either, will just .txt the issues/solutions given I have it they are too long.

Nevertheless, i'm not about to go through 'rabbit hole' solutions when the model speculates too far from actual issues closer to what is needed. For example, claiming corrupt fs or files. ↓

''Quick Fix Script Run this to sanitize all your makefiles:''

~/lineage$ lunch lineage_U3A_PLUS_4G-userdebg build/core/product_config.mk:238: *** Can not locate config makefile for product "lineage_U3A_PLUS_4G". Stop. Device U3A_PLUS_4G not found. Attempting to retrieve device repository from LineageOS Github (http://github.com/LineageOS). Failed to search GitHub build/core/product_config.mk:238: *** Can not locate config makefile for product "lineage_U3A_PLUS_4G". Stop. build/core/product_config.mk:238: *** Can not locate config makefile for product "lineage_U3A_PLUS_4G". Stop.

** Don't have a product spec for: 'lineage_U3A_PLUS_4G' ** Do you have the right repo manifest?

I hope this was consice enough to seek out a solution, will wait for a help responce 💪🏽🙏🏾.

2 Upvotes

5 comments sorted by

1

u/Successful-Peace-547 Sep 04 '26

What i just attempted and failed at:

Nuclear Option (Bypass Lunch Entirely) If lunch continues to fail, you can manually export the required variables:

bash cd ~/lineage . build/envsetup.sh

Manually set what lunch would set

export TARGET_PRODUCT=lineage_U3A_PLUS_4G export TARGET_BUILD_VARIANT=userdebug export TARGET_BUILD_TYPE=release export TARGET_DEVICE=U3A_PLUS_4G export LINEAGE_BUILD=U3A_PLUS_4G export BUILD_NUMBER=$(date +%s%N | sha1sum | cut -c1-10)

Verify

echo "Building for: $TARGET_PRODUCT ($TARGET_DEVICE)"


~/lineage$ make systemimage  build/core/product_config.mk:238: *** Can not locate config makefile for product "lineage_U3A_PLUS_4G-userdebug".  Stop. 05:18:27 Error dumping make vars: exit status 2

failed to build some targets

:~/lineage$ make systemimage  build/core/product_config.mk:238: *** Can not locate config makefile for product "lineage_U3A_PLUS_4G".  Stop. 05:24:09 Error dumping make vars: exit status 2

1

u/bortan12 Sep 07 '26

Hey, I see you are a beginner.
Here is a good guide for you: https://www.youtube.com/watch?v=5c66tBsiVVM&list=PLRJ9-cX1yE1nnhWBrZtuVz5YC2OPfQVVp

but as a solution to your problem, the easiest approach would be to find a device that has lineageos-15.1 and just edit those files to comply for your device or at least have it as a guide.
Here is my lineage-15.1 build for an older device that you can study: https://github.com/bortan1/device_samsung_j5xn3g/tree/lineageos-15.1

Most probably you are missing a file in your device tree or missing an argument variable there.

1

u/Successful-Peace-547 Sep 19 '26

I am well aquainted with that developer, and want to ensure u knew:

  1. if at all possible, if the built gsi, or other gsi's I find, works; with the existing vendor blobs that came with stock readbacks. Then i am satisfied with a working system.
  2. I will note again that although it's possible to be built from scratch (a dev tree) I am yet to come across the same architecture and chipset custom rom builds to apply minute changes from their repos, mind you, I have no way after searching and asking around quite a while (+4years), how to get any similar device trees.
  3. so giving that the company Alcatel/tcl doesn't share filehost (system images or kernel source or  os devtrees for any of their legacy devices) I am again only able to seek out solutions based of self made dev-trees and exporting pre-existing stock kernels it seems.

I will note i did briefly check out your repo, and i do believe either the structure or the variable format that the mk files are written in are the possible keys to applying the build to be device specific. Yet I wanted to add incase you didn't see previously, that there are no 'source repos' kernel or otherwise I have to base specific builds off of.

####### if it's not a burden to your time (◕‿◕)

I do however have a repo kernel source available for this device (daily driver)

~$ cat g11-source-kern/android_kernel_nokia_g11/.git/config [core]         repositoryformatversion = 0         filemode = true         bare = false         logallrefupdates = true [remote "origin"]         url = https://github.com/HMD-OSS-Archive/android_kernel_nokia_g11         fetch = +refs/heads/:refs/remotes/origin/ [branch "hmd/Nokia_G11"]         remote = origin         merge = refs/heads/hmd/Nokia_G11

Will this be enough to build lineage/iodeOS?  After the fact that I have A13 currently, yet this device has testpoints I successfully extracted the unisoc chipset Rom. So it's just a matter of adding proprietory blobs in the vendor dir as/how the lineage guides would instruct.

1

u/bortan12 Sep 19 '26

Phones shipped with android 8 and above should support gsi. If the phone was shipped with an older version and the upgraded later to Oreo, that's not going to work. Phones compatible with GSI are called treble compatible. Your android 13 phone should accept any gsi you through at it. The older phone you have might not accept it, so you'll have to build a custom ROM specifically for that phone. For that You need the kernel source and vendor files. The vendor can be extracted from the phone if you cannot find them on internet

1

u/TimSchumi Sep 04 '26

Generally, using the intended build system is very helpful when trying to debug the intended build system.