linux 在macos上构建AOSP时主机输出二进制文件丢失

31moq8wy  于 2022-11-22  发布在  Linux
关注(0)|答案(1)|浏览(431)

我正在macOS Monterey上用M1构建AOSP(12)。总体来说,它运行得很好(即使macOS没有官方支持,也能成功生成图像)。
然而,我也在linux机器上为相同的目标(只是rsync-ed文件)构建了相同的树,我看到了out/host/$platform/bin文件之间的区别。
以下是linux-x86的文件(129个文件):

aapt
aapt2
adb
add_img_to_target_files
aftltool
ahat
apex_compression_tool
apexer
apksigner
appcompat.sh
append2simg
aprotoc
assemble_vintf
atest-dev
avbtool
badblocks
bcc
bcc_strip_attr
bit
blk_alloc_to_base_fs
boot_signer
brillo_update_payload
brotli
bsdiff
BugReport
build_image
build_sepolicy
build_super_image
build_verity_metadata
build_verity_tree
care_map_generator
checkfc
check_ota_package_signature
check_partition_sizes
checkpolicy
checkseapp
check_target_files_signatures
check_target_files_vintf
checkvintf
conv_apex_manifest
conv_linker_config
deapexer
debugfs_static
defrag.f2fs
delta_generator
dexdiag
dexdump
dexlist
dump.f2fs
e2fsck
e2fsdroid
fastboot
fc_sort
fec
fec32
find_shareduid_violation
flags_health_check
fsck.f2fs
fs_config
generate_verity_key
host_init_verifier
hprof-conv
idmap2
img2simg
imgdiff
img_from_target_files
incident_report
insertkeys.py
ld.mc
lib
lpdump
lpmake
lpunpack
lz4
make_f2fs
make_f2fs_casefold
make_recovery_patch
mdnsd
merge_target_files
minigzip
mkbootfs
mkbootimg
mke2fs
mke2fs.conf
mkerofsimage.sh
mkf2fsuserimg.sh
mkfs.erofs
mksquashfs
mksquashfsimage.sh
mkuserimg_mke2fs
oatdump
ota_from_target_files
post_process_props
property_info_checker
repack_bootimg
resize2fs
resize.f2fs
secilc
sefcontext_compile
sepolicy-analyze
sepolicy_tests
sgdisk
sign_apex
signapk
sign_target_files_apks
simg2img
sload_f2fs
sqlite3
tinyplay
toybox
treble_sepolicy_tests
tune2fs
tzdatacheck
unpack_bootimg
unwind_info
unwind_reg_info
unwind_symbols
update_host_simulator
update-vndk-list.sh
validatekeymaps
validate_target_files
veridex
verity_signer
verity_verifier
version_policy
viewcompiler
vintffm
zipalign
zopflipng

下面是darwin-x86的文件(77个文件):

BugReport
aapt2
adb
aprotoc
assemble_vintf
atest-dev
avbtool
badblocks
bcc
bcc_strip_attr
bit
blk_alloc_to_base_fs
boot_signer
brotli
bsdiff
build_image
build_sepolicy
build_super_image
check_partition_sizes
checkfc
checkpolicy
checkseapp
checkvintf
conv_linker_config
deapexer
debugfs_static
defrag.f2fs
dump.f2fs
e2fsck
e2fsdroid
fastboot
fc_sort
fec
flags_health_check
fsck.f2fs
idmap2
imgdiff
incident_report
insertkeys.py
ld.mc
lpdump
lpmake
lz4
make_f2fs
make_f2fs_casefold
mdnsd
minigzip
mkbootfs
mkbootimg
mke2fs
mke2fs.conf
mkf2fsuserimg.sh
mkuserimg_mke2fs
post_process_props
property_info_checker
resize.f2fs
resize2fs
secilc
sefcontext_compile
sepolicy-analyze
sepolicy_tests
sgdisk
signapk
simg2img
sload_f2fs
sqlite3
toybox
treble_sepolicy_tests
tune2fs
tzdatacheck
unpack_bootimg
update-vndk-list.sh
validatekeymaps
version_policy
viewcompiler
vintffm
zopflipng

我在两台计算机上使用了相同的命令:mmma,然后是常规的make,以获得这些结果。
因此,make dist在Linux机器上运行良好,但在macOS机器上不运行,因为至少缺少host_init_verifier
能有什么错呢?

wa7juj8i

wa7juj8i1#

好吧,发现:
1.在darwin上禁用otatoolsbuild/make/core/Makefile)。
1.在darwin上也禁用host_init_verifier
build/core/definitions.mk

ifdef TARGET_BUILD_UNBUNDLED
# TODO (b/185624993): Remove the chck on TARGET_BUILD_UNBUNDLED when host_init_verifier can run
# without requiring the HIDL interface map.
$(2): $(1)
else ifneq ($(HOST_OS),darwin)
# Host init verifier doesn't exist on darwin.
$(2): \
    $(1) \
    $(HOST_INIT_VERIFIER) \
    $(call intermediates-dir-for,ETC,passwd_system)/passwd_system \
    $(call intermediates-dir-for,ETC,passwd_system_ext)/passwd_system_ext \
    $(call intermediates-dir-for,ETC,passwd_vendor)/passwd_vendor \
    $(call intermediates-dir-for,ETC,passwd_odm)/passwd_odm \
    $(call intermediates-dir-for,ETC,passwd_product)/passwd_product \
    $(call intermediates-dir-for,ETC,plat_property_contexts)/plat_property_contexts \
    $(call intermediates-dir-for,ETC,system_ext_property_contexts)/system_ext_property_contexts \
    $(call intermediates-dir-for,ETC,product_property_contexts)/product_property_contexts \
    $(call intermediates-dir-for,ETC,vendor_property_contexts)/vendor_property_contexts \
    $(call intermediates-dir-for,ETC,odm_property_contexts)/odm_property_contexts
    $(hide) $(HOST_INIT_VERIFIER) \
      -p $(call intermediates-dir-for,ETC,passwd_system)/passwd_system \
      -p $(call intermediates-dir-for,ETC,passwd_system_ext)/passwd_system_ext \
      -p $(call intermediates-dir-for,ETC,passwd_vendor)/passwd_vendor \
      -p $(call intermediates-dir-for,ETC,passwd_odm)/passwd_odm \
      -p $(call intermediates-dir-for,ETC,passwd_product)/passwd_product \
      --property-contexts=$(call intermediates-dir-for,ETC,plat_property_contexts)/plat_property_contexts \
      --property-contexts=$(call intermediates-dir-for,ETC,system_ext_property_contexts)/system_ext_property_contexts \
      --property-contexts=$(call intermediates-dir-for,ETC,product_property_contexts)/product_property_contexts \
      --property-contexts=$(call intermediates-dir-for,ETC,vendor_property_contexts)/vendor_property_contexts \
      --property-contexts=$(call intermediates-dir-for,ETC,odm_property_contexts)/odm_property_contexts \
      $$<
else
$(2): $(1)
endif
    @echo "Copy init script: $$@"
    $$(copy-file-to-target)
endef

相关问题