天天看點

Android裝置開機日志分析

本部落格參考下面2017年的部落格,分段分析android P的開機日志,并加點相關備注

https://blog.csdn.net/RadianceBlau/article/details/78416776.

MP部分是不管的,有興趣可以看看包括MP的啟動流程

https://blog.csdn.net/superjaingchao/article/details/82223938.

下篇是android啟動流程系列,比較贊,有描述aboot和kernel的程式入口彙編代碼,看完還想了解aboot與boot的反彙編可以再看看android鏡像分析

https://www.jianshu.com/p/657336b545bd.

某方案商各個分區作用,但是沒有描述較新的vbmeta和dtbo分區(更新的是android Q的super動态分區,這裡不涉及)

https://blog.csdn.net/q921374795/article/details/88558271.

下面是P的啟動日志,格式盡量參照第一篇部落格。紅色部分是PBL log,綠色部分是sbl1 log,紫色部分為lk log,藍色部分是kernel 啟動log,深藍色部分init啟動階段log。日志展現很多内容,android的模式有緊急下載下傳模式,fastboot刷機模式,recovery/system模式;安全相關的會有Secure boot,verify boot,DM-verity,防止復原,SELinux;一些裝置硬體資訊。這些日志内容中有加“//***”備注。

Format: Log Type - Time(microsec) - Message - Optional Info

Log Type: B - Since Boot(Power On Reset), D - Delta, S - Statistic

S - QC_IMAGE_VERSION_STRING=BOOT.BF.3.3.2-00075

S - IMAGE_VARIANT_STRING=JAAIANAZA

S - OEM_IMAGE_VERSION_STRING=mp-server

S - Secure Boot: Off                                                                                                //Secure Boot開關資訊

S - JTAG ID @ 0x000a4120 = 0x5480009a                                                            //裝置闆級資訊

S - Serial Number @ 0x000a4128 = 0xf5936e5c

S - OEM Config Row 0 @ 0x000a4150 = 0x000000002c000000

S - OEM Config Row 1 @ 0x000a4158 = 0x0000000000000000

S - Feature Config Row 0 @ 0x000a4160 = 0x0107a04000100100

S - Feature Config Row 1 @ 0x000a4168 = 0x02c2f80305000805

S - Boot Config, 0x000000e1

B - 269 - PBL, Start

B - 3144 - bootable_media_detect_entry, Start

B - 44017 - bootable_media_detect_success, Start

B - 44023 - elf_loader_entry, Start

B - 45627 - auth_hash_seg_entry, Start

B - 45920 - auth_hash_seg_exit, Start

B - 80241 - elf_segs_hash_verify_entry, Start

B - 231894 - PBL, End

B - 242536 - SBL1, Start

B - 326990 - pm_device_init, Start

B - 330071 - BOOT_DUMP: PMi8950_PON_FSM =0x20895 :DATA=0x9 

B - 332602 - PON REASON: PM0=0x200000020 PM1=0x200000020 

B - 337818 - pm_sbl_pre_config:Done

B - 361669 - PM_SET_VAL:Skip

D - 36081 - pm_device_init, Delta

B - 363133 - usb: hs_phy_nondrive_start                //虛拟出9006端口(用于裝置dump)

B - 365847 - usb: hs_phy_nondrive_finish

B - 369294 - boot_flash_init, Start

D - 0 - boot_flash_init, Delta

B - 376278 - boot_config_data_table_init, Start

D - 5093 - boot_config_data_table_init, Delta - (0 Bytes)

B - 386191 - CDT version:3,Platform ID:8,Major ID:1,Minor ID:0,Subtype:0

B - 393175 - sbl1_ddr_set_params, Start

B - 397476 - cpr_init, Start

D - 1128 - cpr_init, Delta

B - 402508 - Pre_DDR_clock_init, Start

D - 213 - Pre_DDR_clock_init, Delta

D - 0 - sbl1_ddr_set_params, Delta

