参考:
Building Qualcomm modem from sources (msm8626)
Assembling a Qualcomm modem from source(msm8916)
Assembling a Qualcomm modem from source(msm8626)
(原文是俄语)
https://projects.osmocom.org/projects/quectel-modems/wiki/Lenovo_A6000__Other_phones_with_leaked_qualcomm_sources
0. 首先在磁力链上下载
(1)
magnet:?xt=urn:btih:61e8b8a520181ade801c251e5ec9352e33a7bb8c&dn=qcom_msm8x26_modem
(2)
qcom_leaked_sources.zip
magnet:?xt=urn:btih:ef3bf4fd7388657ff35c3dbf2b6367f924f8cdbc&dn=qcom_leaked_sources.zip
在gitlab也可以下载
https://gitlab.com/qcom-sources15
(3)
THE-CODE-8916.zip
http://www.mediafire.com/file/0t1znbr1sl2y6fm/THE-CODE.zip
http://www.mediafire.com/file/awo4z3i3j4qdz45/THE-CODE-8916.gz
1. 安装 Debian 或者 Ubuntu系统
我安装的是 Debian Buster (Debian 10.1.3) amd64
2. 安装必须的软件包
apt install p7zip-full libxml-parser-perl scons lib32stdc++6
p7zip-full 用来解压缩 下载的源代码
libxml-parser-perl 用来分析xml配置文件, debian系统 安装基本系统时就默认装好了
libc6-i386 lib32stdc++6 是因为 qcom 的 dsp编译程序实际是 32位的,必须装上32位的支持包
3. 安装HEXAGON Tools 到 特定的目录
HEXAGON_ROOT=$HOME/Qualcomm/HEXAGON_Tools 7za x -y -o$HEXAGON_ROOT $HOME/Downloads/hexagon_tools_6.4.06.a.7z
假设 将 hexagon_tools_的压缩包,放在了 $HOME/Downloads 目录下, 如果放在其他目录,对上面的命令自行修改
4. 解压缩 msm8626 modem的源代码
ROOTDIR=$HOME/qcom/msm8626 mkdir -p $ROOTDIR cd $ROOTDIR 7za x -y -0$ROOTDIR $HOME/Downloads/qcom_msm8626_modem_proc.7z mv qcom_msm8626_modem_proc modem_proc cd $ROOTDIR/modem_proc
因为压缩包没有保持 UNIX文件属性,sh脚本没有执行权限,需要修复
find . -name '*.sh' -exec chmod -f 775 {} \; find . -name '*.mk' -exec chmod -f 775 {} \; find . -name '*.py' -exec chmod -f 775 {} \; find . -name '*.pl' -exec chmod -f 775 {} \; find . -name '*.lcs' -exec chmod -f 775 {} \; find . -name '*.api' -exec chmod -f 775 {} \; find . -name '*.xml' -exec chmod -f 775 {} \; find . -name '*.scons' -exec chmod -f 775 {} \; find . -name 'scons' -exec chmod -f 775 {} \; find . -name 'SConscript' -exec chmod -f 775 {} \; find . -name 'SConstruct' -exec chmod -f 775 {} \; find . -name 'Makefile' -exec chmod -f 775 {} \; find . -name 'makefile' -exec chmod -f 775 {} \; find . -name 'qaic' -exec chmod -f 775 {} \; find . -name 'doxygen' -exec chmod -f 775 {} \; find . -name 'qdsp6-image-build' -exec chmod -f 775 {} \; find . -name 'SleepSynth' -exec chmod -f 775 {} \; find . -name 'crypto_cbc' -exec chmod -f 775 {} \; find . -name 'crypto_ccm' -exec chmod -f 775 {} \;
5. 开始编译
cd $ROOTDIR/modem_proc/build/ms/ ./build.sh 8626.gen.prod BUILD_ID=AAAAANAZ -k
编译成功,提示
Elfparser Merge: Copying 4376 bytes from ELF file /home/softsim/qcom/msm8626/modem_proc/build/ms/M8x26AAAAANAZQ00772_DEVCFG.elf section ".8626_PLATFORM_CDP_DEVCFG_DATA" at offset 0x1e1a0 into merged_elf_8626_PLATFORM_MTP_MSM_DEVCFG_DATA.elf at offset 0x1b931a0 Install file: "/home/softsim/qcom/msm8626/modem_proc/core/bsp/devcfg_img/build/devcfg_img/qdsp6/AAAAANAZ/M8x26AAAAANAZQ00772.elf" as "M8x26AAAAANAZQ00772.elf" === Generating devcfg_img/qdsp6/AAAAANAZ/M8x26AAAAANAZQ00772_reloc.elf === Generating devcfg_img/qdsp6/AAAAANAZ/M8x26AAAAANAZQ00772.mbn === Generating devcfg_img/qdsp6/AAAAANAZ/M8x26AAAAANAZQ00772_relocflags.elf Install file: "/home/softsim/qcom/msm8626/modem_proc/core/bsp/devcfg_img/build/M8x26AAAAANAZQ00772.mbn" as "bin/AAAAANAZ/qdsp6sw.mbn" === Generating devcfg_img/qdsp6/AAAAANAZ/M8x26AAAAANAZQ00772.mbn Install file: "/home/softsim/qcom/msm8626/modem_proc/core/bsp/devcfg_img/build/reloc/M8x26AAAAANAZQ00772.mbn" as "bin/AAAAANAZ/reloc/qdsp6sw.mbn" scons: done building targets. ============================================================================== SCons build summary ============================================================================== ** Build time... Build start : Sat Jan 27 19:06:15 2024 Build end : Sat Jan 27 19:19:38 2024 Elapsed time : 0:13:24 #------------------------------------------------------------------------------- # BUILD END: AAAAANAZ #------------------------------------------------------------------------------- Build AAAAANAZ: Start Time: Sat Jan 27 19:06:15 2024, End Time: Sat Jan 27 19:19:40 2024 Build AAAAANAZ: Delta Time: 13 minutes, 24 seconds #------------------------------------------------------------------------------- Overall Start Time: Sat Jan 27 19:06:15 2024, Overall End Time: Sat Jan 27 19:19:40 2024 Overall Delta Time: 13 minutes, 24 seconds #-------------------------------------------------------------------------------
可以看到,生成了 bin/AAAAANAZ/qdsp6sw.mbn 这个 modem文件
6. 清除编译的结果
./build.sh 8626.gen.prod BUILD_ID=AAAAANAZ --clean
遇到错误,修正后,重新编译前,可以先清楚。
7. mba.mbn 和 qdsp6sw.mbn 都没有做数字签名
准确地说,是用的高通给的测试签名, 可以在 firmware/image/modem.mdt 文件里看到 “General Use Test Key (for testing only)” 字符串
说明就是测试签名