I am building AOSP android-11.0.0_r4 for the DragonBoard 845c using “build/envsetup.sh lunch-db845c-userdebug”. I get the following link errors when building:
[ 99% 707/710] Target system fs image: out/target/product/db845c/obj/PACKAGING/systemimage_intermediates/system.img
FAILED: out/target/product/db845c/obj/PACKAGING/systemimage_intermediates/system.img
/bin/bash -c “(if [ -d out/target/product/db845c/system/vendor ] && [ ! -h out/target/product/db845c/system/vendor ]; then echo ‘Non-symlink out/target/product/db845c/system/vendor detected!’ 1>&2; echo ‘You cannot install files to out/target/product/db845c/system/vendor while building a separate vendor.img!’ 1>&2; exit 1; fi ) && (ln -sf /vendor out/target/product/db845c/system/vendor ) && (if [ -d out/target/product/db845c/system/system_ext ] && [ ! -h out/target/product/db845c/system/system_ext ]; then echo ‘Non-symlink out/target/product/db845c/system/system_ext detected!’ 1>&2; echo ‘You cannot install files to out/target/product/db845c/system/system_ext while building a separate system_ext.img!’ 1>&2; exit 1; fi ) && (ln -sf /system_ext out/target/product/db845c/system/system_ext ) && (mkdir -p out/target/product/db845c/obj/PACKAGING/systemimage_intermediates/ out/target/product/db845c/obj/PACKAGING/systemimage_intermediates && rm -rf out/target/product/db845c/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo “system_fs_type=ext4” >> out/target/product/db845c/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo “system_selinux_fc=out/target/product/db845c/obj/ETC/file_contexts.bin_intermediates/file_contexts.bin” >> out/target/product/db845c/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo “ext_mkuserimg=mkuserimg_mke2fs” >> out/target/product/db845c/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo “fs_type=ext4” >> out/target/product/db845c/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo “extfs_sparse_flag=-s” >> out/target/product/db845c/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo “squashfs_sparse_flag=-s” >> out/target/product/db845c/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo “f2fs_sparse_flag=-S” >> out/target/product/db845c/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo “root_dir=out/target/product/db845c/root” >> out/target/product/db845c/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo “use_dynamic_partition_size=true” >> out/target/product/db845c/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo “skip_fsck=true” >> out/target/product/db845c/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (PATH=out/host/linux-x86/bin/:system/extras/ext4_utils/:$PATH out/host/linux-x86/bin/build_image out/target/product/db845c/system out/target/product/db845c/obj/PACKAGING/systemimage_intermediates/system_image_info.txt out/target/product/db845c/obj/PACKAGING/systemimage_intermediates/system.img out/target/product/db845c/system || ( mkdir -p ${DIST_DIR}; cp out/target/product/db845c/installed-files.txt ${DIST_DIR}/installed-files-rescued.txt; exit 1 ) )”
2022-01-03 10:50:20 - build_image.py - ERROR : Failed to build out/target/product/db845c/obj/PACKAGING/systemimage_intermediates/system.img from out/target/product/db845c/system
Out of space? Out of inodes? The tree size of /home/rftest/UWB/dragon/out/soong/.temp/tmp1JTV9N is 1169788928 bytes (1115 MB), with reserved space of 0 bytes (0 MB).
The max image size for filesystem files is 1186566144 bytes (1131 MB), out of a total partition size of 1186566144 bytes (1131 MB).
Traceback (most recent call last):
File “/home/rftest/UWB/dragon/out/host/linux-x86/bin/build_image/internal/stdlib/runpy.py”, line 174, in _run_module_as_main
File “/home/rftest/UWB/dragon/out/host/linux-x86/bin/build_image/internal/stdlib/runpy.py”, line 72, in _run_code
File “/home/rftest/UWB/dragon/out/host/linux-x86/bin/build_image/main.py”, line 12, in
File “/home/rftest/UWB/dragon/out/host/linux-x86/bin/build_image/internal/stdlib/runpy.py”, line 174, in _run_module_as_main
File “/home/rftest/UWB/dragon/out/host/linux-x86/bin/build_image/internal/stdlib/runpy.py”, line 72, in _run_code
File “/home/rftest/UWB/dragon/out/host/linux-x86/bin/build_image/build_image.py”, line 815, in
File “/home/rftest/UWB/dragon/out/host/linux-x86/bin/build_image/build_image.py”, line 807, in main
File “/home/rftest/UWB/dragon/out/host/linux-x86/bin/build_image/build_image.py”, line 434, in BuildImage
File “/home/rftest/UWB/dragon/out/host/linux-x86/bin/build_image/build_image.py”, line 345, in BuildImageMkfs
File “/home/rftest/UWB/dragon/out/host/linux-x86/bin/build_image/common.py”, line 281, in RunAndCheckOutput
common.ExternalError: Failed to run command ‘[‘mkuserimg_mke2fs’, ‘-s’, ‘/home/rftest/UWB/dragon/out/soong/.temp/tmp1JTV9N’, ‘out/target/product/db845c/obj/PACKAGING/systemimage_intermediates/system.img’, ‘ext4’, ‘/’, ‘1186566144’, ‘-j’, ‘0’, ‘-D’, ‘out/target/product/db845c/system’, ‘-L’, ‘/’, ‘-i’, ‘3214’, ‘-M’, ‘0’, ‘–inode_size’, ‘256’, ‘out/target/product/db845c/obj/ETC/file_contexts.bin_intermediates/file_contexts.bin’]’ (exit code 4):
10:50:18 mkuserimg_mke2fs.py INFO: Env: {‘MKE2FS_CONFIG’: ‘/home/rftest/UWB/dragon/out/soong/.temp/tmpMkEoFl’}
10:50:18 mkuserimg_mke2fs.py INFO: Running: mke2fs -O ^has_journal -L / -N 3214 -I 256 -M / -m 0 -E android_sparse -t ext4 -b 4096 out/target/product/db845c/obj/PACKAGING/systemimage_intermediates/system.img 289689
10:50:18 mkuserimg_mke2fs.py INFO: Env: {}
10:50:18 mkuserimg_mke2fs.py INFO: Running: e2fsdroid -p out/target/product/db845c/system -S out/target/product/db845c/obj/ETC/file_contexts.bin_intermediates/file_contexts.bin -f /home/rftest/UWB/dragon/out/soong/.temp/tmp1JTV9N -a / out/target/product/db845c/obj/PACKAGING/systemimage_intermediates/system.img
10:50:20 mkuserimg_mke2fs.py ERROR: Failed to run e2fsdroid_cmd: set_selinux_xattr: No such file or directory searching for label “/odm_dlkm”
e2fsdroid: No such file or directory while configuring the file system
I can not find any resolution to this error. I have made no modifications to the source tree - I simply pulled it using:
" repo init -u platform/manifest - Git at Google -b android-11.0.0_r4"
“repo sync -j8”
“build/envsetup.sh "
“lunch-db845c-userdebug”.
" make -j24”
I am using ubuntu 20.04.3 LTS
*** UPDATE 1/4/2022 ***
I solved this issue after viewing Android AOSP build failing in build_image.py for android-10.0.0_r39 - Stack Overflow
I added BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE := ext4
to my /home/dragon/device/linaro/dragonboard/db845c/BoardConfig.mk
then did a make clean and make -j24 for a successful build