[Android] albertoduqe:
Hi again :)

Appart from my Cardinal bootloop I am facing a set of annoying build errors with Atomic Oreo, also for Lithium.

Clear in advance: I had successfully built it before yesterday with no issues whatsoever, not during the building.

Then yesterday I started getting errors related to vendor.img at 99%:

https://pastebin.com/ySPDyxWN

Since then I,ve searched and tried all I know and found.

Noticed that in build/core/Makefile it was missing a block # Create symlink /system/vendor to /vendor if necessary. for BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE, so I added it following this: https://android.googlesource.com/platform/build/+/3e72ed1^!/

You can see the default Makefile from AtomicOS:

https://github.com/Atomic-OS/platform_build/blob/oreo/core/Makefile

Also aded

BOARD_USES_VENDORIMAGE := true
BOARD_NEEDS_VENDORIMAGE_SYMLINK := true

to BoardConfigCommon because they were missing.

And I,ve tried all combinations of adding and commenting some or all of those elements to no avail. Same error persist.

Then I decided to modify the code, eliminating the conditions and leaving only the definition of create-system-vendor-symlink, like this:

# Create symlink /system/vendor to /vendor if necessary.
ifdef BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE
define create-system-vendor-symlink
endef
endif

I did it to all three elements, and to just one and to just two. It has worked like that with CosmicOS, where I was having the same issues, but with Atomic, doing this provided a new error:

Created filesystem with 11/24576 inodes and 3131/98304 blocks
Running: simg2img /home/albertoduqe/atomico/out/target/product/lithium/obj/PACKAGING/target_files_intermediates/aos_lithium-target_files-0ea19f0bec/IMAGES/cache.img /home/albertoduqe/atomico/out/target/product/lithium/obj/PACKAGING/target_files_intermediates/aos_lithium-target_files-0ea19f0bec/IMAGES/unsparse_cache.img

Running: e2fsck -f -n /home/albertoduqe/atomico/out/target/product/lithium/obj/PACKAGING/target_files_intermediates/aos_lithium-target_files-0ea19f0bec/IMAGES/unsparse_cache.img
e2fsck 1.43.3 (04-Sep-2016)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
cache: 11/24576 files (0.0% non-contiguous), 3131/98304 blocks
cache size (146) is 0.00% of limit (402653184)

++++ radio ++++

