Open the Android kernel init.d detailed tutorial, the script starts automatically

Note: Because there are too many Android models, it cannot be guaranteed that all models are compatible, please test by yourself.

Open the init.d script to start automatically. We need to process the kernel to achieve the effect. Please be sure to follow the tutorial carefully. If there are any omissions in the tutorial, please join the ROM production tool exchange group or Baidu to fill in the gaps.

Preparation tool: download and install notepad++

Click me to download for 32-bit system 

 Click me to download for 64-bit system 

After installation, select any file and click the right mouse button, and the Edit with Notepad++ option will appear in the menu bar, indicating that the installation is successful

1. Unpack boot.img

Unpack boot.img with the ROM creation tool, and open the directory where the kernel is located

2. Add self-starting code to the kernel

1. Download the init.d script load, and copy the load to the disk:\RomTool\RomManager\RomUnzip\boot_\ramdisk\sbin\ directory. Click me to download the load file

2. Add load permission

2.1 Enter the disk:\RomTool\RomManager\RomUnzip\boot_\ramdisk to find  the cpiolist.dat  file, right-click and select "Edit with Notepad++" to edit this file, add 33256 sbin/load under the adbd option and save

2.2 Find  the init.rc  file, right-click and select "Edit with Notepad++" to edit this file, add the following code to any segment, and save it.

service flash_load /sbin/load
    class main
    user root
    oneshot
 

2.3 Turn on the kernel tolerance mode (this mode may lead to not booting, if not booting, cancel this option)

Enter the disk:\RomTool\RomManager\RomUnzip\boot_ directory, find  the bootinfo.dat  file, right-click and select "Edit with Notepad++" to edit this file, copy and add the following code at the end of the cmdline= line (there is a space before the code), and then save

 androidboot.selinux=permissive

After the above operations are completed, package the kernel, and create an init.d folder in the flash package system/etc/ directory, and put the built-in self-starting script here. Finally, for the flash test, it is recommended to use the root privilege of the flash package kernel with this script.

Guess you like

Origin blog.csdn.net/z920981023/article/details/125168605