如何让A20,android开机自动启动C程序
来源:互联网 发布:vb.net format 编辑:程序博客网 时间:2024/05/21 15:39
/// xinit 增加: xinit /usr/local/bin/xfreerdp 192.168.1.196
1,修改 android/device/ init.sun7i.rc
........(略)
#add by jiangdou
chmod 777 /system/bin/hello
chmod 777 /system/bin/dou.sh
service init-setup /system/bin/dou.sh
class main
user root
group root
oneshot
........(略)
2,在device/softwinner/sugar-cubieboard2/新建dou.sh 文件,内容:
#! /system/bin/sh
#hello是C编译的文件,是静态编译,,放在system/bin/
/system/bin/hello
#or
hello
echo "jiangdou"
exit
3,vi device/softwinner/sugar-cubieboard2/sugar_cubieboard2.mk ///目的是执行make -j48 复制到out/target/product/sugar-cubieboard2/system/bin/
........(略)
#add by jiangdou
PRODUCT_COPY_FILES += \
device/softwinner/sugar-cubieboard2/hello:system/bin/hello \
device/softwinner/sugar-cubieboard2/dou.sh:system/bin/dou.sh
........(略)
4,开机,,效果
root@android:/ # ps | busybox grep hello
root 1409 1 652 108 c006bf0c 0001090c S /system/bin/hello
root 1411 1 652 108 c006bf0c 0001090c S hello
root@android:/ #
证明开机自动运行了
5, C代码内容,,,,编译$ arm-linux-androideabi-gcc -o hello hello.c -static
#include<stdio.h>#include <signal.h>int main(void){ int i; signal(SIGCHLD, SIG_IGN); daemon(0, 0);//fork 强制后台运行! // for(i = 0; i < 10; i++) while(1) { sleep(1); printf("hello......by jiangdou\n"); } return 0;}
adb push xxx /system ---->ERROR "Readonly-----file system"
adb shell && mount -o remount -o rw /system
- 如何让A20,android开机自动启动C程序
- (转)如何让A20,android开机自动启动C程序
- 如何让程序随开机自动启动
- 如何让程序开机自动启动
- 让程序开机自动启动
- 在Linux系统如何让程序开机时自动启动
- 在Linux系统如何让程序开机时自动启动
- 如何让自己的程序在开机时自动启动
- 如何让android开机后自动运行自己的程序
- Android开发之如何让程序开机启动
- android程序开机自动启动
- Android开机自动启动程序
- android开机自动启动程序
- android 开机自动启动程序
- 如何让程序能够开机自动运行
- 如何让程序能够开机自动运行
- 如何让程序能够开机自动运行??
- Android 让一个Service开机自动启动
- rz -bey
- android布局技巧:创建高效布局
- C++ STL编程轻松入门
- mou——编写markdown文件神器
- C/C++时间函数time/localtime/mktime/ctime/strftime使用方法
- 如何让A20,android开机自动启动C程序
- java 实现支持多线程的单件模式
- mysql触发器的三个示例
- Oracle数据库性能优化指南
- ubuntu下JLink的配置步骤和Can not connect to J-Link via USB的解决
- 通过KFED查看ASM卷信息
- UICollectionView
- 基于Boost::asio库的网络编程实现基础
- 老生常谈 排序算法---快速排序