Prerequisite/Background Info: After looking in the Android source code file listed below:
/system/core/init/firmware_handler.cpp
I can see a list of locations that the kernel can retrieve firmware files from, for example:
/etc/firmware/
/vendor/firmware/
/firmware/image/
Problem Statement: Since Android dynamically creates these directories after it boots up for the first time, when the file system initializes, there is no way to simply copy the firmware file into one of these directories before building the source code and generate a boot image that contains the firmware file. I would like the firmware file to be automatically copied onto the device when it is flashed with the boot image, instead of waiting for the device to boot up and then manually copying the firmware file onto the device.
Additional Info: While researching this issue, I read that a script which runs in user-space copies firmware files into the appropriate directory after Android boots up. However, I was unable to find such a script.
Is there a script that runs after Android boots up to copy firmware files into one of these dirctories? Or is there some config file that I need to add the firmware file to so that it will be copied into the boot image?