From my previous posts, you can see that I am enjoying the journey of trying to build a custom ROM for the CAT S42G cell phone. In particular, I am building LineageOS 19.1, because that is the version that matches the OTA update that I pulled and extracted with dumpyara and aospdtgen.
I have a successful build now, where the trees are such that it builds from start to finish in 2 hours flat (on my machine) from a clean out folder. However, I should mention, that flashing the zip in TWRP does not work, but gives me some errors, which means I need to go back and rework the TWRP build that I have. And flashing the individual partitions with fastboot/d does flash, but does not boot. So this is still a work in progress.
I might also mention that these “fixes” are not necessarily correct. This may not be the right way to fix these errors, but this is what I did that worked for building. Please remember that I am not an expert at programming nor at ROM building. However, I would like to share what I’ve done. Each error will be written here, with a note below it showing what I did to fix, get around, or bypass the error.
In file included from build/make/core/main.mk:1441:
build/make/core/Makefile:61: error: VINTF metadata found in PRODUCT_COPY_FILES:
vendor/cat/S42G/proprietary/odm/etc/vintf/manifest_dsds.xml:system/vendor/odm/et
c/vintf/manifest_dsds.xml, use ODM_MANIFEST_FILES / vintf_fragments instead!.
08:38:40 ckati failed with: exit status 1
PRODUCT_COPY_FILES:
vendor/cat/S42G/proprietary/odm/etc/vintf/manifest_dsds.xml:system/vendor/odm/et
c/vintf/manifest_dsds.xml
Change to =>
ODM_MANIFEST_FILES += \
vendor/cat/S42G/proprietary/vendor/odm/etc/vintf/manifest_dsds.xml \
vendor/cat/S42G/proprietary/vendor/odm/etc/vintf/manifest_qsqs.xml \
vendor/cat/S42G/proprietary/vendor/odm/etc/vintf/manifest_ss.xml \
vendor/cat/S42G/proprietary/vendor/odm/etc/vintf/manifest_tsts.xml
In the vendor/cat/S42G/S42G-vendor.mk file.
========================
build/make/core/base_rules.mk:588: error: overriding commands for target `out/ta
rget/product/S42G/system/vendor/etc/vintf/manifest/android.hardware.boot@1.2.xml
', previously defined at build/make/core/base_rules.mk:525
08:59:22 ckati failed with: exit status 1
Removed from Android.bp in vendor.
======================
build/make/core/base_rules.mk:525: error: overriding commands for target `out/ta
rget/product/S42G/system/vendor/etc/vintf/manifest/android.hardware.cas@1.2-serv
ice-lazy.xml', previously defined at build/make/core/base_rules.mk:588
09:05:02 ckati failed with: exit status 1
Removed from Android.bp in vendor.
===========================
build/make/core/base_rules.mk:588: error: overriding commands for target `out/ta
rget/product/S42G/system/vendor/etc/vintf/manifest/android.hardware.health@2.1.x
ml', previously defined at build/make/core/base_rules.mk:525
09:09:01 ckati failed with: exit status 1
Removed from Android.bp in vendor.
==========================
build/make/core/base_rules.mk:525: error: overriding commands for target `out/ta
rget/product/S42G/system/vendor/etc/vintf/manifest/gnss-default.xml', previously
defined at build/make/core/base_rules.mk:588
09:22:55 ckati failed with: exit status 1
Removed from Android.bp in vendor.
==========================
FAILED:
build/make/core/base_rules.mk:525: error: overriding commands for target `out/ta
rget/product/S42G/system/vendor/etc/vintf/manifest/gnss@2.1-service.xml', previo
usly defined at build/make/core/base_rules.mk:588
09:29:31 ckati failed with: exit status 1
Removed from Android.bp in vendor.
==========================
FAILED:
build/make/core/base_rules.mk:525: error: overriding commands for target `out/ta
rget/product/S42G/system/vendor/etc/vintf/manifest/manifest_android.hardware.drm
@1.4-service.clearkey.xml', previously defined at build/make/core/base_rules.mk:
588
09:37:25 ckati failed with: exit status 1
Removed from Android.bp in vendor.
==========================
build/make/core/base_rules.mk:525: error: overriding commands for target `out/ta
rget/product/S42G/system/vendor/etc/vintf/manifest/power-default.xml', previousl
y defined at build/make/core/base_rules.mk:588
09:46:21 ckati failed with: exit status 1
Removed from Android.bp in vendor.
==========================
build/make/core/base_rules.mk:588: error: overriding commands for target `out/ta
rget/product/S42G/system/vendor/etc/vintf/manifest/android.hardware.wifi@1.0-ser
vice.xml', previously defined at build/make/core/base_rules.mk:525
09:52:29 ckati failed with: exit status 1
Removed from Android.bp in vendor.
==========================
FAILED:
build/make/core/Makefile:61: error: overriding commands for target `out/target/p
roduct/S42G/system/etc/libnfc-nci.conf', previously defined at build/make/core/b
ase_rules.mk:525
09:59:24 ckati failed with: exit status 1
Commented out in S42G-vendor.mk
==========================
FAILED: ninja: 'vendor/cat/S42G/proprietary/odm/etc/vintf/manifest_dsds.xml', ne
eded by 'out/target/product/S42G/gen/ETC/odm_manifest.xml_intermediates/manifest
.xml', missing and no known rule to make it
10:10:02 ninja failed with: exit status 1
Wrong path in S42G-vendor.mk, fixed.
=========================
[ 62% 62758/100277] build out/target/product/S42G/dtbo.img
FAILED: out/target/product/S42G/dtbo.img
/bin/bash -c "(cp device/cat/S42G/prebuilts/dtbo.img out/target/product/S42G/dtb
o.img ) && (out/host/linux-x86/bin/avbtool add_hash_footer --image out/
target/product/S42G/dtbo.img --partition_size 53248 --partition_
name dtbo --prop com.android.build.dtbo.fingerprint:\$(cat out/target/
product/S42G/build_fingerprint.txt) )"
/home/alaskalinuxuser/android/lineage19/out/host/linux-x86/bin/avbtool: Parition
size of 53248 is too small. Needs to be at least 69632
set avb enable to false in boardconfig.mk in dt.
=========================
FAILED: out/target/common/obj/APPS/webview_intermediates/enforce_uses_libraries.
status
/bin/bash -c "(rm -f out/target/common/obj/APPS/webview_intermediates/enforce_us
es_libraries.status ) && (build/soong/scripts/manifest_check.py --enfo
rce-uses-libraries --enforce-uses-libraries-status out/target/common/obj/
APPS/webview_intermediates/enforce_uses_libraries.status --aapt out/hos
t/linux-x86/bin/aapt external/chromium-webv
iew/prebuilt/arm/webview.apk )"
zipro W 11-15 13:00:12 2873 2873 Error opening archive external/chromium-webvi
ew/prebuilt/arm/webview.apk: Invalid file
ERROR: dump failed because no AndroidManifest.xml found
error: Command '['out/host/linux-x86/bin/aapt', 'dump', 'badging', 'external/chr
omium-webview/prebuilt/arm/webview.apk']' returned non-zero exit status 1
13:00:41 ninja failed with: exit status 1
repo forall -c 'git lfs pull'
==========================
error: found duplicate sysprop assignments:
#ro.config.notification_sound=pixiedust.ogg
ro.config.notification_sound=Argon.ogg
error: found duplicate sysprop assignments:
#ro.config.alarm_alert=Cesium.ogg
ro.config.alarm_alert=Hassium.ogg
error: found duplicate sysprop assignments:
#ro.product.ab_ota_partitions=boot,system,vendor
ro.product.ab_ota_partitions=system,vendor,product,boot,vbmeta_vendor,vbmeta_sys
tem
error: found duplicate sysprop assignments:
#ro.config.ringtone=Noises1.ogg
ro.config.ringtone=Orion.ogg
Edited and removed from product.prop
error: found duplicate sysprop assignments:
ro.build.display.id=lineage_S42G-userdebug 12 SQ3A.220705.004 eng.alaska.2023111
5.125729 test-keys
ro.build.display.id=SP1A.210812.016 release-keys
Edited and removed from system.prop
============================
[ 99% 6211/6213] Package target files: out/target/product/S42G/obj/PACKAGING/tar
FAILED: out/target/product/S42G/obj/PACKAGING/target_files_intermediates/lineage
_S42G-target_files-eng.alaskalinuxuser.zip
/bin/bash -c "(rm -rf out/target/product/S42G/obj/PACKAGING/target_files_interme
diates/lineage_S42G-target_files-eng.alaskalinuxuser.zip out/target/product/S42G
/obj/PACKAGING/target_files_intermediates/lineage_S42G-target_files-eng.alaskali
nuxuser.zip.list out/target/product/S42G/obj/PACKAGING/target_files_intermediate
s/lineage_S42G-target_files-eng.alaskalinuxuser ) && (mkdir -p out/target/produc
t/S42G/obj/PACKAGING/target_files_intermediates/ out/target/product/S42G/obj/PAC
KAGING/target_files_intermediates/lineage_S42G-target_files-eng.alaskalinuxuser
) ====> Edited for space <=======
e_S42G-target_files-eng.alaskalinuxuser/META | sort >out/target/product/S42G/obj
/PACKAGING/target_files_intermediates/lineage_S42G-target_files-eng.alaskalinuxu
ser.zip.list ) && (find out/target/product/S42G/obj/PACKAGING/target_files_inter
mediates/lineage_S42G-target_files-eng.alaskalinuxuser -path out/target/product/
S42G/obj/PACKAGING/target_files_intermediates/lineage_S42G-target_files-eng.alas
kalinuxuser/META -prune -o -print | sort >>out/target/product/S42G/obj/PACKAGING
/target_files_intermediates/lineage_S42G-target_files-eng.alaskalinuxuser.zip.li
st ) && (out/soong/host/linux-x86/bin/soong_zip -d -o out/target/product/S42G/ob
j/PACKAGING/target_files_intermediates/lineage_S42G-target_files-eng.alaskalinux
user.zip -C out/target/product/S42G/obj/PACKAGING/target_files_intermediates/lin
eage_S42G-target_files-eng.alaskalinuxuser -r out/target/product/S42G/obj/PACKAG
ING/target_files_intermediates/lineage_S42G-target_files-eng.alaskalinuxuser.zip
.list )"
2023-11-16 07:11:28 - common.py - WARNING : Failed to read SYSTEM/etc/build.prop
2023-11-16 07:11:28 - common.py - WARNING : Failed to read VENDOR/etc/build.prop
2023-11-16 07:11:28 - common.py - WARNING : Failed to read VENDOR/build.prop
2023-11-16 07:11:28 - common.py - WARNING : Failed to read PRODUCT/etc/build.pro
p
2023-11-16 07:11:28 - common.py - WARNING : Failed to read PRODUCT/build.prop
2023-11-16 07:11:28 - common.py - WARNING : Failed to read SYSTEM_EXT/etc/build.
prop
2023-11-16 07:11:28 - common.py - WARNING : Failed to read SYSTEM_EXT/build.prop
2023-11-16 07:11:28 - common.py - WARNING : Failed to read ODM/etc/build.prop
2023-11-16 07:11:28 - common.py - WARNING : Failed to read ODM/build.prop
2023-11-16 07:11:28 - common.py - WARNING : Failed to read VENDOR_DLKM/etc/build
.prop
2023-11-16 07:11:28 - common.py - WARNING : Failed to read VENDOR_DLKM/build.pro
p
2023-11-16 07:11:28 - common.py - WARNING : Failed to read ODM_DLKM/etc/build.pr
op
2023-11-16 07:11:28 - common.py - WARNING : Failed to read ODM_DLKM/build.prop
-- Screw it, using prebuilt vendor image in boardconfig.mk.
# Vendor partition options.
# If you wish to use the prebuilt vendor image. Comment all of this out to buil>
BOARD_PREBUILT_VENDORIMAGE := vendor/cat/S42G/vendor.img
or
TARGET_COPY_OUT_VENDOR := vendor
BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4
Decided to use the vendor image taken from the OTA, with which I got all the vendor files, but tested by having lineage build the vendor also, the end result is the same. Using the prebuilt vendor is handy because it saves time, but it is difficult to send the large vendor image file, so best to build without prebuilt vendor.
================================
AssertionError: Failed to find product.img
Edit boardconfig.mk to include:
# To build the product image.
TARGET_COPY_OUT_PRODUCT := product
BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE := ext4
===============================
All told, it was about 15 or 16 errors in the build process, and I’ve shown you what I did to “fix” them. You can also see the device tree changes here:
Linux – keep it simple.