how PRODUCT_COPY_FILES works

2,598 views
Skip to first unread message

nguyenvuthiennga

unread,
Mar 8, 2010, 8:33:35 AM3/8/10
to android-platform
Hi all,

I try to push a file into Android image. I have a look at some make
files (.mk) (e.g. frameworks/base/data/sounds/OriginalAudio.mk, vendor/
htc/common-open/akmd/Android.mk) and I see they use PRODUCT_COPY_FILES
variable specify which file they want to push in Android image. I try
to imitate and put in vendor/aosp/products/aosp_core.mk. However it
doesn't work.

Did anyone try this before?

Nga

nguyenvuthiennga

unread,
Mar 8, 2010, 9:25:41 AM3/8/10
to android-platform
I saw my file in out/target/product/sapphire-open/installed-files.txt
but when I boot Android, I didn't see the file. The folder is empty.

Can anyone help me out?

On Mar 8, 2:33 pm, nguyenvuthiennga <nguyenvuthien...@gmail.com>
wrote:

nguyenvuthiennga

unread,
Mar 8, 2010, 10:10:49 AM3/8/10
to android-platform
It turns out that I can copy file to /system/... but can not copy to /
data/...
If I put my file to /system/... then I can not write on the file
later.

On Mar 8, 3:25 pm, nguyenvuthiennga <nguyenvuthien...@gmail.com>
wrote:

Christopher Tate

unread,
Mar 8, 2010, 10:48:26 AM3/8/10
to android-...@googlegroups.com
When the device has booted, /system is mounted read-only. You cannot
expect to ever be able to write to anything on that partition during
runtime.

--
chris tate
android framework engineer

> --
> You received this message because you are subscribed to the Google Groups "android-platform" group.
> To post to this group, send email to android-...@googlegroups.com.
> To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.
>
>

nguyenvuthiennga

unread,
Mar 8, 2010, 11:29:14 AM3/8/10
to android-platform
Thanks for your reply.

Then, how can I copy files to /data/...?
To be more clear, I don't want to copy to application's area since my
file will be used by the system services. I wonder if I can copy files
to /data/system?

Another way is to create directory /data/my_directory/ and copy my
file to it. I can create the directory by modifying init.rc. However,
I can not use PRODUCT_COPY_FILES to there.

On Mar 8, 4:48 pm, Christopher Tate <ct...@google.com> wrote:
> When the device has booted, /system is mounted read-only.  You cannot
> expect to ever be able to write to anything on that partition during
> runtime.
>
> --
> chris tate
> android framework engineer
>
> On Mon, Mar 8, 2010 at 7:10 AM, nguyenvuthiennga
>

Dianne Hackborn

unread,
Mar 9, 2010, 9:41:01 PM3/9/10
to android-...@googlegroups.com
Generally you don't want to put your built output on the data partition, because if the user does a factory reset of their device whatever you put there will be lost forever.
--
Dianne Hackborn
Android framework engineer
hac...@android.com

Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails.  All such questions should be posted on public forums, where I and others can see and answer them.

Reply all
Reply to author
Forward
0 new messages