I am developing a ROM based on AOSP 5.1.0 source code. I want to add a folder "abc" (it contains some files) to the source code and compile the folder into the "/data/abc" path in the device (Nexus 5).
By now, I use this way to realize it:
1) Add "abc" folder to the root of AOSP source folder.
2) Add an application in /packages/apps/TestApp, in TestApp's Android.mk file, add "$(shell cp -rf $(LOCAL_PATH)/../../../abc/ $(TARGET_OUT_DATA)/abc/)" behind the “include $(CLEAR_VARS)”. $(TARGET_OUT_DATA) seems to mean the "/data/" path in device.
3) make -j12
4) fastboot -w flashall
The above way indeed did the job, but in "out\target\product\hammerhead\data\abc", there is also a "abc" folder in "abc", this is so werid and I don't know what happened. And after I flash the images by "fastboot -w flashall", The "/data/abc" folder lacks many files in Nexus 5.
I don't know if execute "shell cp" in an app's Android.mk is the right way to add a folder to userdata.img, and if not, what's the correct way?