Chinaunix首页 | 论坛 | 博客
  • 博客访问: 822131
  • 博文数量: 210
  • 博客积分: 10002
  • 博客等级: 上将
  • 技术积分: 1840
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-18 09:56
文章分类

全部博文(210)

文章存档

2011年(1)

2010年(6)

2009年(65)

2008年(138)

我的朋友

分类: LINUX

2008-11-18 10:56:46

How to add permission for device node

By default, other than the devices listed in system/init/device.c, Android will set the device node permission as 600. It means only root can access the device. This will cause many trouble because most of the process runs as system account, not root.

Android notices this issue, so it supports a builtin command named "device" for init script file. The command format is:

device dev_node_name permission user_account group_account

For example, for ALSA device, we can set the permission as:

on early-init
       device /dev/pcmC0D0p 0666 root audio

The device command must be put in early-init action. Otherwise it won't work. Because init will first execute early-init action, then setup device node.



Manually create system.img in Android

You can do it like this to build system.img.

$cd device/out/host/linux-x86/bin
$./mkyaffs2image ../../../target/product/saar/system system.img -f

So that you can manually add more files into system.img.

阅读(534) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~