如何在添加到Android AOSP的自定义外部项目中保留文件权限? [英] How do I preserve file permissions in a custom external project added to Android AOSP?

查看:86
本文介绍了如何在添加到Android AOSP的自定义外部项目中保留文件权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经下载(使用回购)Android 4.0 OS源代码(从此处- http://source.android .com/).我正在尝试向构建系统添加一个新的外部项目(在external/例如external/libhelloworld中),以便将其内置到系统映像中.在该项目中,我想部署一个shell脚本并使其具有rwxr-xr-x的权限,但是当我构建它并加载模拟器时,我看到文件权限已更改为rw-r--r-- .我正在将脚本部署到/etc.我的Android.mk文件看起来像这样

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:= $(调用my-dir)

LOCAL_PATH := $(call my-dir)

包括$(CLEAR_VARS) LOCAL_MODULE:= libhelloworld LOCAL_MODULE_TAGS:=可选 LOCAL_MODULE_SRC:= helloworld.c 包括$(BUILD_SHARED_LIBRARY)

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

包括$(CLEAR_VARS) LOCAL_MODULE:= myscript.sh LOCAL_MODULE_TAGS:=可选 LOCAL_MODULE_SRC:= $(LOCAL_MODULE) LOCAL_MODULE_CLASS:=执行 LOCAL_MODULE_PATH:= $(TARGET_OUT)/etc/helloscripts 包括$(BUILD_PREBUILT)

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)

我看到将脚本权限复制到中间区域时会保留下来,但是之后在构建过程中的某个时候更改了权限.知道为什么将脚本权限添加到系统映像后不保留脚本权限吗?我的Android.mk中缺少什么吗?

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?

推荐答案

您可以在此文件中更改的系统映像文件系统修改:

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.

这篇关于如何在添加到Android AOSP的自定义外部项目中保留文件权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