B - 415349 - do ddr sanity test, Start                                                         //9008端口,緊急下載下傳模式停住位置

D - 335 - do ddr sanity test, Delta

B - 421296 - pm_driver_init, Start

B - 427854 - PM: INFO: pm_sbl_chg_init

B - 428494 - Manually set to USB500 mode

B - 432398 - raw vbat: 4017, gain: -16

B - 435997 - vbat: 3856                                                                                                                  //電池電壓

B - 438468 - Battery good, bootup

D - 17141 - pm_driver_init, Delta

B - 448716 - DDR Training restore, Start

B - 450942 - DDR Training restore, End

B - 460611 - clock_init, Start

D - 488 - clock_init, Delta

B - 461160 - Image Load, Start

D - 64294 - QSEE Image Loaded, Delta - (1519024 Bytes)            //modem部分

B - 525454 - Image Load, Start

D - 213 - SEC Image Loaded, Delta - (2048 Bytes)            //sec 與 secure boot相關

B - 532530 - PM0: PON1=0x20:PON1 | POFF1=0x2:PS_HOLD

B - 537257 - PM1: PON1=0x20:PON1 | POFF1=0x2:PS_HOLD

B - 542168 - sbl1_efs_handle_cookies, Start

D - 366 - sbl1_efs_handle_cookies, Delta

B - 550403 - Image Load, Start

D - 8357 - DEVCFG Image Loaded, Delta - (33900 Bytes)//裝置配置,會控制晶片硬體資源

B - 559065 - Image Load, Start

D - 15189 - RPM Image Loaded, Delta - (169748 Bytes) //Resource Power Manager

B - 574284 - Image Load, Start

D - 38888 - APPSBL Image Loaded, Delta - (706652 Bytes)//lk

B - 613172 - QSEE Execution, Start

D - 30 - QSEE Execution, Delta

B - 618906 - USB D+ check, Start

B - 774273 - usb:: cdp

D - 152225 - USB D+ check, Delta

B - 774334 - SBL1, End

D - 533231 - SBL1, Delta

S - Flash Throughput, 40000 KB/s (2434468 Bytes, 59527 us)

S - DDR Frequency, 931 MHz

S - Core 0 Frequency, 1804 MHz

Android Bootloader - UART_DM Initialized!!!

[0] welcome to lk

[10] platform_init()

[10] target_init()

[30] SDHC Running in HS400 mode

[40] Done initialization of the card

[40] pm8x41_get_is_cold_boot: cold boot

[40] Qseecom Init Done in Appsbl version is 0x1001000   

//Appsbl指的就是aboot

[50] secure app region addr=0x85b00000 size=0x800000[50] TZ App region notif returned with status:0 addr:85b00000 size:8388608

[60] TZ App log region register returned with status:0 addr:8f77f000 size:4096

[60] Qseecom TZ Init Done in Appsbl

[80] Loading cmnlib done

[90] Loading cmnlib64 done

[90] qseecom_start_app: Loading app keymaster for the first time'

//某方案商涉及安全子產品有TZ, CMNLIB, RPMB, LKSECAPP, KEYMASETER .

 [110] <8>keymaster64: KEYMASTER Init                                                 //keymaster啟動

[110] Waiting for the RPM to populate smd channel table  // Resource Power Manager

[120] Active Slot: (_a)                                                                                                         //a分區

[120] Not able to search the panel:

[130] ------------- panel_*****_video.h ---------------------                                 //顯示屏

[130] panel_operating_mode=0x0

[800] ERROR: Splash image header invalid //無效開機畫面頭,使用預設的開機畫面

[810] Config MIPI_VIDEO_PANEL.

[810] Turn on MIPI_VIDEO_PANEL.

[830] Video lane tested successfully

[830] pm8x41_get_is_cold_boot: cold boot

//下面是開始核心啟動,bootloader模式是在這執行fastboot_init

[840] Unable to locate /bootselect partition

[840] BootImage Header: 1

