Make persistent changes to init.rc

4,271 views
Skip to first unread message

gdxflm

unread,
Mar 19, 2012, 6:00:51 AM3/19/12
to android-platform
I want to change the init.rc file of an android pad. But after I
change it and reboot the system, the original init.rc comes back.

How can I make the change to the init.rc persistently without rebuild
the system (since I don't have the source code of the system)? Or is
there any way to work around?

Thanks in advance.

Bryan Buckley

unread,
Mar 19, 2012, 2:47:46 PM3/19/12
to android-...@googlegroups.com, gdx...@gmail.com
adb shell mount -w -o remount -t rootfs /
adb push init.thisone.rc /
adb shell sync
adb reboot

should work.

--
Bryan Buckley
Personal Website Google Profile Twitter


--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-...@googlegroups.com.
To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.


Pavan Savoy

unread,
Mar 19, 2012, 2:51:34 PM3/19/12
to android-...@googlegroups.com, gdx...@gmail.com
On Mon, Mar 19, 2012 at 1:47 PM, Bryan Buckley <bryanw...@gmail.com> wrote:
adb shell mount -w -o remount -t rootfs /
adb push init.thisone.rc /
adb shell sync
adb reboot

should work.


It should if the "/" is mounted as say ext4 or similar.
but might not always - really depends on the way system is booting.
If the root "/" is part of the ramdisk.img - then you will have to extract the ramdisk - using the cpio - make modifications & pack it back using mkbootfs & minizip.
 
--
Bryan Buckley
Personal Website Google Profile Twitter


On Mon, Mar 19, 2012 at 5:00 AM, gdxflm <gdx...@gmail.com> wrote:
I want to change the init.rc file of an android pad. But after I
change it and reboot the system, the original init.rc comes back.

How can I make the change to the init.rc persistently without rebuild
the system (since I don't have the source code of the system)? Or is
there any way to work around?

Thanks in advance.

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-...@googlegroups.com.
To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.


--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-...@googlegroups.com.
To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.



--
--Pavan Savoy

gdxflm

unread,
Mar 19, 2012, 10:10:45 PM3/19/12
to android-platform
thanks to your suggestion. But it did not work.

I have tried push a new init.rc or other file into the / directory,
but after reboot, all new added files were gone. It seems like a
recovery image was used to be mounted to / when reboot.

Garry Zhang

On Mar 20, 2:47 am, Bryan Buckley <bryanwbuck...@gmail.com> wrote:
> adb shell mount -w -o remount -t rootfs /
> adb push init.thisone.rc /
> adb shell sync
> adb reboot
>
> should work.
>
> --
> Bryan Buckley <http://www.bryanwbuckley.com/>
>  [image: Personal Website] <http://www.bryanwbuckley.com/> [image: Google
> Profile] <http://www.google.com/profiles/BryanWBuckley#about> [image:
> Twitter] <http://twitter.com/bryanbuckley>

gdxflm

unread,
Mar 19, 2012, 10:17:38 PM3/19/12
to android-platform
It may like what you said, a recovery image may be used during boot. I
tried extract recovery image following the tips here:
http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack%2C_Edit%2C_and_Re-Pack_Boot_Images

but the recovery img file cannot be unpacked with error:"broken image
file".

Now I cannot go further. Is there any suggestion? thanks.

Garry Zhang

On Mar 20, 2:51 am, Pavan Savoy <pavan.sa...@gmail.com> wrote:
> On Mon, Mar 19, 2012 at 1:47 PM, Bryan Buckley <bryanwbuck...@gmail.com>wrote:
>
> > adb shell mount -w -o remount -t rootfs /
> > adb push init.thisone.rc /
> > adb shell sync
> > adb reboot
>
> > should work.
>
> It should if the "/" is mounted as say ext4 or similar.
> but might not always - really depends on the way system is booting.
> If the root "/" is part of the ramdisk.img - then you will have to extract
> the ramdisk - using the cpio - make modifications & pack it back using
> mkbootfs & minizip.
>
>
>
>
>
>
>
>
>
> > --
> > Bryan Buckley <http://www.bryanwbuckley.com/>
> >  [image: Personal Website] <http://www.bryanwbuckley.com/> [image: Google
> > Profile] <http://www.google.com/profiles/BryanWBuckley#about> [image:
> > Twitter] <http://twitter.com/bryanbuckley>
>

paxchristos

unread,
Mar 20, 2012, 9:52:00 AM3/20/12
to android-platform
Don't worry about recovery.img, you need to change boot.img

On Mar 19, 10:17 pm, gdxflm <gdx...@gmail.com> wrote:
> It may like what you said, a recovery image may be used during boot. I
> tried extract recovery image following the tips here:http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack%2C_Edit%2C_...

gdxflm

unread,
Mar 21, 2012, 12:56:56 AM3/21/12
to android-platform
The problem is not changing boot.img or recovery.img. How to find or
extract the right img file is the problem. Using the method in above
link to obtain the boot.img, it cannot be unpacked. And it seems this
may not be the right img I want, since I check it with hex editot,
most of the hex data are FF, and I cannot find the head section in the
img file.
Reply all
Reply to author
Forward
0 new messages