设为首页 加入收藏

TOP

Android启动脚本init.rc(三)
2014-11-24 03:29:32 来源: 作者: 【 】 浏览:3
Tags:Android 启动 脚本 init.rc
e insight into
what it's doing:


init.action
Equal to the name of the action currently being executed or "" if none


init.command
Equal to the command being executed or "" if none.


init.svc.
State of a named service ("stopped", "running", "restarting")



Example init.conf
-----------------


# not complete -- just providing some examples of usage
#
on boot
export PATH /sbin:/system/sbin:/system/bin
export LD_LIBRARY_PATH /system/lib


mkdir /dev
mkdir /proc
mkdir /sys


mount tmpfs tmpfs /dev
mkdir /dev/pts
mkdir /dev/socket
mount devpts devpts /dev/pts
mount proc proc /proc
mount sysfs sysfs /sys


write /proc/cpu/alignment 4


ifup lo


hostname localhost
domainname localhost


mount yaffs2 mtd@system /system
mount yaffs2 mtd@userdata /data


import /system/etc/init.conf


class_start default


service adbd /sbin/adbd
user adb
group adb


service usbd /system/bin/usbd -r
user usbd
group usbd
socket usbd 666


service zygote /system/bin/app_process -Xzygote /system/bin --zygote
socket zygote 666


service runtime /system/bin/runtime
user system
group system


on device-added-/dev/compass
start akmd


on device-removed-/dev/compass
stop akmd


service akmd /sbin/akmd
disabled
user akmd
group akmd


Debugging notes
---------------
By default, programs executed by init will drop stdout and stderr into
/dev/null. To help with debugging, you can execute your program via the
Andoird program logwrapper. This will redirect stdout/stderr into the
Android logging system (accessed via logcat).


For example
service akmd /system/bin/logwrapper /sbin/akmd


首页 上一页 1 2 3 下一页 尾页 3/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇为Android内核添加新驱动并添加到.. 下一篇Linux内核通用链表 <linux/lis..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·工业机器人TCP校准中 (2025-12-25 05:19:17)
·opc 通讯协议与 TCP (2025-12-25 05:19:15)
·labview中tcp/ip通信 (2025-12-25 05:19:13)
·新书介绍《Python数 (2025-12-25 04:49:47)
·怎么利用 Python 进 (2025-12-25 04:49:45)