[840] Loading boot image (67108864) active_slot(_a): start

[1050] Loading boot image (67108864) active_slot(_a): done

[1060] use_signed_kernel=1, is_unlocked=1, is_tampered=0        //裝置鎖狀态

[1090] MultiSlot true, partition name boot_a

[1090] AVB version 2                                                                                                                     //AVB驗證

[1090] avb_slot_verify.c[1090] :[1100] 417[1100] : DEBUG: [1100] Loading vbmeta struct from partition '[1100] vbmeta_a[1100] '.

[1110] ValidateVbmetaPublicKey PublicKeyLength 1032, PublicKeyMetadataLength 0

[1110] ValidateVbmetaPublicKey OutIsTrusted 1, UserKey 0

[1120] ReadRollbackIndex Location 0, RollbackIndex 0

[1120] avb_slot_verify.c[1130] :[1130] 417[1130] : DEBUG: [1130] Loading vbmeta struct from partition '[1130] system_a[1130] '.

[1130] negative Offset (-64) converted to (0x987fffc0) 

[1140] read from system_a, 0x40 bytes at Offset 0x987fffc0, partition size 2415919104

[1150] StartBlock 0x4c3fff, ReadOffset 0x1c0, read_size 0x40

[1150] read from system_a, 0x740 bytes at Offset 0x9877a000, partition size 2415919104

[1160] LastBlock 0x4c3bd3, ReadOffset 0x0, read_size 0x140

[1170] ReadRollbackIndex Location 2, RollbackIndex 0

[1170] avb_slot_verify.c[1170] :[1170] 157[1170] : DEBUG: [1180] boot_a[1180] : Loading entire partition.

[1310] avb_slot_verify.c[1310] :[1310] 236[1310] : DEBUG: [1310] boot_a[1310] : success: Image verification completed.

[1310] avb_slot_verify.c[1320] :[1320] 157[1320] : DEBUG: [1320] dtbo_a[1320] : Loading entire partition.

[1320] avb_slot_verify.c[1330] :[1330] 236[1330] : DEBUG: [1330] dtbo_a[1330] : success: Image verification completed.

[1330] system_a uuid: 1301d1c2-456f-1c8f-e1c1-1b435756052c

[1340] boot_a uuid: a7a1da89-605d-d46c-8caa-3ac3cbc8462d

[1340] vbmeta_a uuid: 88b216e2-034a-fcbc-d3a5-6e06f26402da

[1350] State: Unlocked, AvbSlotVerify returned OK, continue boot

[1360] Requested Partition: boot

[1360] Loaded Partition: boot

[1360] Requested Partition: dtbo

[1360] Loaded Partition: boot

[1370] Loaded Partition: dtbo

[1370] Total loaded partition 3

[1370] boot_verifier: Device is in ORANGE boot state.

[1380] Device is unlocked! Skipping verification...

[1380] LK SEC APP Handle: 0x1

[1380] <8>keymaster64: cmd_id=SET_ROT begin

[1390] <8>keymaster64: Error: qsee_cfg_getpropval in get_enable_set_bandwidth failed for enable_set_bandwidth, ret_size = 0

[1400] <8>keymaster64: rot.data_length: 32

[1400] <8>keymaster64: cmd_id=SET_ROT done with ret: 0 time taken: 0

[1410] LK SEC APP Handle: 0x1

[1410] <8>keymaster64: cmd_id=GET_VERSION begin

[1420] Authentication Key not yet programmed

[1430] <8>keymaster64: qsee_stor_device_init error ret: -14

[1430] <8>keymaster64: cmd_id=GET_VERSION done with ret: 0 time taken: 13

[1440] <8>keymaster64: cmd_id=SET_BOOT_STATE begin

[1440] <8>keymaster64: is_unlocked: 1

[1440] <8>keymaster64: color: 1

[1450] <8>keymaster64: system_version: 90000                                       //android系統版本9

[1450] <8>keymaster64: system_security_level 201903                //更新檔等級

