高通平台EFS的制作

用来制作EFS的机器称为A,用来验证EFS的机器称为B。
1.
modem_proc/core/storage/efs/inc/fs_config_i.h中增加以下三行:
#ifndef FEATURE_EFS_ENABLE_FACTORY_IMAGE_SECURITY_HOLE
#define FEATURE_EFS_ENABLE_FACTORY_IMAGE_SECURITY_HOLE
#endif

2.对于没有使能secure boot的device,在 modem_proc/core/storage/fs_tar/src/fs_tar.c中增加一行:
#define FEATURE_FS_TAR_ALLOW_DUMMY_KEY
使能了secure boot的device,不需要定义上面的宏。

3.清除modem后重新编译,编译完成后进入common/build目录执行脚本python update_common_info.py,将新生成的common/build/bin/asic/NON-HLOS.bin文件通过fastboot烧进手机的modem分区。
4.重启手机,打开QPST Software Download软件,切换到Restore页面,USB连接手机,将QCN文件(该QCN文件配置了若干NV项)烧入手机,手机会自动重启。
5.重启就绪后,连接USB线至手机,确保QPST Software Download软件打开,将modem_proc/core/storage/tools/efsreadimage.pl文件放到C:\Users\yuntaohe\Desktop\EFS目录下,打开windows上的cmd窗口,进入C:\Users\yuntaohe\Desktop\EFS目录下,执行perl efsreadimage.pl -z,在当前目录下会生成新文件fs_image.tar.gz。
6.将fs_image.tar.gz上传到ubuntu的modem_proc/core/storage/tools/qdst/目录下,在该目录下执行python QDSTMBN.py fs_image.tar.gz,生成fs_image.tar.gz.mbn
7.将fs_image.tar.gz.mbn和modem_proc/build/ms/bin/8909.gen.prod/efs_image_meta.bin复制到modem_proc/core/bsp/efs_image_header/tools目录下,在该目录下执行python efs_image_create.py efs_image_meta.bin fs_image.tar.gz.mbn,生成fs_image.tar.gz.mbn.img。
至此,EFS制作完成,EFS的验证过程如下:
1.
对于没有使能secure boot的device,在modem_proc/core/storage/fs_tar/src/fs_tar.c中增加一行:
#define FEATURE_FS_TAR_ALLOW_DUMMY_KEY
使能了secure boot的device,不需要定义上面的宏。
2.清除modem后重新编译,编译完成后进入common/build目录执行脚本python update_common_info.py,重新生成common/build/bin/asic/NON-HLOS.bin文件。
3.生成全0的二进制文件:在linux下执行dd if=/dev/zero of=zero.bin bs=<modem_st1 size> count=1,modem_st1 size参看rawprogram0_unspare.xml文件:
  <program SECTOR_SIZE_IN_BYTES="512" file_sector_offset="0" filename="zero.bin" label="modemst1" num_partition_sectors="3072" physical_partition_number="0"size_in_KB="1536.0" sparse="false" start_byte_hex="0x8680000" start_sector="275456" />
本例中,modem_st1 size = 1536 * 1024 = 1572864。
4.将步骤2生成的NON-HLOS.bin和步骤3生成的zero.bin以及生成EFS的fs_image.tar.gz.mbn.img放入刷机包中。
5.修改刷机包中的rawprogram0_unspare.xml文件
-<program SECTOR_SIZE_IN_BYTES="512" file_sector_offset="0" filename="" label="modemst1" num_partition_sectors="3072" physical_partition_number="0" size_in_KB="1536.0" sparse="false" start_byte_hex="0x8680000" start_sector="275456" />

-<program SECTOR_SIZE_IN_BYTES="512" file_sector_offset="0" filename="" label="modemst2" num_partition_sectors="3072" physical_partition_number="0" size_in_KB="1536.0" sparse="false" start_byte_hex="0x8800000" start_sector="278528" />
-<program SECTOR_SIZE_IN_BYTES="512" file_sector_offset="0" filename="" label="fsg" num_partition_sectors="3072" physical_partition_number="0" size_in_KB="1536.0" sparse="false" start_byte_hex="0xc008000" start_sector="393280" />
+<program SECTOR_SIZE_IN_BYTES="512" file_sector_offset="0" filename="zero.bin" label="modemst1" num_partition_sectors="3072" physical_partition_number="0" size_in_KB="1536.0" sparse="false" start_byte_hex="0x8680000" start_sector="275456" />
+<program SECTOR_SIZE_IN_BYTES="512" file_sector_offset="0" filename="zero.bin" label="modemst2" num_partition_sectors="3072" physical_partition_number="0" size_in_KB="1536.0" sparse="false" start_byte_hex="0x8800000" start_sector="278528" />
+<program SECTOR_SIZE_IN_BYTES="512" file_sector_offset="0" filename="fs_image.tar.gz.mbn.img" label="fsg" num_partition_sectors="3072" physical_partition_number="0" size_in_KB="1536.0" sparse="false" start_byte_hex="0xc008000" start_sector="393280" />
6.用QFIL刷机后,USB连接PC,用QXDM查看若干NV是否生效。

注:若B机器使能了secure boot,那么生成的EFS文件fs_image.tar.gz.mbn.img需要经过签名后放入刷机包。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值