Re: [android-building] Re: shared library can't be copied into OTATOOLS

2020-05-07 Thread 임정민
Thx that's what I wanted.
And I tried this but It returns build failed like below
--
[ 99% 161945/161958] Packaging Proguard obfuscation dictionary files.
[ 99% 161946/161958] Dist: out/dist/x-proguard-dict-ver.zip
[ 99% 161947/161958] Package target files: 
out/target/product/x/obj/PACKAGING/target_files_intermediates/x-target_files-ver
.zip
FAILED: 
out/target/product/x/obj/PACKAGING/target_files_intermediates/x-target_files-ver.zip
cp: 
out/target/product/x/obj/PACKAGING/target_files_intermediates/x-target_files-ver/OTA/tools//boot_signer:
 
Permission denied
cp: 
out/target/product/x/obj/PACKAGING/target_files_intermediates/x-target_files-ver/OTA/tools//brillo_update_payload:
 
Permission denied
cp: 
out/target/product/x/obj/PACKAGING/target_files_intermediates/x-target_files-ver/OTA/tools//mke2fs.conf:
 
Permission denied
--

I think some of the files doesn't have permission about copy.
do you have any idea?
What I modified was
  from $(hide) cp $(INTERNAL_OTATOOLS_FILES) $(zip_root)/OTA/tools/
  to   $(hide) cp $(INTERNAL_OTATOOLS_FILES) 
$(INTERNAL_OTATOOLS_PACKAGE_FILES) $(zip_root)/OTA/tools/
So above errors happen.
So I'm trying to changed it
  to   $(hide) cp $(INTERNAL_OTATOOLS_FILES) 
$(INTERNAL_OTATOOLS_PACKAGE_FILES) $(zip_root)/OTA/tools/ || true

But I'm not sure It's right way or not. 
As of now It works cause which files what I want were copied. but if those 
files will be blocked later about copy operation.
Is there anyway to detour cp permission error like change permissions?



