http://blog.csdn.net/jumper511/article/details/28856249
After modifying the Android Init.rc file, you need to upload the modified file to the phone, but the following questions are sent
D:\TEST>ADB Push init.rc/
Failed to copy ' init.rc ' to '//init.rc ': Read-only file system
The solution is as follows
D:\TEST>ADB Root
ADBD is already running as root
D:\TEST>ADB remount
Remount succeeded
D:\TEST>ADB Shell
[Email protected]:/# mount-o remount RW/
Mount-o remount RW/
[Email protected]:/# ^c
D:\TEST>ADB Push init.rc/
1507 kb/s (20059 bytes in 0.012s)
Upload success, but do not be happy too early, after the system restarts, found that init.rc has been restored to the original, the modification did not take effect, because (the following content from the forum http://bbs.csdn.net/topics/390474471?page=1)
Init.rc is a file in Rootfs, Android will Rootfs (INITRAMFS) link to the Linux kernel image, generate a normal start boot.img, recovery mode of recovery.img.
Android every time reboot bootloader to load boot.img into RAM, part of it is the real Linux kernel image (Zimage), the other part is Initramfs (including Init, Init.rc, etc).
After that, the Linux kernel initializes the Initramfs with the Rootfs type mount to/.
In order for Android to start an app or script automatically after booting the Linux kernel, you can modify the following file
Device/qcom/msm8974/init.target.rc, then recompile the android system, download boot.img
For example, to automatically run the Poweronoff Linux program after Android startup, you can add the following code in INIT.TARGET.RC
Service Poweronoff/system/bin/poweronoff
Class Main
Group Root
User root
ADB push init.rc/