done.
[ 99% 811/812] Package OTA: /home/albe...lithium/aos_lithium-ota-0ea19f0bec.zip
FAILED: /home/albertoduqe/atomico/out/target/product/lithium/aos_lithium-ota-0ea19f0bec.zip
/bin/bash -c "PATH=/home/albertoduqe/atomico/out/host/linux-x86/bin/:\$PATH MKBOOTIMG=/home/albertoduqe/atomico/out/host/linux-x86/bin/mkbootimg	./build/tools/releasetools/ota_from_target_files -v	--block	--extracted_input_target_files /home/albertoduqe/atomico/out/target/product/lithium/obj/PACKAGING/target_files_intermediates/aos_lithium-target_files-0ea19f0bec	-p /home/albertoduqe/atomico/out/host/linux-x86	-k build/target/product/security/testkey	--backup=true	/home/albertoduqe/atomico/out/target/product/lithium/obj/PACKAGING/target_files_intermediates/aos_lithium-target_files-0ea19f0bec.zip /home/albertoduqe/atomico/out/target/product/lithium/aos_lithium-ota-0ea19f0bec.zip"
running: openssl pkcs8 -in build/target/product/security/testkey.pk8 -inform DER -nocrypt
--- target info ---
blockimgdiff_versions = (str) 3,4
blocksize = (int) 262144
boot_size = (int) 67108864
build.prop = (dict) {'ro.build.display.id': 'aos_lithium-userdebug 8.1.0 OPM5.171019.015 2a1f513650 test-keys', 'ro.wifi.channels': '', 'ro.treble.enabled': 'false', 'ro.build.id': 'OPM5.171019.015', 'ro.product.cpu.abilist': 'arm64-v8a,armeabi-v7a,armeabi', 'ro.build.product': 'lithium', 'ro.build.host': 'albertoduqe-X782X-X783X', 'ro.product.name': 'lithium', 'ro.build.version.security_patch': '2018-02-05', 'ro.product.manufacturer': 'Xiaomi', 'ro.product.cpu.abilist32': 'armeabi-v7a,armeabi', 'ro.build.version.incremental': '2a1f513650', 'ro.build.version.preview_sdk': '0', 'dalvik.vm.isa.arm.features': 'default', 'ro.build.tags': 'test-keys', 'dalvik.vm.isa.arm64.variant': 'kryo', 'ro.aos.device': 'lithium', 'ro.build.version.sdk': '27', 'ro.build.date': 'mi\xc3\xa9 feb 14 11:54:39 CET 2018', 'dalvik.vm.isa.arm.variant': 'kryo', 'ro.product.locale': 'en-US', 'ro.build.fingerprint': 'Xiaomi/lithium/lithium:6.0.1/MXB48T/V8.2.4.0.MAHMIDL:user/release-keys', 'ro.build.date.utc': '1518605679', 'ro.build.characteristics': 'default', 'ro.product.cpu.abilist64': 'arm64-v8a', 'ro.build.expect.modem': '2017-12-22 18:52:12', 'ro.build.user': 'albertoduqe', 'dalvik.vm.isa.arm64.features': 'default', 'ro.expect.recovery_id': '0x9bf47fcbb2da8d8dd616f32791b5ebdac93556e5000000000000000000000000', 'ro.product.device': 'lithium', 'ro.build.version.all_codenames': 'REL', 'dalvik.vm.stack-trace-dir': '/data/anr', 'ro.build.description': 'lithium-user 6.0.1 MXB48T V8.2.4.0.MAHMIDL release-keys', 'ro.build.flavor': 'aos_lithium-userdebug', 'ro.product.cpu.abi': 'arm64-v8a', 'ro.bionic.ld.warning': '1', 'ro.product.brand': 'Xiaomi', 'persist.sys.dalvik.vm.lib.2': 'libart.so', 'ro.build.version.release': '8.1.0', 'ro.build.version.codename': 'REL', 'net.bt.name': 'Android', 'ro.build.type': 'userdebug', 'ro.product.model': 'MI MIX', 'ro.build.version.base_os': ''}
cache_fs_type = (str) f2fs
cache_size = (int) 402653184
default_system_dev_certificate = (str) build/target/product/security/testkey
ext_mkuserimg = (str) mkuserimg.sh
extfs_sparse_flag = (str) -s
fs_type = (str) ext4
fstab = (dict) {'none': <common.Partition object at 0x7f68235ca0d0>, '/cache': <common.Partition object at 0x7f68235c1790>, '/boot': <common.Partition object at 0x7f68235c1710>, '/system': <common.Partition object at 0x7f68235c1810>, '/dsp': <common.Partition object at 0x7f68235c18d0>, '/frp': <common.Partition object at 0x7f68235ca050>, '/persist': <common.Partition object at 0x7f68235c1850>, '/recovery': <common.Partition object at 0x7f68235c1750>, '/firmware': <common.Partition object at 0x7f68235c1910>, '/bt_firmware': <common.Partition object at 0x7f68235c1a90>, '/misc': <common.Partition object at 0x7f68235ca090>, '/data': <common.Partition object at 0x7f68235c1890>, '/vendor': <common.Partition object at 0x7f68235c17d0>}
fstab_version = (int) 2
mkbootimg_args = (str)
mkbootimg_version_args = (str) --os_version 8.1.0 --os_patch_level 2018-02-05
multistage_support = (str) 1
ota_override_device = (str) lithium
recovery_api_version = (int) 3
recovery_as_boot = (str)
recovery_mount_options = (str) ext4=max_batch_time=0,commit=1,data=ordered,barrier=1,errors=panic,nodelalloc
recovery_size = (int) 67108864
selinux_fc = (str) /home/albertoduqe/atomico/out/target/product/lithium/obj/PACKAGING/target_files_intermediates/aos_lithium-target_files-0ea19f0bec/META/file_contexts.bin
squashfs_sparse_flag = (str) -s
system_size = (int) 3221225472
tool_extensions = (str) device/xiaomi/msm8996-common
use_set_metadata = (str) 1
userdata_size = (int) 58846064640
vendor_fs_type = (str) ext4
vendor_size = (int) 872415232
(using device-specific extensions from target_files)
loaded device-specific extensions from /home/albertoduqe/atomico/out/target/product/lithium/obj/PACKAGING/target_files_intermediates/aos_lithium-target_files-0ea19f0bec/META/releasetools.py
using prebuilt recovery.img from IMAGES...

ERROR: couldn't find ro.aos.display.version in build.prop

ninja: build stopped: subcommand failed.
13:26:57 ninja failed with: exit status 1
build/core/main.mk:21: recipe for target 'run_soong_ui' failed
make: *** [run_soong_ui] Error 1

I don't see how modifying those lines in the core/Makefile can give this error, no element related to the definition of ro.aos.display.version has been touched, as far as I know.

I can make it build eliminating this treble-support/vendor.img stuff, commenting the key lines in BoardConfigCommon... Although then the build has bluetooth broken and it had worked before (I of course have no idea if both are related)... But bluetooth or no bluetooth, I would like to make it build with vendor.img as the rom source is defined to do. And I don't understand why it started failing and it is very annoying not to understand things.

So any help will be very much appreciated :)

Also, sorry for the length...