[1460] <8>keymaster64: cmd_id=SET_BOOT_STATE done with ret: 0 time taken: 0

[1460] Sending Root of Trust to trustzone: end

[1470] LK SEC APP Handle: 0x1

[1470] <8>keymaster64: cmd_id=KEYMASTER_SET_VBH begin

[1470] <8>keymaster64: cmd_id=KEYMASTER_SET_VBH done with ret: 0 time taken: 0

[1480] VB2: Authenticate complete! boot state is: orange

[1490] VB2: boot state: orange(1)                                                                                     //Verify Boot結果

[1490] Boot State is : 1

[1500] creating boot verify keys detect thread                                                                   //verify boot thread

[6560] ERROR: Splash image header invalid

[6570] decompressing kernel image: start

[6870] decompressing kernel image: done

[6890] DTBO Overlay count start: 254669

[6920] DTB overlay is successful

[6920] DTBO Overlay count done: 255738                                                            //merge裝置樹疊加層成功

[6930] UpdateCmdLine vbcmdline present len 814

[6930] pm8x41_get_is_cold_boot: cold boot

[6940] target_pause_for_battery_charge : pon_reason is:0x20 cold_boot:1 usb_sts:0

[6940] display kernel cmdline: mdss_mdp.panel=1:dsi:0:qcom,mdss_dsi_st7701s_tn_400p_video:1:none:cfg:single_dsi

[6950] cmdline: console=ttyMSM0,115200,n8 androidboot.console=ttyMSM0 androidboot.hardware=qcom msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 androidboot.bootdevice=7824900.sdhci earlycon=msm_serial_dm,0x78af000 firmware_class.path=/vendor/fir[6980] Updating device tree: start

[7160] kaslr-Seed is added to chosen node

[7200] Updating device tree: done                                                                                     //更新裝置樹

[7200] Turn off MIPI_VIDEO_PANEL.

[7200] Continuous splash enabled, keeping panel alive.                          

[7210] <8>keymaster64: cmd_id=MILESTONE_CALL begin

[7210] <8>keymaster64: cmd_id=MILESTONE_CALL done with ret: 0 time taken: 0

[7220] Success [7220] Qseecom De-Init Done in Appsbl                           //LK結束

[7230] free_verified_boot_resource                                                                                   //釋放verify boot資源

[7230] booting linux @ 0x80080000, ramdisk @ 0x83600000 (6618913), tags/device tree @ 0x83400000

//核心程式位址,根檔案系統位址,裝置樹位址

[7240] Jumping to kernel via monitor

[ 0.000000] Booting Linux on physical CPU 0x0

[ 0.000000] Linux version 4.9.112+ ([email protected]) (gcc version 4.9.x 20150123 (prerelease) (GCC) ) #2 SMP PREEMPT Tue May 28 18:59:24 CST 2019

[ 0.000000] Boot CPU: AArch64 Processor [410fd034]

[ 0.000000] Machine: Qualcomm Technologies, Inc. SDM450 PMI8950 MTP

[ 0.000000] core_ctl: disable_cpumask=0-7

[ 0.000000] earlycon: msm_serial_dm0 at MMIO 0x00000000078af000 (options '')

[ 0.000000] bootconsole [msm_serial_dm0] enabled

[ 0.000000] efi: Getting EFI parameters from FDT:

[ 0.000000] efi: UEFI not found.

[ 0.000000] Reserved memory: created CMA memory pool at 0x00000000ffc00000, size 4 MiB

[ 0.000000] OF: reserved mem: initialized node [email protected], compatible id shared-dma-pool

[ 0.000000] Reserved memory: created CMA memory pool at 0x000000008f800000, size 8 MiB

[ 0.000000] OF: reserved mem: initialized node [email protected], compatible id shared-dma-pool

[ 0.000000] Reserved memory: created CMA memory pool at 0x000000008f000000, size 8 MiB

[ 0.000000] OF: reserved mem: initialized node [email protected], compatible id shared-dma-pool

