[Android Basics] - ueventd.rc handles hardware device permissions and android init analysis

ueventd.rc handles access rights to hardware devices

ueventd.rc:

/dev/null                 0666   root       root
/dev/zero                 0666   root       root
/dev/full                 0666   root       root
/dev/ptmx                 0666   root       root
/dev/tty                  0666   root       root
/dev/random               0666   root       root
/dev/urandom              0666   root       root
/dev/ashmem               0666   root       root
/dev/binder               0666   root       root

 ...                                  ...           ...             ...

There is a very important file Android.mk in each directory of Android, which is responsible for compiling the code in this directory.

system/core/init/android.mk will generate an executable program called init, which will be placed under /, and a symbolic link /sbin/eventd will be generated at the same time, pointing to /init.

Init is a script interpreter, it will parse two files under the target system: /init.rc, /init.xxx.rc (xxx represents the platform name).

Init started a process of its own when parsing the script, but the process name was changed to ueventd. As the name suggests, ueventd should be the daemon that receives uevent. Its main function here is to create or delete /dev/xxx (xxx device name) according to uevent. We know the interface mknod for creating device nodes under Linux, let’s follow up and take a look at this interface Where is it called.

ueventd has two scripts that need to be parsed, ueventd.rc and ueventd.xxx.rc scripts, which allow customers to set the permissions of the /dev or /sys directory and subdirectories .

 

 

Guess you like

Origin blog.csdn.net/u014674293/article/details/105858436