title: What is the right way to add files to userdata.img in AOSP?
body: <p>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). </p>
  
  <p>By now, I use this way to realize it:</p>
  
  <p>1) Add "abc" folder to the root of AOSP source folder.</p>
  
  <p>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.</p>
  
  <p>3) make -j12</p>
  
  <p>4) fastboot -w flashall</p>
  
  <p>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. </p>
  
  <p>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?</p>