[ 0.000000] OF: reserved mem: invalid size property in 'mem_dump_region' node.

[ 0.000000] Reserved memory: created CMA memory pool at 0x00000000f4800000, size 180 MiB

[ 0.000000] OF: reserved mem: initialized node [email protected], compatible id shared-dma-pool

[ 0.000000] Reserved memory: created CMA memory pool at 0x00000000f3800000, size 16 MiB

[ 0.000000] OF: reserved mem: initialized node [email protected], compatible id shared-dma-pool

[ 0.000000] Reserved memory: created CMA memory pool at 0x00000000f3400000, size 4 MiB

[ 0.000000] OF: reserved mem: initialized node qseecom_ta_region, compatible id shared-dma-pool

[ 0.000000] Removed memory: created DMA memory pool at 0x0000000085b00000, size 13 MiB

[ 0.000000] OF: reserved mem: initialized node [email protected], compatible id removed-dma-pool

[ 0.000000] Removed memory: created DMA memory pool at 0x0000000086c00000, size 106 MiB

[ 0.000000] OF: reserved mem: initialized node [email protected], compatible id removed-dma-pool

[ 0.000000] Removed memory: created DMA memory pool at 0x000000008d600000, size 17 MiB

[ 0.000000] OF: reserved mem: initialized node [email protected], compatible id removed-dma-pool

[ 0.000000] Removed memory: created DMA memory pool at 0x000000008e700000, size 7 MiB

[ 0.000000] OF: reserved mem: initialized node [email protected], compatible id removed-dma-pool

[ 0.000000] cma: Reserved 16 MiB at 0x00000000f2400000

[ 0.000000] psci: probing for conduit method from DT.

[ 0.000000] psci: PSCIv1.0 detected in firmware.

[ 0.000000] psci: Using standard PSCI v0.2 function IDs

[ 0.000000] psci: MIGRATE_INFO_TYPE not supported.

[ 0.000000] psci: SMC Calling Convention v1.0

[ 0.000000] Did not receive the expected number of bytes from PRNG: 0

[ 0.000000] percpu: Embedded 23 pages/cpu @ffffffcc31df6000 s56104 r8192 d29912 u94208

[ 0.000000] CPU features: enabling workaround for ARM erratum 845719

[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 480060

[ 0.000000] Kernel command line: core_ctl_disable_cpumask=0-7 kpti=0 console=ttyMSM0,115200,n8 androidboot.console=ttyMSM0 androidboot.hardware=qcom msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 androidboot.bootdevice=7824900.sdhci earlycon=msm_serial_dm,0x78af000 firmware_class.path=/vendor/firmware_mnt/image androidboot.usbconfigfs=true loop.max_part=7 buildvariant=userdebug androidboot.emmc=true androidboot.verifiedbootstate=orange androidboot.keymaster=1 dm="1 vroot none ro 1,0 4918112 verity 1 PARTUUID=1301d1c2-456f-1c8f-e1c1-1b435756052c PARTUUID=1301d1c2-456f-1c8f-e1c1-1b435756052c 4096 4096 614764 614764 sha1 2d97a9989b5bf9c8ae5263f2d88c40e34254210d 7e61282c660bf96ef462600a73a88471b5edab47 10 restart_on_corruption ignore_zero_blocks use_fec_from_device PARTUUID=1301d1c2-456f-1c8f-e1c1-1b435756052c fec_roots 2 fec_blocks 619606 fec_start 619606" root=/dev/dm-0 androidboot.vbmeta.device=PARTUUID=88b216e2-034a-fcbc-d3a5-6e06f26402da androidboot.vbmeta.avb_version                             //cmdline

[ 0.000000] device-mapper: init: will configure 1 devices

[ 0.000000] log_buf_len individual max cpu contribution: 131072 bytes

[ 0.000000] log_buf_len total cpu_extra contributions: 917504 bytes

[ 0.000000] log_buf_len min size: 131072 bytes

***

***

***

[ 5.752084] IPA SSR support = True

[ 5.756461] IPA ipa-loaduC = True

[ 5.759672] IPA SG support = True

[ 5.763076] IPA Napi Enable = False

[ 5.766358] using default for wan-rx-desc-size = 1024

[ 5.773317] CHRDEV "wwan_ioctl" major number 222 goes below the dynamic allocation range

[ 5.776647] ipa ipa_sps_irq_control_all:963 EP (5) not allocated.

[ 5.783055] ipa ipa2_uc_state_check:302 uC is not loaded

[ 5.790146] rmnet_ipa completed initialization

[ 5.795265] RNDIS_IPA module is loaded.[ 5.798669] clock_late_init: Removing enables held for handed-off clocks

[ 5.810001] apc_mem_acc_corner: disabling

[ 5.810057] gfx_mem_acc_corner: disabling

[ 5.813272] ALSA devic䙠 5.820447] device-mapper: init: attempting early device configuration.

