作者: Linux-小企鹅
博客地址:http://blog.csdn.net/u012319379/article/details/77822244
脚本分析
- build_android函数分析
function build_android()
{
if [ ${BUILD_ALL} == "true" ] || [ ${BUILD_ANDROID} == "true" ]; then
echo ""
echo "=============================================="
echo "build android"
echo "=============================================="
#patch_android
generate_key
if [ ${ANDROID_VERSION_MAJOR} == "4" ]; then
apply_kernel_ion_header
fi
make -j8 PRODUCT-aosp_${BOARD_NAME}-${BUILD_TAG}
check_result "build-android"
make_android_root
refine_android_system
#sign_system_private_app
#build_cts
#restore_patch
echo "---------- End of build android"
fi
}
- make_android_root函数分析
function make_android_root()
{
local out_dir=${TOP}/out/target/product/${BOARD_NAME}
cd ${out_dir}/root
sed -i -e '/mount\ yaffs2/ d' -e '/on\ fs/ d' -e '/mount\ mtd/ d' -e '/Mount\ \// d' init.rc
awk '/console\ \/system/{print; getline; print; getline; print; getline; print; getline; print " user root"; getline}1' init.rc > /tmp/init.rc
mv /tmp/init.rc init.rc
# handle nand boot
if [ ${ROOT_DEVICE_TYPE} == "nand" ]; then
sed -i 's/.*\/dev.*\/p2.*/\/dev\/block\/mio2 \/system ext4 rw wait/g' fstab.${BOARD_NAME}
sed -i 's/.*\/dev.*\/p3.*/\/dev\/block\/mio3 \/cache ext4 noatime,nosuid,nodev,nomblk_io_submit,discard,errors=panic wait,check/g' fstab.${BOARD_NAME}
sed -i 's/.*\/dev.*\/p7.*/\/dev\/block\/mio7 \/data ext4 noatime,nosuid,nodev,nomblk_io_submit,discard,errors=panic wait,check/g' fstab.${BOARD_NAME}
fi
# arrange permission
chmod 644 *.prop
chmod 644 *.${BOARD_NAME}
chmod 644 *.rc
cd ..
rm -f root.img.gz
cd ${TOP}
}
- refine_android_system函数分析
function refine_android_system()
{
local out_dir=${TOP}/out/target/product/${BOARD_NAME}
cd ${out_dir}/system
chmod 644 *.prop
chmod 644 lib/modules/*
cd ${TOP}
}
总结:其实这一篇都都没什么写的了,先到这吧。