Where to edit init.rc?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Where to edit init.rc?

2,199 Views
Goi
Contributor II

Hi,

I'm working on an i.mx53qsb I wish to start up a native service in the device boot up process. I want to put it in the init.rc script, but I'm not sure where it resides. There seem to be init.rc files in multiple locations. Particularly, the following 2 look more likely:

src/device/fsl/imx53_loco/init.rc

src/system/core/rootdir/init.rc

The former has stuff like set permissions for IIM node, 3D acceleration property, fsl omx graphic manager media framework property, define the config for dual camera, set OpenGLES version, disable
UI output for 2nd display during video playback on boot, and mount ext4 partitions on fs.

The latter has stuff like setup the global environment, create mountpoints, backward compatibility, etc.

Which file should I be editing?

Thanks.

0 Kudos
Reply
2 Replies

1,498 Views
Goi
Contributor II

I've looked at the init.rc in the device's root directory and it's different from the init.rc in the source. Notably, the lines I've included are missing. Why is this so?

0 Kudos
Reply

1,498 Views
Goi
Contributor II

I've tried editing the init.rc in src/system/core/rootdir by adding the following line at the end, in the onboot section, together with vold, etc

service myprogram /data/myprogram

myprogram is an ARM binary that I wrote in C and built using the Android NDK. However, it doesn't seem to be called, as I don't see any output in logcat, which myprogram should output to. Also, it doesn't appear in the list of running processes when I run top either.

Do I need to do something special either when I write/build myprogram, or when I include it in init.rc?

Thanks.

0 Kudos
Reply