[ 5.822490] device-mapper: init: adding target '0 4918112 verity 1 PARTUUID=1301d1c2-456f-1c8f-e1c1-1b435756052c PARTUUID=1301d1c2-456f-1c8f-e1c1-1b435756052c 4096 4096 614764 614764 sha1 2d97a9989b5bf9c8ae5263f2d88c40e34254210d 7e61282c660bf96ef462600a73a88471b5edab47 10 restart_on_corruption ignore_zero_blocks use_fec_from_device PARTUUID=1301d1c2-456f-1c8f-e1c1-1b435756052c fec_roots 2 fec_blocks 619606 fec_start 619606'

[ 5.844628] device-mapper: init: dm-0 is ready

[ 5.877194] EXT4-fs (dm-0): couldn't mount as ext3 due to feature incompatibilities

[ 5.877932] EXT4-fs (dm-0): couldn't mount as ext2 due to feature incompatibilities

[ 5.889916] EXT4-fs (dm-0): mounted filesystem without journal. Opts: (null)

[ 5.891480] VFS: Mounted root (ext4 filesystem) readonly on device 253:0.

[ 5.905672] Freeing unused kernel memory: 6464K

[ 5.994975] init: init first stage started!                                                                                     //init 第一階段

[ 5.996901] init: Using Android DT directory /proc/device-tree/firmware/android/                   //裝置樹目錄

[ 6.003783] init: [libfs_mgr]fs_mgr_read_fstab_default(): failed to find device default fstab    //挂載

[ 6.252545] IPC_RTR: msm_ipc_router_smd_driver_register Already driver registered IPCRTR

[ 6.252620] IPC_RTR: msm_ipc_router_smd_driver_register Already driver registered IPCRTR

[ 6.267444] init: [libfs_mgr]Returning avb_handle with status: 0

[ 6.270260] init: [libfs_mgr]Loading verity table: '1 /dev/block/platform/soc/7824900.sdhci/by-name/vendor_a /dev/block/platform/soc/7824900.sdhci/by-name/vendor_a 4096 4096 188951 188951 sha1 6fb3a79fadbdafa02160a45a3b014a5c8fe628e3 dd870854ca8dacfd1546be2ddad069fac3752145 10 use_fec_from_device /dev/block/platform/soc/7824900.sdhci/by-name/vendor_a fec_roots 2 fec_blocks 190441 fec_start 190441 restart_on_corruption ignore_zero_blocks'

[ 6.308940] EXT4-fs (dm-1): mounting with "discard" option, but the device does not support discard

[ 6.312656] EXT4-fs (dm-1): mounted filesystem without journal. Opts: barrier=1,discard

[ 6.321497] init: [libfs_mgr]__mount(source=/dev/block/dm-1,target=/vendor,type=ext4)=0: Success

[ 6.329605] init: Skipped setting INIT_AVB_VERSION (not in recovery mode) //非recovery模式,即進入system。

