Make persistent changes to init.rc

后端 未结 8 2091
没有蜡笔的小新
没有蜡笔的小新 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.

提交回复
热议问题