How do I preserve file permissions in a custom external project added to Android AOSP?

空扰寡人 提交于 2019-12-06 06:41:20

问题


I've downloaded (using repo) the Android 4.0 OS source code (from here - http://source.android.com/). I'm trying to add a new external project (in external/ for example external/libhelloworld) to the build system so that it is built into the system image. In that project I would like to deploy a shell script and have it keep it's permissions which are rwxr-xr-x but when I build it and load the emulator I see the file permissions have been changed to rw-r--r--. I am deploying the script to /etc. My Android.mk file looks like this

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS) LOCAL_MODULE := libhelloworld LOCAL_MODULE_TAGS := optional LOCAL_MODULE_SRC := helloworld.c include $(BUILD_SHARED_LIBRARY)

include $(CLEAR_VARS) LOCAL_MODULE := myscript.sh LOCAL_MODULE_TAGS := optional LOCAL_MODULE_SRC := $(LOCAL_MODULE) LOCAL_MODULE_CLASS := EXECUTABLES LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/helloscripts include $(BUILD_PREBUILT)

I see the script permissions are preserved when it is copied into the intermediates area but then the permissions are changed at some point after that in the build process. Any idea why the script permissions are not being preserved when it gets added into the system image? Is there something I'm missing from my Android.mk?


回答1:


System image filesytem modifications you can change in this file:

system/core/include/private/android_filesystem_config.h

Try to change permissions there. If you have problems, please, post here.



来源:https://stackoverflow.com/questions/10878369/how-do-i-preserve-file-permissions-in-a-custom-external-project-added-to-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!