[ 6.338617] init: Loading SELinux policy                                                            //SELinux 規則

[ 6.772450] audit: type=1403 audit(145.569:2): policy loaded auid=4294967295 ses=4294967295

[ 6.773531] selinux: SELinux: Loaded policy from /vendor/etc/selinux/precompiled_sepolicy                  //規則檔案

[ 6.773531] 

[ 6.780419] audit: type=1404 audit(145.569:3): enforcing=1 old_enforcing=0 auid=4294967295 ses=4294967295

[ 6.826438] selinux: SELinux: Loaded file_contexts            //第一次load

[ 6.826438] 

[ 6.832680] init: init second stage started!                         //init第二階段

[ 6.887590] init: Using Android DT directory /proc/device-tree/firmware/android/                //裝置樹轉換成目錄與節點

[ 6.896248] selinux: SELinux: Loaded file_contexts            //第二次load

[ 6.896248] 

[ 6.896326] init: Running restorecon...

[ 6.923926] init: waitid failed: No child processes

[ 6.928767] init: Couldn't load property file '/odm/default.prop': open() failed: No such file or directory: No such file or directory

[ 6.935678] init: Created socket '/dev/socket/property_service', mode 666, user 0, group 0

[ 6.942112] init: Forked subcontext for 'u:r:vendor_init:s0' with pid 432

[ 6.949911] init: Forked subcontext for 'u:r:vendor_init:s0' with pid 433

[ 6.955279] init: Parsing file /init.rc...

[ 7.088831] ueventd: ueventd started!                                            //這個用于建立/dev/下面的節點

[ 7.095770] selinux: SELinux: Loaded file_contexts            //第三次load

[ 7.095770] 

[ 7.096287] ueventd: Parsing file /ueventd.rc...

[ 7.103413] ueventd: Parsing file /vendor/ueventd.rc...

[ 7.121935] ueventd: Parsing file /odm/ueventd.rc...

[ 7.122053] ueventd: Unable to read config file '/odm/ueventd.rc': open() failed: No such file or directory

[ 7.126064] ueventd: Parsing file /ueventd.qcom.rc...

[ 7.135594] ueventd: Unable to read config file '/ueventd.qcom.rc': open() failed: No such file or directory

[ 7.314765] modprobe (435) used greatest stack depth: 11120 bytes left

[END] 2019/12/9 15:52:42

        本想簡單貼點日志,弄的時候才發現,日志内容很多東西,并且每次讀都有新發現。

recovery/system模式通過挂載不同的檔案系統來差別,具有不同的cmdline參數(skip_initramfs)。一般cmdline很長,很難完整列印,可以讀取proc/cmdline來擷取全部内容。裝置樹資訊位置/proc/device-tree/

dm-verity是在挂載時候判斷,廠商控制復原是判斷更新檔等級。SELinux規則檔案/vendor/etc/selinux/precompiled_sepolicy

     總在叙述,加點陳詞吧。

     對整個開機流程PBL->sbl1->bootloader->kernel->system來說:1、PBL是闆載程式。2、晶片方案商通過sbl1來控制流程和安全(啟動modem、senser、dsp、rpm、devcfg等,一些安全驗證,硬體資訊)。3、廠商通過bootloader來控制android加載流程(cmdline包含部分硬體資訊,裝置樹資訊,安全驗證資訊,recovery/system模式資訊等)。4、kernel挂載system後啟動android。

     安全上驗證流程是secure boot-> verify boot->dm-verity。 1、secure boot相當于硬體驗證MP和aboot。2、aboot的verify boot驗證的dtbo、boot和vbmeta。3、boot的dm-verity功能與vbmeta存儲的哈希樹值來驗證systen和vendor。4、到系統再有SELinux,userdata加密,系統簽名等來保護裝置。這樣一條線驗證過來可以保證裝置内關鍵分區為廠商自己釋出的鏡像。了解更多看看後面的刷機相關的Android的安全。

    細節請跟代碼或搜尋。