r/CustomROMsGuide • u/Successful-Peace-547 • 6h ago
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 💪🏽🙏🏾.
1
u/TimSchumi 3h ago
Generally, using the intended build system is very helpful when trying to debug the intended build system.
1
u/Successful-Peace-547 5h ago
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