android开发笔记之高通MSM8909编译刷机脚本

高通平台的编译和MTK的编译还是有一些不同,多了一些项,并且打包生成的刷机文件也是分散在各个地方,导致这个好像非常玄,弄的我也是老问人,非常不好意思。

这二天,自己看了一下的脚本,搞的非常复杂,自己把核心的弄出来,大家看一下就明白了。这是以MSM8909为例的:

编译脚本

build.sh———–一个综合编译,打包的脚本
使用方法:

source build.sh

build.sh内部

#!/bin/bash
echo "..................................start make ............................"
###############################################  make boot (sbl)  ############################
#boot_images/build/ms
#cleaning the build
#./build.sh TARGET_FAMILY=8909 --prod -c
#build command
#./build.sh TARGET_FAMILY=8909 --prod

###############################################  make tz  ##################################
#trustzone_images/build/ms
#cleaning the build
#./build.sh CHIPSET=msm8909 tz sampleapp -c
#build command
#./build.sh CHIPSET=msm8909 tz sampleapp

###############################################  make rpm  ##################################
#rpm_proc/build
#cleaning the build
#./build_8909.sh -c
#build command
#./build_8909.sh

###############################################  make modem  ##################################
#modem_proc/build/ms
#cleaning the build
#./build.sh 8909.gen.prod -k -c
#build command
#./build.sh 8909.gen.prod -k

