persist partition: account information, DRM (Digital Rights Management) related files, sensor registry, essential for our wifi, Bluetooth, mac address.\r\n\r\nPlease note that restoring factory settings cannot clear the persist partition. In addition, the online flash package does not include the persist partition. Once a problem occurs, we need to repair it manually.\r\n\r\nModem&radio baseband partition: the partition that controls mobile phone communication functions. Once this partition is damaged, communication-related functions will most likely be lost. Specific manifestations include card failure, imei loss, etc.\r\n\r\nfsg\r\n\r\nfsc\r\n\r\nmodemst1\r\n\r\nmodemst2\r\n\r\nThese 4 partitions must be backed up\r\n\r\nFRP (factory reset protect)\r\n\r\ndsp\r\n\r\nbluetooth\r\n\r\nmodem\r\n\r\npersistsec\r\n\r\nSelect backup\r\n\r\nmisc\u00a0partition\r\n\r\nRecovery uses this partition to save some information about the upgrade to deal with the device power failure and restart during the upgrade process.\r\n\r\nWhen the bootloader starts, it will read the information in this partition to determine whether the system will enter Recovery System or Main System.\r\n\r\nfastboot \u2013disable-verity \u2013disable-verification flash vbmeta vbmeta.img\r\n\r\nAs the name suggests, FRP is used to protect factory settings.\u00a0For example, if your phone is lost, the thief will usually restore it to factory settings to bypass the lock screen password so that it can be used.\u00a0But if you log in with a Google account, you still have to enter your password or Google account at the boot time. This is using FRP.\u00a0If the factory reset is triggered from the settings, FRP will not be triggered. Maybe Google thought during the design that it can be entered into the settings to operate. At this time, the desktop has been unlocked, so it is most likely thought to be the owner of the machine, so it will not be triggered.\r\n\r\n\r\n\r\n\r\nLABEL\r\nPURPOSE OF THIS PARTITION\r\n\r\n\r\n\r\n\r\nModem\r\nPartition for modem\r\n\r\n\r\nfsc\r\nCookie partition to store\u00a0Modem File System's cookies.\r\n\r\n\r\nSsd\r\nPartition for ssd diag module. stores the encrypted RSA keys\r\n\r\n\r\nsbl1\r\nPartition for secondary boot loader\r\n\r\n\r\nSbl1bak\r\nBack up Partition for secondary boot loader\r\n\r\n\r\nRpm\r\nPartition for rpm image\r\n\r\n\r\nRpmbak\r\nBack up Partition for rpm image\r\n\r\n\r\nTz\r\nPartition for tz image\r\n\r\n\r\nTzbak\r\nBack up Partition for tz image\r\n\r\n\r\nHyp\r\nPartition for hypervisor image\r\n\r\n\r\nHypbak\r\nBack up Partition for hypervisor image\r\n\r\n\r\nDsp\r\nPartition for adsp dymanic loaders image\r\n\r\n\r\nModemst1\r\nCopy of Modem File System (Encrypted)\r\n\r\n\r\nModemst2\r\nCopy of Modem File System (Encrypted)\r\n\r\n\r\nDDR\r\nPartition for DDR.\r\n\r\n\r\nfsg\r\nGolden copy or backup of Modem File System (Encrypted)\u00a0. Also used to pre-populate the file system.\r\n\r\n\r\nSec\r\nSec.dat contains fuse settings, mainly for secure boot and oem setting\r\n\r\n\r\nSplash\r\nThe splash screen is displayed during the apps bootloader (also called the LK). The display driver in LK will read the splash image data from a separate eMMC partition named as 'splash'\r\n\r\n\r\nAboot\r\nPartition for apps boot loader\r\n\r\n\r\nAbootbak\r\nBack up Partition for apps boot loader\r\n\r\n\r\nBoot\r\nThis is the boot partition of your android device,It includes the android kernel and the ramdisk.\r\n\r\n\r\nRecovery\r\nThis is specially designed for backup. The recovery partition can be considered as an alternative boot partition\r\n\r\n\r\nDevinfo\r\nDevice information including:iis_unlocked, is_tampered, is_verified, charger_screen_enabled, display_panel, bootloader_version, radio_version All these attirbutes are set based on some specific conditions and written on devinfo partition,.\r\n\r\n\r\nSystem\r\nThis partition contains the entire Android OS, other than the kernel and the ramdisk. This includes the Android GUI and all the system applications that come pre-installed on the device\r\n\r\n\r\nCache\r\nThis is the partition where Android stores frequently accessed data and app components\r\n\r\n\r\nPersist\r\nPartition entry for persist image. which contains data which shouldn't be changed after the device shipped, for example:\u00a0calibration data of chips(wifi, bt, camera, etc.)\u00a0, certificates and other security related files.\r\n\r\n\r\nMisc\r\nThis partition contains miscellaneous system settings in form of on\/off switches. These settings may include CID (Carrier or Region ID), USB configuration and certain hardware settings etc\r\n\r\n\r\nKeystore\r\nPartition for keystore service.\r\n\r\n\r\nConfig\r\nPartition needed during display panel initialization. More info at Display_panel_configuration_in_Device_Tree\r\n\r\n\r\nOEM\r\n\u201cIt is meant for storing OEM specific info. Customer in this case can decide whether he wants to keep this partition or not typically reserved partitions are kept for future use\r\n\r\n\r\nLimits\r\nPartition to store LMh params on 8976 target. LMh (Limits management) driver in SBL writes the LMh HW trimmed data into separate partition and uses the same data for later reboots\r\n\r\n\r\nMota\r\nBackup partition for M ota upgrade\r\n\r\n\r\nDevcfg\r\nPartition needed by TZ for M upgrades.\r\n\r\n\r\nDip\r\nPartition needed for SafeSwitch, feature (FR26255) designed to allow OEMs and carriers to address new smartphone theft bill issues.\r\n\r\n\r\nmdtp\r\nPartition needed for SafeSwitch, feature (FR26255) designed to allow OEMs and carriers to address new smartphone theft bill issues.\r\n\r\n\r\nUserdata\r\nPartition for userdata image\r\n\r\n\r\nCmnlib\r\nVerified boot feature introduced in M \u200b\u200bneedLK to load cmnlib corresponding partitions\r\n\r\n\r\nKeymaster\r\nVerified boot feature introduced in M \u200b\u200bneeds LK to load keymaster from corresponding partitions\r\n\r\n\r\nSyscfg\r\nSyscfg is internal testing for Vmin and CPR characterization\r\n\r\n\r\nf\r\nAll MBNs place holder in flash. Specific MBN would be loaded by mcfg image based on the SIM\/Carrier.\r\n\r\n\r\nmsadp\r\nUsed for modem debug policy\r\n\r\n\r\nApdp\r\nUsed for persisting the debug policy. \u201cDebug policy\u201d is used to better support development and debug on secure\/fuse-blown devices One instance of the debug policy will be signed for the AP\r\n\r\n\r\nDpo\r\nThis partition will store a policy override\r\n\r\n\r\n\r\n\r\nAfter the 5G parameters and IMEI are written to the Modemst1 partition,\r\ncopy all data in the Modemst1 partition to the FSG partition for storage;\r\n\r\nCheck whether the Modemst1 partition is reading and writing normally after each boot:\r\n\r\n \tWhen the Modemst1 partition reads and writes abnormally, clear the Modemst1 partition;\r\n \tWhen the Modemst1 partition is empty, copy the FSG partition to the Modemst1 partition for recovery;\r\n \tWhen the Modemst1 partition is read and written normally, the subsequent normal boot process is completed.\r\n\r\nThe advantage is that it makes full use of the storage space of the FSG partition and exists as a shadow of the Modemst1 partition, which improves partition utilization and enables IoT devices to completely restore factory settings\r\n.\u00a0It cleverly circumvents the previous problem that the Modemst1 partition cannot be reset after leaving the factory, and avoids the defect of having to return to the factory for repair due to abnormal 5G parameters.\r\n\r\nThe working partition of NV is defined by Qualcomm platform as modemst1 or modemst2. The working modemst1 partition or modemst2 partition is equivalent\r\n\r\nThe 5G parameters are always saved in the modemst1 partition when leaving the factory. The router continuously reads and writes with the modemst1 partition during operation.\r\n\r\nThe partition that stores the NV parameter initialization value is the FSG partition. The Qualcomm platform will create an image file containing the NV parameter initialization value and download this image file to the FSG partition.\r\n\r\nThe basis for the Qualcomm platform to copy the FSG partition to the modemst1 partition during the startup process is to determine whether the current NV working modemst1 partition is empty. If it is empty, the NV parameter initialization value in the image file in the FSG partition is updated to the modemst1 partition. middle.\r\n\r\nGenerally, after the 5G device downloads the software for the first time, because the modemst1 partition is empty, the NV parameter initialization value in the FSG partition will be written to the modemst1 partition.\u00a0Then during the production process, important 5G parameters such as calibration parameters and IEMI will be written to the modemst1 partition, causing the modemst1 partition to be unable to be erased later.\u00a0Because the modemst1 partition cannot be erased, it will naturally no longer be empty, and the data in the FSG partition will no longer have the opportunity to be written to the modemst1 partition.\u00a0The reason why the modemst1 partition cannot be erased is not that the partition cannot be read and written, but that after the partition data is erased, the calibration parameters, IEMI and other important 5G parameters written at the factory will be lost.\u00a0If these important 5G parameters are not returned to the factory for repair, there will be no backup on the IoT device.\r\n\r\nFirst, download the software and install the soft system on the empty chip. The working mechanism of the Qualcomm platform will copy all the NV parameter initialization values \u200b\u200bstored in the FSG partition to the modemst1 partition when the modemst1 partition is empty.\r\n\r\nThen write various factory settings and parameters to the modemst1 partition, for example, in order: write the single board number, write the calibration comprehensive test parameters, write the single board current parameters, write the single board functions, write the whole machine current, and couple Operations\u00a0such\r\nas writing , writing complete machine functions, and writing IMEI\r\n\r\nFinally, copy the modemst1 partition that has been completed above to the FSG partition to complete the saving of 5G parameters of the IoT device.\r\n\r\nIoT devices do not operate the fsg partition during normal use, and the fsg partition parameters are always the initial state when the device leaves the factory.\r\n\r\nWhen an IoT device goes online and registers for a 5G network, it reads the parameters of the modemst1 partition as needed, and the operating status is written to the modemst1 partition of the device. Therefore, it continuously interacts with the modemst1 partition during operation.\r\n\r\nFrequent data interaction naturally greatly increases the probability of errors in 5G parameters.\u00a0When an abnormality occurs in reading and writing the modemst1 partition, the reading and writing exception affects the device registration network and the normal operation of the modem. At this time, the modemst1 partition needs to be restored to the factory state.\r\n\r\nUsers only need to restart the abnormal IoT device twice to solve the problem.\r\n\r\nThe first time is to clear the Modemst1 partition, and the second time is to completely Reset the Modemst1 partition (that is, copy fsg to moemst1)\r\n\r\nAfter each boot, the IoT device checks the read and write functions of the modemst1 partition. There are three possibilities at this time: one is empty, the other is normal, and the third is abnormal.\r\n\r\n1) When the Modemst1 partition reads and writes abnormally, clear the Modemst1 partition;\r\n\r\n2) When the Modemst1 partition is empty, copy the FSG partition to the Modemst1 partition for recovery;\r\n3) When the Modemst1 partition is read and written normally, complete the subsequent normal boot process.\r\n\r\nfastboot flash fsg fsg.mbn\r\n\r\nfastboot erase modemst1\r\n\r\nfastboot erase modemst2\r\nProduction of Qualcomm Platform EFS\r\nThe machine used to make EFS is called A, and the machine used to verify EFS is called B.\r\n1.\u00a0Add the following three lines to modem_proc\/core\/storage\/efs\/inc\/fs_config_i.h:\r\n#ifndef FEATURE_EFS_ENABLE_FACTORY_IMAGE_SECURITY_HOLE\r\n#define FEATURE_EFS_ENABLE_FACTORY_IMAGE_SECURITY_HOLE\r\n#endif\r\n2.\u00a0For devices that do not enable secure boot, add the following in modem_proc\/core\/storage\/fs _tar\/ Add a line to src\/fs_tar.c:\r\n#define FEATURE_FS_TAR_ALLOW_DUMMY_KEY\r\nenables the secure boot device, and there is no need to define the above macro.\r\n3.\u00a0Clear the modem and recompile. After compilation, enter the common\/build directory to execute the script python update_common_info.py, and burn the newly generated common\/build\/bin\/asic\/NON-HLOS.bin file into the modem partition of the phone through fastboot.\r\n4.\u00a0Restart the phone, open the QPST Software Download software, switch to the Restore page, connect the phone via USB, and burn the QCN file (the QCN file is configured with several NV items) into the phone, and the phone will automatically restart.\r\n5.\u00a0After the restart is ready, connect the USB cable to the mobile phone, make sure the QPST Software Download software is open, put the modem_proc\/core\/storage\/tools\/efsreadimage.pl file in the C:\\Users\\yuntaohe\\Desktop\\EFS directory, and open it on Windows cmd window, enter\u00a0the\u00a0C:\\Users\\yuntaohe\\Desktop\\EFS directory, execute perl efsreadimage.pl -z, a new file fs_image.tar.gz will be generated in the current directory.\r\n6.\u00a0Upload fs_image.tar.gz to the modem_proc\/core\/storage\/tools\/qdst\/ directory of ubuntu, and execute python QDSTMBN.py fs_image.tar.gz in this directory to generate fs_image.tar.gz.mbn\r\n7.\u00a0Copy fs_image.tar.gz.mbn and modem_proc\/build\/ms\/bin\/8909.gen.prod\/efs_image_meta.bin to the modem_proc\/core\/bsp\/efs_image_header\/tools directory, and execute python efs_image_create.py efs_image_meta in this directory .bin fs_image.tar.gz.mbn, generate fs_image.tar.gz.mbn.img.\r\nAt this point, EFS production is completed. The verification process of EFS is as follows:\r\n1.\u00a0For devices that do not have secure boot enabled, add a line in modem_proc\/core\/storage\/fs_tar\/src\/fs_tar.c:\r\n#define FEATURE_FS_TAR_ALLOW_DUMMY_KEY\r\nwith secure boot enabled device, there is no need to define the above macro.\r\n2.\u00a0Clear the modem and recompile. After compilation, enter the common\/build directory and execute the script python update_common_info.py to regenerate the common\/build\/bin\/asic\/NON-HLOS.bin file.\r\n3.\u00a0Generate a binary file with all 0s: execute dd if=\/dev\/zero of=zero.bin under Linux bs=<modem_st1 size> count=1, for modem_st1 size, please refer to the rawprogram0_unspare.xml file: <program SECTOR_SIZE_IN_BYTES=\u201d512\r\n\u00a0 \u2033 file_sector_offset=\u201d0\u2033 filename=\u201dzero.bin\u201d label=\u201dmodemst1\u2033 num_partition_sectors=\u201d3072\u2033 physical_partition_number=\u201d0\u2033 size_in_KB=\u201d1536.0\u2033 sparse=\u201dfalse\u201d start_byte_hex=\u201d0x8680000\u2033 start_sector=\u201d275456\u2033 \/>\r\nthis In the example, modem_st1 size = 1536 * 1024 = 1572864.\r\n4.\u00a0Put the NON-HLOS.bin generated in step 2, the zero.bin generated in step 3, and the fs_image.tar.gz.mbn.img generated by EFS into the flash package.\r\n5.\u00a0Modify the rawprogram0_unspare.xml file in the flash package:\r\n-<program SECTOR_SIZE_IN_BYTES=\u201d512\u2033 file_sector_offset=\u201d0\u2033 filename=\u201d\u201d label=\u201dmodemst1\u2033 num_partition_sectors=\u201d3072\u2033 physical_partition_number=\u201d0\u2033 size_in_KB=\u201d1536.0\u2033 sparse =\u201dfalse\u201d start_byte_hex=\u201d0x8680000\u2033 start_sector=\u201d275456\u2033 \/>\r\n-<program SECTOR_SIZE_IN_BYTES=\u201d512\u2033 file_sector_offset=\u201d0\u2033 filename=\u201d\u201d label=\u201dmodemst2\u2033 num_partition_sectors=\u201d3072\u2033 physical_partition_number=\u201d0\u2033 size_in_KB= \u201d1536.0\u2033 sparse=\u201dfalse\u201d start_byte_hex=\u201d0x8800000\u2033 start_sector=\u201d278528\u2033 \/>\r\n-<program SECTOR_SIZE_IN_BYTES=\u201d512\u2033 file_sector_offset=\u201d0\u2033 filename=\u201d\u201d label=\u201dfsg\u201d num_partition_sectors=\u201d3072\u2033 physical_partition_number=\u201d0\u2033 size_in_KB=\u201d1536.0\u2033 sparse=\u201dfalse\u201d start_byte_hex=\u201d0xc008000\u2033 start_sector=\u201d 393280\u2033 \/>\r\n+<program SECTOR_SIZE_IN_BYTES=\u201d512\u2033 file_sector_offset=\u201d0\u2033 filename=\u201dzero.bin\u201d label=\u201dmodemst1\u2033 num_partition_sectors=\u201d3072\u2033 physical_partition_number=\u201d0\u2033 size_in_KB=\u201d1536.0\u2033 sparse=\u201dfalse\u201d start_byte_hex =\u201d0x8680000\u2033 start_sector=\u201d275456\u2033 \/>\r\n+<program SECTOR_SIZE_IN_BYTES=\u201d512\u2033 file_sector_offset=\u201d0\u2033 filename=\u201dzero.bin\u201d label=\u201dmodemst2\u2033 num_partition_sectors=\u201d3072\u2033 physical_partition_number=\u201d0\u2033 size_in_KB=\u201d1536.0 \u2033 sparse=\u201dfalse\u201d start_byte_hex=\u201d0x8800000\u2033 start_sector=\u201d278528\u2033 \/>\r\n+<program SECTOR_SIZE_IN_BYTES=\u201d512\u2033 file_sector_offset=\u201d0\u2033 filename=\u201dfs_image.tar.gz.mbn.img\u201d label=\u201dfsg\u201d num_partition_sectors =\u201d3072\u2033 physical_partition_number=\u201d0\u2033 size_in_KB=\u201d1536.0\u2033 sparse=\u201dfalse\u201d start_byte_hex=\u201d0xc008000\u2033 start_sector=\u201d393280\u2033 \/> 6. After flashing the machine with QFIL, connect the USB to the PC and use QXDM to check whether some NVs are\r\neffective\u00a0.\r\n\r\nNote: If secure boot is enabled on machine B, the generated EFS file fs_image.tar.gz.mbn.img needs to be signed and put into the flash package.