FFBM开关控制原理

下面这个流程,看上去很完美,

除了一点:在什么时候trigger ffbm的呢???

好吧,在其他博主的文章中找到答案了:

LA.UM.8.9/LINUX/android/system/core/init/init.cpp

    std::string bootmode = GetProperty("ro.bootmode", "");
    if (bootmode == "charger") {
        am.QueueEventTrigger("charger");
    } else if (bootmode == "ffbm-00") {

//add for ffbm

        am.QueueEventTrigger("ffbm");

    } else {
        am.QueueEventTrigger("late-init");
    }

 

 

 

1. 在UEFI的command line中添加相关的FfbmStr字串
FFBM对应ffbm-00
QMMI对应ffbm-02

2. UEFI将command line传送给内核

3. 内核解析command line

4. 内核根据FfbmStr设置系统属性
[ro.boot.mode]: [ffbm-00]
[ro.bootmode]: [ffbm-00]

5. 在init.qcom.factory.rc中根据bootmode启动相关的进程
on ffbm
    trigger early-fs
    trigger factory-fs
    trigger fs
    trigger post-fs
    trigger late-fs
    trigger post-fs-data
    trigger zygote-start
    trigger load_persist_props_action
    trigger firmware_mounts_complete
    trigger early-boot
    trigger boot
    trigger mmi

on factory-fs && property:ro.bootmode=ffbm-00
    mount tmpfs tmpfs /data
on mmi && property:ro.bootmode=ffbm-00
    mkdir /mnt/vendor/persist/FTM_AP 0750 system system
    start fastmmi
    start qcom-post-boot
    start mmi_diag
on property:persist.vendor.usb.config=* && property:ro.bootmode=ffbm-00
    setprop sys.usb.config ${persist.vendor.usb.config}


on factory-fs && property:ro.bootmode=ffbm-01
    mount tmpfs tmpfs /data
on mmi && property:ro.bootmode=ffbm-01
    mkdir /mnt/vendor/persist/FTM_AP 0750 system system
    start fastmmi
    start qcom-post-boot
    start mmi_diag
on property:persist.vendor.usb.config=* && property:ro.bootmode=ffbm-01
    setprop sys.usb.config ${persist.vendor.usb.config}

你可能感兴趣的:(FFBM开关控制原理)