ADB push init.rc/

Source: Internet
Author: User

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/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.