class_start main 执行了啥?

本文介绍了init.rc配置文件中的关键部分及其工作原理,特别是如何通过mount_all指令实现文件系统的挂载,并触发nonencrypted动作,进而启动系统的主要服务。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


init.rc中是import init.${hardware}.rc, 中定义

on fs
    mount_all /fstab.chipset
    mount pstore pstore /sys/fs/pstore
    setprop ro.crypto.fuse_sdcard true
	symlink /system/res /res
	symlink /system/bin /bin


mount_all对应于:

KEYWORD(mount_all,   COMMAND, 1, do_mount_all)


else if (ret == FS_MGR_MNTALL_DEV_NOT_ENCRYPTED || !enusure_data_mounted()) {
    /* @} */
        property_set("ro.crypto.state", "unencrypted");
        /* If fs_mgr determined this is an unencrypted device, then trigger
         * that action.
         */
        action_for_each_trigger("nonencrypted", action_add_queue_tail);
    }

mount_all里面会触发nonencrypted的action
on nonencrypted
     class_start main
     class_start late_start

只是加入action_queue的队列中:

之后在init的for(;;)中执行class_start main?


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值