2020년 5월 7일 목요일 오후 5시 8분 8초 UTC+9, Dan Willemsen 님의 말:
>
> Ah, yes, the (internal, unstable) INTERNAL_OTATOOLS_FILES variable has 
> changed meaning. Your local change to copy the files into OTA/tools 
> wouldn't be able to use that variable anymore.
>
> I think you'd need the contents of INTERNAL_OTATOOLS_PACKAGE_FILES before 
> the rest of the keys/etc get added to it, so maybe save it away in your own 
> variable directly after this line:
>
> INTERNAL_OTATOOLS_PACKAGE_FILES := \ 
> $(filter $(HOST_OUT)/%,$(call 
> module-installed-files,$(INTERNAL_OTATOOLS_MODULES_WITH_DEPS)))
>
> - Dan
>
> On Thu, May 7, 2020 at 12:41 AM 임정민 > 
> wrote:
>
>> I haven't been checking otatools.zip yet
>> but I'm pretty sure otatools.zip has lib already
>> What I want is shared library should be located in OTA/tools
>> When I checked the code, copy files only $(INTERNAL_OTATOOLS_FILES)
>> with this script "$(hide) cp $(INTERNAL_OTATOOLS_FILES) $(zip_root)
>> /OTA/tools/"
>> before R, shared library located in OTA/tools/ cause 
>> INTERNAL_OTATOOLS_FILES has shared library also.
>> but in R, INTERNAL_OTATOOLS_FILES doesn't have shared library
>> 4872 $(hide) cp $(INTERNAL_OTATOOLS_FILES) $(zip_root)/OTA/tools/
>>
>>
>> 2020년 5월 5일 화요일 오전 12시 49분 15초 UTC+9, 임정민 님의 말:
>>>
>>> Hi I found there are no shared library in ota packages.
>>>
>>> I expect there are some modules and shared libraries.
>>> but only existing were modules like lpunpack.
>>> I hope there are shared libraries such as libbase.so.
>>> but It's not working.
>>>
>>> I think get-all-shared-libs-deps is related with copying shared 
>>> libraries into ota_package. but It's not working
>>> please check it for me
>>>
>>> thanks
>>>
>>> !!
>>> /build/make/core/Makefile
>>> !
>>>
>>> ---
>>> INTERNAL_OTATOOLS_MODULES := \
>>>   aapt2 \
>>>   add_img_to_target_files \
>>>   append2simg \
>>>   avbtool \
>>>   blk_alloc_to_base_fs \
>>>   boot_signer \
>>>   brillo_update_payload \
>>>   brotli \
>>>   bsdiff \
>>>   build_image \
>>>   build_super_image \
>>>   build_verity_metadata \
>>>   build_verity_tree \
>>>   care_map_generator \
>>>   check_ota_package_signature \
>>>   check_target_files_signatures \
>>>   check_target_files_vintf \
>>>   checkvintf \
>>>   delta_generator \
>>>   e2fsck \
>>>   e2fsdroid \
>>>   fc_sort \
>>>   fec \
>>>   fs_config \
>>>   generate_verity_key \
>>>   img2simg \
>>>   img_from_target_files \
>>>   imgdiff \
>>>   libconscrypt_openjdk_jni \
>>>   lpmake \
>>>   lpunpack \
>>>   make_f2fs \
>>>   merge_target_files \
>>>   minigzip \
>>>   mk_combined_img \
>>>   mkbootfs \
>>>   mkbootimg \
>>>   mke2fs \
>>>   mke2fs.conf \
>>>   mkf2fsuserimg.sh \
>>>   mksquashfs \
>>>   mksquashfsimage.sh \
>>>   mkuserimg_mke2fs \
>>>   ota_from_target_files \
>>>   sefcontext_compile \
>>>   sgdisk \
>>>   shflags \
>>>   sign_apex \
>>>   sign_target_files_apks \
>>>   signapk \
>>>   simg2img \
>>>   sload_f2fs \
>>>   tune2fs \
>>>   unpack_bootimg \
>>>   update_host_simulator \
>>>   validate_target_files \
>>>   verity_signer \
>>>   verity_verifier \
>>>   zipalign \
>>>
>>> # Additional tools to unpack and repack the apex file.
>>> INTERNAL_OTATOOLS_MODULES += \
>>>   apexer \
>>>   deapexer \
>>>   debugfs_static \
>>>   merge_zips \
>>>   resize2fs \
>>>   soong_zip \
>>>
>>> ifeq 

Re: [android-building] Re: shared library can't be copied into OTATOOLS

2020-05-07 Thread 'Dan Willemsen' via Android Building
Ah, yes, the (internal, unstable) INTERNAL_OTATOOLS_FILES variable has
changed meaning. Your local change to copy the files into OTA/tools
wouldn't be able to use that variable anymore.

I think you'd need the contents of INTERNAL_OTATOOLS_PACKAGE_FILES before
the rest of the keys/etc get added to it, so maybe save it away in your own
variable directly after this line:

INTERNAL_OTATOOLS_PACKAGE_FILES := \
$(filter $(HOST_OUT)/%,$(call
module-installed-files,$(INTERNAL_OTATOOLS_MODULES_WITH_DEPS)))

- Dan

On Thu, May 7, 2020 at 12:41 AM 임정민  wrote:

