#!/bin/bash set -e buildroot/scripts/common.sh $@
BR_DIR = buildroot PLATFORM = sun4i_crane cd ${BR_DIR} && ./build.sh -p ${PLATFORM}
if [ -x ./scripts/build_${PLATFORM}.sh ]; then ./scripts/build_${PLATFORM}.sh $MODULE else …… fi
export PATH=${CUR_DIR}/output/external-toolchain/bin:$PATH if [ ! -e output/external-toolchain ];then cd output tar -jxf ../dl/arm-2010.09-50-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 mv arm-2010.09 external-toolchain fi
export PATH=${BR_OUT_DIR}/external-toolchain/bin:$PATH cd ${KERN_DIR} && ./build.sh -p ${PLATFORM} -v ${VENDOR}
......... if [ -x ./scripts/build_${PLATFORM}.sh ]; then ./scripts/build_${PLATFORM}.sh $MODULE else printf "\nERROR: Invalid Platform\n" show_help exit 1 fi .........
build_kernel() { #假设没有配置过kernel 就运行cp arch/arm/configs/sun4i_crane_defconfig .config,就使用预设的配置 if [ ! -e .config ]; then echo -e "\n\t\tUsing default config... ...!\n" cp arch/arm/configs/sun4i_crane_defconfig .config fi #编译standby模块 build_standby #指定buildroot的工具链来make uImage make ARCH=${ARCH} CROSS_COMPILE=${CROSS_COMPILE} -j8 uImage modules update_kern_ver if [ -d output ]; then rm -rf output fi mkdir -p $LICHEE_MOD_DIR #通过 buildroot/output/external-toolchain/bin/arm-none-linux-gnueabi-objcopy 命令生成 bImage文件 ${OBJCOPY} -R .note.gnu.build-id -S -O binary vmlinux output/bImage cp -vf arch/arm/boot/[zu]Image output/ cp .config output/ #拷贝重要文件夹下的模块文件*.ko 到 ${LICHEE_MOD_DIR} lichee/modules文件夹 for file in $(find drivers sound crypto block fs security net -name "*.ko"); do cp $file ${LICHEE_MOD_DIR} done cp -f Module.symvers ${LICHEE_MOD_DIR} #cp -f modules.* ${LICHEE_MOD_DIR} #copy bcm4330 firmware and nvram.txt cp drivers/net/wireless/bcm4330/firmware/bcm4330.bin ${LICHEE_MOD_DIR} cp drivers/net/wireless/bcm4330/firmware/bcm4330.hcd ${LICHEE_MOD_DIR} cp drivers/net/wireless/bcm4330/firmware/nvram.txt ${LICHEE_MOD_DIR}/bcm4330_nvram.txt cp drivers/net/wireless/bcm4330/firmware/mw269v3_fw.bin ${LICHEE_MOD_DIR} cp drivers/net/wireless/bcm4330/firmware/mw269v3_nvram.txt ${LICHEE_MOD_DIR} cp drivers/net/wireless/rtxx7x/RT2870STA.dat ${LICHEE_MOD_DIR} cp drivers/net/wireless/rtxx7x/RT2870STACard.dat ${LICHEE_MOD_DIR} }
echo "build uboot for ${PLATFORM}" cd ${U_BOOT_DIR} && ./build.sh -p sun4i -v ${VENDOR}
make distclean && make -j4 sun4i CROSS_COMPILE=arm-none-linux-gnueabi- else make distclean && make -j4 $PLATFORM CROSS_COMPILE=arm-none-linux-gnueabi- fi
版权声明:本文博客原创文章,博客,未经同意,不得转载。