先上高通 ChipCode 上下載 oem code:
http://createpoint.qti.qualcomm.com/planner/link/chipCode
cat > ~/.netrc <<END
machine chipmaster2.qti.qualcomm.com login USERNAME password PASSWORD
END
chmod 600 ~/.netrc
git clone XXX --depth 1
根據 release notes 上 codeaurora 抓取對應的 Android 版本
common/about.html 內apps有寫對應版本,
codeaurora : https://wiki.codeaurora.org/xwiki/bin/QAEP/release
將高通 ChipCode 解壓,將 codeaurora 抓的 Android code 合入 LINUX\android 下
安裝各 toolchain:
Hexagon 5,1,05 (Qualcomm 網站下載)
Hexagon 6.4.06 (Qualcomm 網站下載)
ARM Compiler Tools 5.01 (ARM 官網下載,註冊30天試用)
Snapdragon LLVM ARM compiler 3.5.2.4 (Qualcomm 網站下載)
gcc-linaro-aarch64-none-elf-4.9-2014.07_linux (https://releases.linaro.org/archive/14.07/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.9-2014.07_linux.tar.bz2)
gcc-linaro-arm-linux-gnueabihf-4.8-2014.02_linux (https://releases.linaro.org/archive/14.02/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.8-2014.02_linux.tar.bz2)
Build Android:
################################################### # Build Android ################################################### echo "Start to build Android..." && cd LA.UM.5.6/LINUX/android/ . build/envsetup.sh && lunch msm8953_64-userdebug && export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4g" && ./prebuilts/sdk/tools/jack-admin kill-server ./prebuilts/sdk/tools/jack-admin start-server make clean && make -j8 && ## make done ##
產生
boot.img
recovery.img
system.img
cache.img
persist.img
userdata.img
mdtp.img
emmc_appsboot.mbn
Setting ENV – 依照 toolchain 安裝的路徑設定
export ARM_COMPILER_PATH=/usr/local/DS-5_v5.28.0/sw/ARMCompiler5.06u6/bin export PYTHON_PATH=/usr/bin export PYTHONPATH=/usr/bin export MAKEPATH=/usr/bin export MAKE_PATH=/usr/bin export PYTHONBIN=/usr/bin/python2.7 export ARMROOT=/usr/local/DS-5_v5.28.0/sw/ARMCompiler5.06u6 export ARMTOOLS=ARMCT5.01 export ARMLIB=$ARMROOT/lib export ARMINCLUDE=$ARMROOT/include export ARMINC=$ARMINCLUDE export ARMBIN=$ARMROOT/bin export ARMPATH=$ARMBIN export PATH=$MAKE_PATH:$PYTHON_PATH:$ARMBIN:$ARM_COMPILER_PATH:$PATH export ARMHOME=$ARMROOT export HEXAGON_ROOT=~/Qualcomm/HEXAGON_Tools export LLVMTOOLS=LLVM export LLVMROOT=~/D/tool/Snapdragon-llvm-3.5.2.4-compiler-linux64 export LLVMBIN=$LLVMROOT/bin export LLVMLIB=$LLVMROOT/lib/clang/3.5.2/lib/linux export MUSLPATH=$LLVMROOT/tools/lib64 export MUSL32PATH=$LLVMROOT/tools/lib32 export LLVMINC=$MUSLPATH/include export LLVM32INC=$MUSL32PATH/include export LLVMTOOLPATH=$LLVMROOT/tools/bin export GNUROOT=~/D/tool/gcc-linaro/gcc-linaro-aarch64-none-elf-4.9-2014.07_linux export GNUARM7=~/D/tool/gcc-linaro/gcc-linaro-arm-linux-gnueabihf-4.8-2014.02_linux export PATH=$GNUTOOL:$PATH
移除各 build/ms 的 setenv.sh
Build MPSS image
pushd MPSS.TA.2.3/modem_proc/build/ms ./build.sh 8953.gen.prod -c ./build.sh 8953.gen.prod -k popd
產生 MPSS.TA.2.3/modem_proc/build/ms/bin/8953.gen.prod/mba.mbn
Build ADSP
pushd ADSP.8953.2.8.2/adsp_proc/build python build.py -o clean python build.py -k -c msm8953 -o all popd
產生 adsp_proc/build/dynamic_signed/8953/adspso.bin
Build boot loaders
pushd BOOT.BF.3.3/boot_images/build/ms ./build.sh TARGET_FAMILY=8953 --prod -c ./build.sh TARGET_FAMILY=8953 --prod popd
產生 BOOT.BF.3.3/boot_images/build/ms/bin/JAASANAZ/sbl1.mbn
BOOT.BF.3.3/boot_images/build/ms/bin/JAADANAZ/prog_emmc_firehose_8953_ddr.mbn
Build TZ images
pushd TZ.BF.4.0.5/trustzone_images/build/ms/ ./build.sh CHIPSET=msm8953 devcfg sampleapp -c ./build.sh CHIPSET=msm8953 devcfg sampleapp popd
產生
$ ls chamomile.mbn fidocrypto.mbn keymaster.mbn sampleextauth.mbn signed_encrypted unsigned cmnlib64.mbn fidosui.mbn lksecapp.mbn secotacl.mbn smplap32.mbn voiceprint.mbn cmnlib.mbn fingerprint64.mbn mdtp.mbn secureindicator.mbn smplap64.mbn widevine.mbn cppf.mbn fingerprint.mbn qmpsecap.mbn securemm.mbn smplcert.mbn devcfg.mbn gpsample.mbn qpay64.mbn secure_ui_sample64.mbn smplserv.mbn dhsecapp.mbn gptest.mbn qpay.mbn secure_ui_sample.mbn teetest.mbn fidocfg.mbn isdbtmm.mbn sampleauth.mbn signed tz.mbn
Build RPM
pushd RPM.BF.2.4/rpm_proc/build ./build_8953.sh -c ./build_8953.sh popd
產生 RPM.BF.2.4/rpm_proc/build/ms/bin/8953/rpm.mbn
補充:
抓不到rvct版號問題,手動加入rvct_ver = 5
vi RPM.BF.2.4/rpm_proc/tools/build/scons/scripts/rvct.py
armtools = os.environ.get('ARMTOOLS', None) rvct_ver = 5 if armtools is not None: env.Replace(ARMTOOLS = armtools) env.Replace(ARM_TOOLS = armtools) if 'RVCT2' in armtools: rvct_ver = 2 if 'RVCT4' in armtools: rvct_ver = 4
Creating NON-HLOS.bin 上面(除了Android)有變動都要做一次
pushd MSM8953.LA.2.0/common/build python build.py python ../../../BOOT.BF.3.3/boot_images/core/storage/tools/ptool/ptool.py -x ../config/partition.xml popd
產生檔案 MSM8953.LA.2.0/common/build/bin/asic/NON-HLOS.bin
app patch0.xml bin rawprogram0_BLANK.xml build.py rawprogram0.xml contents_apq8053_32bit.xml update_common_01.log contents_apq8053_64bit.xml update_common.log contents_msm8953_32bit_WTR2965.xml Ver_Info.txt contents_msm8953_32bit.xml wipe_rawprogram_PHY0.xml contents_msm8953_64bit_WTR2965.xml wipe_rawprogram_PHY1.xml fastboot_all.py wipe_rawprogram_PHY2.xml fastboot_complete.py wipe_rawprogram_PHY4.xml fat_creation_01.log wipe_rawprogram_PHY5.xml fat_creation.log wipe_rawprogram_PHY6.xml gpt_backup0.bin wipe_rawprogram_PHY7.xml gpt_both0.bin zeros_1sector.bin gpt_main0.bin zeros_33sectors.bin
MSM8953.LA.2.0/common/sectools/resources/build/fileversion2/sec.dat
Copy 各階段產生的檔案
#!/bin/bash set -e FIREHOSE_PATH=./release/firehose/ OUTPUT_IMAGE_PATH=./LA.UM.5.6/LINUX/android/out/target/product/msm8953_64 rm -rf ./release mkdir -p $FIREHOSE_PATH cp -p .repo/manifest.xml $FIREHOSE_PATH cp -p $OUTPUT_IMAGE_PATH/boot.img $FIREHOSE_PATH cp -p $OUTPUT_IMAGE_PATH/system.img $FIREHOSE_PATH cp -p $OUTPUT_IMAGE_PATH/userdata.img $FIREHOSE_PATH cp -p $OUTPUT_IMAGE_PATH/cache.img $FIREHOSE_PATH cp -p $OUTPUT_IMAGE_PATH/ramdisk.img $FIREHOSE_PATH cp -p $OUTPUT_IMAGE_PATH/ramdisk-recovery.img $FIREHOSE_PATH cp -p $OUTPUT_IMAGE_PATH/persist.img $FIREHOSE_PATH cp -p $OUTPUT_IMAGE_PATH/mdtp.img $FIREHOSE_PATH cp -p $OUTPUT_IMAGE_PATH/recovery.img $FIREHOSE_PATH cp -p $OUTPUT_IMAGE_PATH/emmc_appsboot.mbn $FIREHOSE_PATH mkdir -p $FIREHOSE_PATH/modem cp -p MPSS.TA.2.3/modem_proc/build/ms/orig_MODEM_PROC_IMG_8953.gen.prodQ.elf $FIREHOSE_PATH/modem/ cp -p MPSS.TA.2.3/modem_proc/build/ms/orig_MODEM_PROC_IMG_8953.gen.prodQ.elf.map $FIREHOSE_PATH/modem/ cp -p -r MPSS.TA.2.3/modem_proc/build/myps $FIREHOSE_PATH/modem/ cp -p MPSS.TA.2.3/modem_proc/rftarget_tabasco/msm8953/qcn/wtr2965_non_ca_sawless_4320/etc/CDR7012_LTE_B7_Golden.xqcn $FIREHOSE_PATH/modem/ cp -p MPSS.TA.2.3/modem_proc/rftarget_tabasco/msm8953/qcn/wtr2965_non_ca_sawless_4320/etc/CDR7012_NA_SKU.xqcn $FIREHOSE_PATH/modem/ cp -p MPSS.TA.2.3/modem_proc/build/ms/bin/8953.gen.prod/mba.mbn $FIREHOSE_PATH cp -p ADSP.8953.2.8.2/adsp_proc/build/dynamic_signed/8953/adspso.bin $FIREHOSE_PATH cp -p BOOT.BF.3.3/boot_images/build/ms/bin/JAASANAZ/sbl1.mbn $FIREHOSE_PATH cp -p BOOT.BF.3.3/boot_images/build/ms/bin/JAADANAZ/prog_emmc_firehose_8953_ddr.mbn $FIREHOSE_PATH cp -p RPM.BF.2.4/rpm_proc/build/ms/bin/8953/rpm.mbn $FIREHOSE_PATH cp -p MSM8953.LA.2.0/common/build/bin/asic/NON-HLOS.bin $FIREHOSE_PATH cp -p MSM8953.LA.2.0/common/build/patch0.xml $FIREHOSE_PATH cp -p MSM8953.LA.2.0/common/build/rawprogram0.xml $FIREHOSE_PATH cp -p MSM8953.LA.2.0/common/build/rawprogram0_BLANK.xml $FIREHOSE_PATH cp -p MSM8953.LA.2.0/common/build/gpt_main0.bin $FIREHOSE_PATH cp -p MSM8953.LA.2.0/common/build/gpt_backup0.bin $FIREHOSE_PATH cp -p MSM8953.LA.2.0/common/sectools/resources/build/fileversion2/sec.dat $FIREHOSE_PATH cp -p TZ.BF.4.0.5/trustzone_images/build/ms/bin/SANAANAA/tz.mbn $FIREHOSE_PATH cp -p TZ.BF.4.0.5/trustzone_images/build/ms/bin/SANAANAA/devcfg.mbn $FIREHOSE_PATH cp -p TZ.BF.4.0.5/trustzone_images/build/ms/bin/SANAANAA/cmnlib.mbn $FIREHOSE_PATH cp -p TZ.BF.4.0.5/trustzone_images/build/ms/bin/SANAANAA/cmnlib64.mbn $FIREHOSE_PATH cp -p TZ.BF.4.0.5/trustzone_images/build/ms/bin/SANAANAA/lksecapp.mbn $FIREHOSE_PATH cp -p TZ.BF.4.0.5/trustzone_images/build/ms/bin/SANAANAA/keymaster.mbn $FIREHOSE_PATH echo ==================================================== echo == echo == SUCCESS SUCCESS SUCCESS SUCCESS SUCCESS SUCCESS echo == echo ====================================================