Make persistent changes to init.rc

后端 未结 8 2090
没有蜡笔的小新
没有蜡笔的小新 2020-12-07 22:39

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

相关标签:
8条回答
  • 2020-12-07 23:24

    When an android system boots, uboot unpacks a special compressed ball of files in your boot partition called 'uRamdisk' to RAM, and defines those files to comprise the root directory of the system. uRamdisk normally contains a bunch of directories (system, data, media, etc.) that serve as mountpoints for partitions that contain the files that go in them, but also has some very basic files vital to your system, including the init binary and startup scripts like init.rc.

    when you edit the init.rc, you've actually just edited the unpackaged copy of init.rc that resides in your RAM. To really change it then, you have to copy your uRamdisk, extract it, edit the init.rc from there, repackage uRamdisk and then replace the new one with the old one in /boot.

    Try looking up the 'xuramdisk' and 'mkuramdisk' scripts, these make the process very simple.

    0 讨论(0)
  • 2020-12-07 23:30

    I don't know if you are still trying to do this but without knowing your exact device nobody can give you an exact answer.

    Try taking a dd image of all your internal partitions and use some scripts like those included with android kitchen on xda forums. Your recovery and boot partitions will both have a ram disk but odds are you want to modify the init.rc in the boot.img not recovery, unless you only want the changes present in recovery mode.

    The unyaffs thing doesn't apply to all devices and most devices have different partition layouts so you have to figure out which is boot and what type of fs it is. Maybe if you give your device specs you can get a better answer.

    0 讨论(0)
提交回复
热议问题