I need to copy a file from the external SDcard to a location in the root partition, during the boot process (from init), after /data is mounted. I used Carliv's tool to add the following line to init.rc but it looks like the external SDcard isn't mounted yet at that stage:

on post-fs-data
     copy /mnt/m_external_sd/file /file

It's Android 7. How can I do that? Thanks in advance.

  • Use some later trigger like on property:sys.boot_completed=1 instead of post-fs-data. It depends on when you need that file execactly in boot process. Or add wait command. But better is to place the file in initramfs permanently, if it isn't changed on every boot. – Irfan Latif Feb 14 '19 at 17:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.