user3848844
user3848844

Reputation: 519

android 'userdata' partition mounting in the source code

I'm looking at android's source code and i'm trying to add file to the data partition in build time. For that i need to add file to the userdata partition.

Moreover, i need to find where the the permissions for the files in the data directory are determined, in order to give the file the permissions i want.

For that i need to see where in the source code is the userdata partition mounted, because i guess that the permissions are given there as well.

I've looked at init.rc but the only thing i saw is:

mkdir /data 0771 system system

But there doesn't seem to be any mount for user data..

Does someone knows where does this happen?

Upvotes: 1

Views: 1160

Answers (1)

SudoSURoot
SudoSURoot

Reputation: 443

You can just use PRODUCT_COPY_FILES for example:

PRODUCT_COPY_FILES += device/repo/your_file.so:data/folder/your_file.so

...plenty of examples here, in my device repo... just copy it to data though, instead of system: https://github.com/sudosurootdev/device_lge_g2-common/blob/kk44/g2.mk

More examples: https://github.com/sudosurootdev/vendor_lge/blob/kk44/ls980/ls980-vendor-blobs.mk

NOTE: Just don't add it to an Android.mk file. Use another *.mk file either under an Android.mk which calls all subdir makefiles or call the file specifically from another:

include device/repo/your_file.mk

Now, if it needs it's own directory under data, you will want to add it in the init.rc like you posted.

Upvotes: 1

Related Questions