J.Churchill J.Churchill - 1 year ago 110
Android Question

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

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_SRC := helloworld.c

include $(CLEAR_VARS)
LOCAL_MODULE := myscript.sh
LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/helloscripts

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?

Answer Source

System image filesytem modifications you can change in this file:


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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download