> I haven't been checking otatools.zip yet
> but I'm pretty sure otatools.zip has lib already
> What I want is shared library should be located in OTA/tools
> When I checked the code, copy files only $(INTERNAL_OTATOOLS_FILES)
> with this script "$(hide) cp $(INTERNAL_OTATOOLS_FILES) $(zip_root)
> /OTA/tools/"
> before R, shared library located in OTA/tools/ cause
> INTERNAL_OTATOOLS_FILES has shared library also.
> but in R, INTERNAL_OTATOOLS_FILES doesn't have shared library
> 4872 $(hide) cp $(INTERNAL_OTATOOLS_FILES) $(zip_root)/OTA/tools/
>
>
> 2020년 5월 5일 화요일 오전 12시 49분 15초 UTC+9, 임정민 님의 말:
>>
>> Hi I found there are no shared library in ota packages.
>>
>> I expect there are some modules and shared libraries.
>> but only existing were modules like lpunpack.
>> I hope there are shared libraries such as libbase.so.
>> but It's not working.
>>
>> I think get-all-shared-libs-deps is related with copying shared libraries
>> into ota_package. but It's not working
>> please check it for me
>>
>> thanks
>>
>> !!
>> /build/make/core/Makefile
>> !
>>
>> ---
>> INTERNAL_OTATOOLS_MODULES := \
>>   aapt2 \
>>   add_img_to_target_files \
>>   append2simg \
>>   avbtool \
>>   blk_alloc_to_base_fs \
>>   boot_signer \
>>   brillo_update_payload \
>>   brotli \
>>   bsdiff \
>>   build_image \
>>   build_super_image \
>>   build_verity_metadata \
>>   build_verity_tree \
>>   care_map_generator \
>>   check_ota_package_signature \
>>   check_target_files_signatures \
>>   check_target_files_vintf \
>>   checkvintf \
>>   delta_generator \
>>   e2fsck \
>>   e2fsdroid \
>>   fc_sort \
>>   fec \
>>   fs_config \
>>   generate_verity_key \
>>   img2simg \
>>   img_from_target_files \
>>   imgdiff \
>>   libconscrypt_openjdk_jni \
>>   lpmake \
>>   lpunpack \
>>   make_f2fs \
>>   merge_target_files \
>>   minigzip \
>>   mk_combined_img \
>>   mkbootfs \
>>   mkbootimg \
>>   mke2fs \
>>   mke2fs.conf \
>>   mkf2fsuserimg.sh \
>>   mksquashfs \
>>   mksquashfsimage.sh \
>>   mkuserimg_mke2fs \
>>   ota_from_target_files \
>>   sefcontext_compile \
>>   sgdisk \
>>   shflags \
>>   sign_apex \
>>   sign_target_files_apks \
>>   signapk \
>>   simg2img \
>>   sload_f2fs \
>>   tune2fs \
>>   unpack_bootimg \
>>   update_host_simulator \
>>   validate_target_files \
>>   verity_signer \
>>   verity_verifier \
>>   zipalign \
>>
>> # Additional tools to unpack and repack the apex file.
>> INTERNAL_OTATOOLS_MODULES += \
>>   apexer \
>>   deapexer \
>>   debugfs_static \
>>   merge_zips \
>>   resize2fs \
>>   soong_zip \
>>
>> ifeq (true,$(PRODUCT_SUPPORTS_VBOOT))
>> INTERNAL_OTATOOLS_MODULES += \
>>   futility \
>>   vboot_signer
>> endif
>>
>> INTERNAL_OTATOOLS_FILES := \
>>   $(filter $(HOST_OUT)/%,$(call
>> module-installed-files,$(INTERNAL_OTATOOLS_MODULES)))
>>
>> .PHONY: otatools
>> otatools: $(INTERNAL_OTATOOLS_FILES)
>>
>> # For each module, recursively resolve its host shared library
>> dependencies. Then we have a full
>> # list of modules whose installed files need to be packed.
>>
>> INTERNAL_OTATOOLS_MODULES_WITH_DEPS := \
>>   $(sort $(INTERNAL_OTATOOLS_MODULES) \
>>   $(foreach m,$(INTERNAL_OTATOOLS_MODULES),$(call
>> get-all-shared-libs-deps,$(m
>>
>> INTERNAL_OTATOOLS_PACKAGE_FILES := \
>>   $(filter $(HOST_OUT)/%,$(call
>> module-installed-files,$(INTERNAL_OTATOOLS_MODULES_WITH_DEPS)))
>>
>> INTERNAL_OTATOOLS_PACKAGE_FILES += \
>>   $(sort $(shell find build/make/target/product/security -type f -name
>> "*.x509.pem" -o \
>>   -name "*.pk8" -o -name verity_key))
>>
>> ifneq (,$(wildcard device))
>> INTERNAL_OTATOOLS_PACKAGE_FILES += \
>>   $(sort $(shell find device $(wildcard vendor) -type f -name "*.pk8" -o
>> -name "verifiedboot*" -o \
>>   -name "*.pem" -o -name "oem*.prop" -o -name "*.avbpubkey"))
>> endif
>> ifneq (,$(wildcard external/avb))
>> INTERNAL_OTATOOLS_PACKAGE_FILES += \
>>   $(sort $(shell find external/avb/test/data -type f -name
>> "testkey_*.pem" -o \
>>   -name "atx_metadata.bin"))
>> endif
>> ifeq (true,$(PRODUCT_SUPPORTS_VBOOT))
>> INTERNAL_OTATOOLS_PACKAGE_FILES += \
>>   $(sort $(shell find external/vboot_reference/tests/devkeys -type f))
>> endif
>>
>> INTERNAL_OTATOOLS_RELEASETOOLS := \
>>   $(sort $(shell find build/make/tools/releasetools -name "*.pyc" -prune
>> -o \
>>   \( -type f -o -type l \) -print))
>>
>> BUILT_OTATOOLS_PACKAGE := 

[android-building] Re: shared library can't be copied into OTATOOLS

2020-05-07 Thread 임정민
I haven't been checking otatools.zip yet
but I'm pretty sure otatools.zip has lib already
What I want is shared library should be located in OTA/tools
When I checked the code, copy files only $(INTERNAL_OTATOOLS_FILES)
with this script "$(hide) cp $(INTERNAL_OTATOOLS_FILES) $(zip_root)
/OTA/tools/"
before R, shared library located in OTA/tools/ cause 
INTERNAL_OTATOOLS_FILES has shared library also.
but in R, INTERNAL_OTATOOLS_FILES doesn't have shared library
4872 $(hide) cp $(INTERNAL_OTATOOLS_FILES) $(zip_root)/OTA/tools/


2020년 5월 5일 화요일 오전 12시 49분 15초 UTC+9, 임정민 님의 말:
>
> Hi I found there are no shared library in ota packages.
>
> I expect there are some modules and shared libraries.
> but only existing were modules like lpunpack.
> I hope there are shared libraries such as libbase.so.
> but It's not working.
>
> I think get-all-shared-libs-deps is related with copying shared libraries 
> into ota_package. but It's not working
> please check it for me
>
> thanks
>
> !!
> /build/make/core/Makefile
> !
>
> ---
> INTERNAL_OTATOOLS_MODULES := \
>   aapt2 \
>   add_img_to_target_files \
>   append2simg \
>   avbtool \
>   blk_alloc_to_base_fs \
>   boot_signer \
>   brillo_update_payload \
>   brotli \
>   bsdiff \
>   build_image \
>   build_super_image \
>   build_verity_metadata \
>   build_verity_tree \
>   care_map_generator \
>   check_ota_package_signature \
>   check_target_files_signatures \
>   check_target_files_vintf \
>   checkvintf \
>   delta_generator \
>   e2fsck \
>   e2fsdroid \
>   fc_sort \
>   fec \
>   fs_config \
>   generate_verity_key \
>   img2simg \
>   img_from_target_files \
>   imgdiff \
>   libconscrypt_openjdk_jni \
>   lpmake \
>   lpunpack \
>   make_f2fs \
>   merge_target_files \
>   minigzip \
>   mk_combined_img \
>   mkbootfs \
>   mkbootimg \
>   mke2fs \
>   mke2fs.conf \
>   mkf2fsuserimg.sh \
>   mksquashfs \
>   mksquashfsimage.sh \
>   mkuserimg_mke2fs \
>   ota_from_target_files \
>   sefcontext_compile \
>   sgdisk \
>   shflags \
>   sign_apex \
>   sign_target_files_apks \
>   signapk \
>   simg2img \
>   sload_f2fs \
>   tune2fs \
>   unpack_bootimg \
>   update_host_simulator \
>   validate_target_files \
>   verity_signer \
>   verity_verifier \
>   zipalign \
>
> # Additional tools to unpack and repack the apex file.
> INTERNAL_OTATOOLS_MODULES += \
>   apexer \
>   deapexer \
>   debugfs_static \
>   merge_zips \
>   resize2fs \
>   soong_zip \
>
> ifeq (true,$(PRODUCT_SUPPORTS_VBOOT))
> INTERNAL_OTATOOLS_MODULES += \
>   futility \
>   vboot_signer
> endif
>
> INTERNAL_OTATOOLS_FILES := \
>   $(filter $(HOST_OUT)/%,$(call 
> module-installed-files,$(INTERNAL_OTATOOLS_MODULES)))
>
> .PHONY: otatools
> otatools: $(INTERNAL_OTATOOLS_FILES)
>
> # For each module, recursively resolve its host shared library 
> dependencies. Then we have a full
> # list of modules whose installed files need to be packed.
>
> INTERNAL_OTATOOLS_MODULES_WITH_DEPS := \
>   $(sort $(INTERNAL_OTATOOLS_MODULES) \
>   $(foreach m,$(INTERNAL_OTATOOLS_MODULES),$(call 
> get-all-shared-libs-deps,$(m
>
> INTERNAL_OTATOOLS_PACKAGE_FILES := \
>   $(filter $(HOST_OUT)/%,$(call 
> module-installed-files,$(INTERNAL_OTATOOLS_MODULES_WITH_DEPS)))
>
> INTERNAL_OTATOOLS_PACKAGE_FILES += \
>   $(sort $(shell find build/make/target/product/security -type f -name 
> "*.x509.pem" -o \
>   -name "*.pk8" -o -name verity_key))
>
> ifneq (,$(wildcard device))
> INTERNAL_OTATOOLS_PACKAGE_FILES += \
>   $(sort $(shell find device $(wildcard vendor) -type f -name "*.pk8" -o 
> -name "verifiedboot*" -o \
>   -name "*.pem" -o -name "oem*.prop" -o -name "*.avbpubkey"))
> endif
> ifneq (,$(wildcard external/avb))
> INTERNAL_OTATOOLS_PACKAGE_FILES += \
>   $(sort $(shell find external/avb/test/data -type f -name "testkey_*.pem" 
> -o \
>   -name "atx_metadata.bin"))
> endif
> ifeq (true,$(PRODUCT_SUPPORTS_VBOOT))
> INTERNAL_OTATOOLS_PACKAGE_FILES += \
>   $(sort $(shell find external/vboot_reference/tests/devkeys -type f))
> endif
>
> INTERNAL_OTATOOLS_RELEASETOOLS := \
>   $(sort $(shell find build/make/tools/releasetools -name "*.pyc" -prune 
> -o \
>   \( -type f -o -type l \) -print))
>
> BUILT_OTATOOLS_PACKAGE := $(PRODUCT_OUT)/otatools.zip
> $(BUILT_OTATOOLS_PACKAGE): PRIVATE_ZIP_ROOT := $(call 
> intermediates-dir-for,PACKAGING,otatools)/otatools
> $(BUILT_OTATOOLS_PACKAGE): PRIVATE_OTATOOLS_PACKAGE_FILES := 
> $(INTERNAL_OTATOOLS_PACKAGE_FILES)
> $(BUILT_OTATOOLS_PACKAGE): PRIVATE_OTATOOLS_RELEASETOOLS := 
> $(INTERNAL_OTATOOLS_RELEASETOOLS)
> $(BUILT_OTATOOLS_PACKAGE): $(INTERNAL_OTATOOLS_PACKAGE_FILES) 
> $(INTERNAL_OTATOOLS_RELEASETOOLS)
> $(BUILT_OTATOOLS_PACKAGE): $(SOONG_ZIP) $(ZIP2ZIP)
> @echo "Package OTA tools: $@"
> rm -rf $@ $(PRIVATE_ZIP_ROOT)
> mkdir -p $(dir $@)
> $(call 
> copy-files-with-structure,$(PRIVATE_OTATOOLS_PACKAGE_FILES),$(HOST_OUT)/,$(PRIVATE_ZIP_ROOT))
> $(call 
>