I want to start a script upon boot of android and therefore I modified init.rc to include my init.additional.rc script (I use my own script, because potentially there will be more things to start and I want to keep them seperate).
In init.rc, I add
import /init.additional.rc
Building init.additional.rc into the root directory works, init.additional.rc only contains a comment right now.
However, as soon as I add the import statement to init.rc, build the whole system and flash the images, the board does not boot anymore (it does not reach the boot animation).
Furthermore, removing the import, deleting the generated images and rebuilding the system does not bring it back to life. The only thing that works is clearing the out directory and rebuilding the whole system from scratch.
As far as I understand it, the root directory is part of the ramdisk.img, which itself is part of the boot.img and is flashed by fastboot flash boot boot.img
. Is that correct?
Is there anything I am missing?
Interestingly, only adding a comment to init.rc directly works as expected. android still boots and the root directory contains the correct init.rc including the comment. But as soon as I add a service definition to init.rc, it hangs during boot, again.