Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Modifying init.rc to add my own android native service

Tags:

android

init

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?

like image 984
user1118764 Avatar asked Dec 04 '25 12:12

user1118764


1 Answers

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

like image 168
nandeesh Avatar answered Dec 06 '25 06:12

nandeesh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!