3

I'm working on a Freescale i.mx53 board with Android 2.3.3, and I'm trying to add my own android native service into init.rc so that it runs on boot. I've tried following the guide at http://www.androidenea.com/2009/08/init-process-and-initrc.html, including their example service code. However, I'm building the example service code into an ARM binary with android ndk instead.

The example service works if I run it manually in an adb shell. However, when I put it at the end of src/system/core/rootdir/init.rc nothing seems to happen.

I look at the init.rc in the device root directory after booting up and it isn't the same as the init.rc in the source. Notably, the lines that I've added in aren't there.

What could be wrong?

4

2 回答 2

5

This cannot be done from shell. init.rc is part of ramdisk and not system partition. So at bootup, the init.rc picked up will be from ramdisk. So whatever changes you do to init.rc will not get reflected.

AFAIK Only way is to build the ROM and reflash

Check this post, it is related, might help

于 2012-09-04T03:01:20.097 回答
0

when you are using emulator, add option "-ramdisk out/target/.../ramdisk.img" and the init.rc on the emulator will use the customized version. And in my case, you also need to add "class " in the option.

于 2013-02-13T00:24:13.713 回答