###############################################  make NON-HLOS ################################
rm -rvf common/build/bin/*
rm common/build/bin/asic/NON-HLOS.bin
TARGET_PATH="common/build"
cd $TARGET_PATH
python update_common_info.py
#python build.py

###############################################  make android  ###############################
#select jdk version 
#source /home/android/jdk/jdk-1.7.0.79-open.sh
cd LINUX/android
source build/envsetup.sh
lunch P4901-userdebug
# lunch
#P4901-userdebug
#lunch P4901-user
make -j8 PROJECT_NAME=wik_fr SUB_PROJECT_NAME=orange BUILD_MYOS=yes  2>&1 | tee otabuild.log

############################### make adsp (MSM8909 does not need make it) ####################
#adsp_proc eg:msm8937
#cleaning the build
#python ./build/build.py -c msm8937 -o clean
#build command
#python ./build/build.py -c msm8937 -o all


##########################################copy flash image for qfil###########################
rm -rf sysimg
mkdir sysimg
echo "..................................start copy images for qfil............................"
#copy cache_*.img persist_*.img system_*.img userdata_*.img 
#rawprogram0.xml.bak rawprogram_unsparse.xml 
cp common/build/bin/asic/sparse_images/* sysimg/
#about sim card bin
cp common/build/bin/asic/NON-HLOS.bin sysimg/
#qfil select use
cp common/build/patch0.xml sysimg/
cp common/build/gpt_backup0.bin sysimg/
cp common/build/gpt_main0.bin sysimg/
cp common/build/battery.bin sysimg/
cp common/build/zeros_3072sectors.img sysimg/
cp common/build/zeros_512k.bin sysimg/
cp common/build/fs_image.tar.gz.mbn.4901.img sysimg/
# power on logo
cp common/build/splash.bin sysimg/
#
cp common/tools/sectools/resources/build/sec.dat sysimg/
#cp out
#boot.img
cp LINUX/android/out/target/product/P4901/boot.img sysimg/
cp LINUX/android/out/target/product/P4901/emmc_appsboot.mbn sysimg/
#recovery.img
cp LINUX/android/out/target/product/P4901/recovery.img sysimg/
#about bootloader
cp boot_images/build/ms/bin/8909/emmc/sbl1.mbn sysimg/
#qfil select use
cp boot_images/build/ms/bin/8909/emmc/unsigned/prog_emmc_firehose_8909_ddr.mbn sysimg/
#about  tz
cp trustzone_images/build/ms/bin/MAZAANAA/tz.mbn sysimg/
#about sensor
cp rpm_proc/build/ms/bin/8909/pm8909/rpm.mbn sysimg/
#copy xtt
cp wcnss_proc/copy_folder/MSM8909_SoftwareUpgradeWithCDT_eMMC_FireHose.xtt sysimg/
cp wcnss_proc/copy_folder/MSM8909_SoftwareDownloadWithCDT_eMMC_Firehose.xtt sysimg/
echo "..................................end copy images for qfil............................"

echo "..................................end make ............................"

编译脚本的详细说明

其实,这个编译脚本不能直接用,自己要简单调一下,我先来分析一下此脚本:

编译boot

#进入对应编译boot的目录:
cd boot_images/build/ms
#cleaning the build
./build.sh TARGET_FAMILY=8909 --prod -c
#build command
./build.sh TARGET_FAMILY=8909 --prod

编译TZ

#进入对应编译TZ的目录:
cd trustzone_images/build/ms
#cleaning the build
./build.sh CHIPSET=msm8909 tz sampleapp -c
#build command
./build.sh CHIPSET=msm8909 tz sampleapp

编译RPM

#进入对应编译RPM的目录:
cd rpm_proc/build
#cleaning the build
./build_8909.sh -c
#build command
./build_8909.sh

编译modem

#进入对应编译modem的目录:
cd modem_proc/build/ms
#cleaning the build
./build.sh 8909.gen.prod -k -c
#build command
./build.sh 8909.gen.prod -k

编译NON-HLOS

rm -rvf common/build/bin/*
rm common/build/bin/asic/NON-HLOS.bin
TARGET_PATH="common/build"
cd $TARGET_PATH
python update_common_info.py
#python build.py

编译android

#select jdk version 
#source /home/android/jdk/jdk-1.7.0.79-open.sh
cd LINUX/android
source build/envsetup.sh
lunch P4901-userdebug
# lunch
#P4901-userdebug
#lunch P4901-user
make -j8 PROJECT_NAME=wik_fr SUB_PROJECT_NAME=orange BUILD_MYOS=yes  2>&1 | tee otabuild.log

编译adsp

当然,MSM8909 不需要编译此模块,但是有的是需要编译此模块

########## make adsp (MSM8909 does not need make it) ####
#adsp_proc eg:msm8937
#cleaning the build
#python ./build/build.py -c msm8937 -o clean
#build command
#python ./build/build.py -c msm8937 -o all

打包生成QFIL的刷机包

rm -rf sysimg
mkdir sysimg
echo "..................................start copy images for qfil............................"
#copy cache_*.img persist_*.img system_*.img userdata_*.img 
#rawprogram0.xml.bak rawprogram_unsparse.xml 
cp common/build/bin/asic/sparse_images/* sysimg/
#about sim card bin
cp common/build/bin/asic/NON-HLOS.bin sysimg/
#qfil select use
cp common/build/patch0.xml sysimg/
cp common/build/gpt_backup0.bin sysimg/
cp common/build/gpt_main0.bin sysimg/
cp common/build/battery.bin sysimg/
cp common/build/zeros_3072sectors.img sysimg/
cp common/build/zeros_512k.bin sysimg/
cp common/build/fs_image.tar.gz.mbn.4901.img sysimg/
# power on logo
cp common/build/splash.bin sysimg/
#
cp common/tools/sectools/resources/build/sec.dat sysimg/
#cp out
#boot.img
cp LINUX/android/out/target/product/P4901/boot.img sysimg/
cp LINUX/android/out/target/product/P4901/emmc_appsboot.mbn sysimg/
#recovery.img
cp LINUX/android/out/target/product/P4901/recovery.img sysimg/
#about bootloader
cp boot_images/build/ms/bin/8909/emmc/sbl1.mbn sysimg/
#qfil select use
cp boot_images/build/ms/bin/8909/emmc/unsigned/prog_emmc_firehose_8909_ddr.mbn sysimg/
#about  tz
cp trustzone_images/build/ms/bin/MAZAANAA/tz.mbn sysimg/
#about sensor
cp rpm_proc/build/ms/bin/8909/pm8909/rpm.mbn sysimg/
#copy xtt
cp wcnss_proc/copy_folder/MSM8909_SoftwareUpgradeWithCDT_eMMC_FireHose.xtt sysimg/
cp wcnss_proc/copy_folder/MSM8909_SoftwareDownloadWithCDT_eMMC_Firehose.xtt sysimg/
echo "..................................end copy images for qfil............................"

你可能感兴趣的:(android开发笔记,android开发笔记)