完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
UT4418Linux和U-boot编译脚本
编译器目录:output/host/usr #!/bin/bash # # Description : Android Build Script. # Authors :jianjun jiang - jerryjianjun@gmail.com # Version :2.00 # Notes :None # # # JAVA PATH # exportPATH=/usr/lib/jvm/java-7-oracle/bin:$PATH # # Some Directories # BS_DIR_TOP=$(cd `dirname $0` ; pwd) BS_DIR_RELEASE=${BS_DIR_TOP}/out/release BS_DIR_TARGET=${BS_DIR_TOP}/out/target/product/x6818/ BS_DIR_UBOOT=${BS_DIR_TOP}/uboot BS_DIR_KERNEL=${BS_DIR_TOP}/kernel BS_DIR_BUILDROOT=${BS_DIR_TOP}/buildroot # # Cross Toolchain Path # BS_CROSS_TOOLCHAIN_BOOTLOADER=${BS_DIR_TOP}/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8/bin/arm-eabi- BS_CROSS_TOOLCHAIN_KERNEL=${BS_DIR_TOP}/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8/bin/arm-eabi- # # Target Config # BS_CONFIG_BOOTLOADER_UBOOT=x6818_config BS_CONFIG_KERNEL=x6818_defconfig BS_CONFIG_FILESYSTEM=PRODUCT-x6818-userdebug BS_CONFIT_BUILDROOT=x6818_defconfig setup_environment() { LANG=C cd${BS_DIR_TOP}; mkdir-p out/host/linux-x86/bin || return 1; mkdir-p ${BS_DIR_TARGET}/boot; [-f "${BS_DIR_TOP}/out/host/linux-x86/bin/mkuserimg.sh" ] ||{ echo"tar generate boot.img tools"; tar xvf tools/generate_boot.tar.gz -C${BS_DIR_TOP}/out/host/linux-x86/bin;} [-f "${BS_DIR_TARGET}/boot/root.img.gz" ] ||{ echo "tarboot.tar.gz"; tar xvf tools/boot.tar.gz -C ${BS_DIR_TARGET};} PATH=${BS_DIR_TOP}/out/host/linux-x86/bin:$PATH; mkdir-p ${BS_DIR_RELEASE} || return 1 } build_bootloader_uboot() { #Compiler uboot cd${BS_DIR_UBOOT} || return 1 makedistclean CROSS_COMPILE=${BS_CROSS_TOOLCHAIN_BOOTLOADER} || return 1 cp${BS_DIR_UBOOT}/board/s5p6818/x6818/x6818_lcd.mk${BS_DIR_UBOOT}/board/s5p6818/x6818/fastboot_lcd.o cp${BS_DIR_UBOOT}/arch/arm/cpu/slsiap/devices/x6818_pmic.mk${BS_DIR_UBOOT}/arch/arm/cpu/slsiap/devices/axp228_mfd.o make${BS_CONFIG_BOOTLOADER_UBOOT} CROSS_COMPILE=${BS_CROSS_TOOLCHAIN_BOOTLOADER} ||return 1 make-j${threads} CROSS_COMPILE=${BS_CROSS_TOOLCHAIN_BOOTLOADER} || return 1 #Copy bootloader to release directory cp-v ${BS_DIR_UBOOT}/ubootpak.bin ${BS_DIR_RELEASE} cp-v ${BS_DIR_UBOOT}/readme.txt ${BS_DIR_RELEASE} cp-v ${BS_DIR_UBOOT}/env.txt ${BS_DIR_RELEASE} cp-v ${BS_DIR_UBOOT}/x6818-sdmmc.sh ${BS_DIR_RELEASE} echo"^_^ uboot path: ${BS_DIR_RELEASE}/ubootpak.bin" return0 } build_kernel() { exportPATH=${BS_DIR_UBOOT}/tools:$PATH #Compiler kernel cd${BS_DIR_KERNEL} || return 1 make${BS_CONFIG_KERNEL} ARCH=arm CROSS_COMPILE=${BS_CROSS_TOOLCHAIN_KERNEL} ||return 1 make-j${threads} ARCH=arm CROSS_COMPILE=${BS_CROSS_TOOLCHAIN_KERNEL} || return 1 make-j${threads} ARCH=arm CROSS_COMPILE=${BS_CROSS_TOOLCHAIN_KERNEL} uImage ||return 1 #Copy uImage to release directory cp-v ${BS_DIR_KERNEL}/arch/arm/boot/uImage ${BS_DIR_RELEASE} echo"^_^ kernel path: ${BS_DIR_RELEASE}/uImage" #generate boot.img cd${BS_DIR_TOP} || return 1 echo'boot.img ->' ${BS_DIR_RELEASE} #Make boot.img with ext4 format, 64MB cp-v ${BS_DIR_RELEASE}/uImage ${BS_DIR_TARGET}/boot mkuserimg.sh-s ${BS_DIR_TARGET}/boot ${BS_DIR_TARGET}/boot.img ext4 boot 67108864 cp-av ${BS_DIR_TARGET}/boot.img ${BS_DIR_RELEASE} || return 1; return0 } build_system() { cd${BS_DIR_TOP} || return 1 sourcebuild/envsetup.sh || return 1 make-j${threads} ${BS_CONFIG_FILESYSTEM} || return 1 #Make boot.img #Create boot directory mkdir-p ${BS_DIR_TARGET}/boot || return 1 #Copy some images to boot directory if[ -f ${BS_DIR_RELEASE}/uImage ]; then cp-v ${BS_DIR_RELEASE}/uImage ${BS_DIR_TARGET}/boot fi if[ -f ${BS_DIR_TARGET}/ramdisk.img ]; then cp-v ${BS_DIR_TARGET}/ramdisk.img ${BS_DIR_TARGET}/boot/root.img.gz fi if[ -f ${BS_DIR_TARGET}/ramdisk-recovery.img ]; then cp-v ${BS_DIR_TARGET}/ramdisk-recovery.img ${BS_DIR_TARGET}/boot fi #Make boot.img with ext4 format, 64MB mkuserimg.sh-s ${BS_DIR_TARGET}/boot ${BS_DIR_TARGET}/boot.img ext4 boot 67108864 #Copy to release directory cp-av ${BS_DIR_TARGET}/boot.img ${BS_DIR_RELEASE} || return 1; cp-av ${BS_DIR_TARGET}/system.img ${BS_DIR_RELEASE} || return 1; cp-av ${BS_DIR_TARGET}/cache.img ${BS_DIR_RELEASE} || return 1; cp-av ${BS_DIR_TARGET}/recovery.img ${BS_DIR_RELEASE} || return 1; cp-av ${BS_DIR_TARGET}/userdata.img ${BS_DIR_RELEASE} || return 1; return0 } build_buildroot() { #Compiler buildroot cd${BS_DIR_BUILDROOT} || return 1 make${BS_CONFIT_BUILDROOT} || return 1 make|| return 1 #Copy image to release directory cp-v ${BS_DIR_BUILDROOT}/output/images/rootfs.ext4 ${BS_DIR_RELEASE}/qt-rootfs.img cp-v ${BS_DIR_BUILDROOT}/qt-documents.txt ${BS_DIR_RELEASE} } threads=1 uboot=no kernel=no system=no buildroot=no if [ -z $1 ]; then uboot=yes kernel=yes system=yes buildroot=yes fi while [ "$1" ]; do case "$1" in -j=*) x=$1 threads=${x#-j=} ;; -u|--uboot) uboot=yes ;; -k|--kernel) kernel=yes ;; -s|--system) system=yes ;; -b|--buildroot) buildroot=yes ;; -a|--all) uboot=yes kernel=yes system=yes buildroot=yes ;; -h|--help) cat >&2 < Usage: build.sh [OPTION] Build script for compile the source oftelechips project. -j=n using nthreads when building source project (example: -j=16) -u,--uboot build bootloader ubootfrom source -k,--kernel build kernel from source -s,--system build android filesystem from source -b,--buildroot build buildroot filesystem for QT platform -a,--all build all, includeanything -h,--help display this help andexit EOF exit 0 ;; *) echo "build.sh: Unrecognised option$1" >&2 exit 1 ;; esac shift done setup_environment || exit 1 if [ "${uboot}" = yes ]; then build_bootloader_uboot|| exit 1 fi if [ "${kernel}" = yes ]; then build_kernel|| exit 1 fi if [ "${system}" = yes ]; then build_system|| exit 1 fi if [ "${buildroot}" = yes ]; then build_buildroot|| exit 1 fi exit 0 cp arch/arm/configs/x6818_defconfig .config make menuconfig ARCH=armCROSS_COMPILE=arm-none-linux-gnueabi- make ARCH=armCROSS_COMPILE=arm-none-linux-gnueabi- uImage –j4 |
|
相关推荐
|
|
557 浏览 1 评论
飞凌嵌入式ElfBoard ELF 1板卡-spi编程示例之spi编写程序
472 浏览 0 评论
飞凌嵌入式-ELFBOARD 4.3吋电容触摸液晶模块简介第三期 :机械机构说明
655 浏览 0 评论
飞凌嵌入式ElfBoard ELF 1板卡-i2c与从设备通讯编程示例之开发板测试
1336 浏览 0 评论
ubuntu ping 开发板存在严重的丢包情况,请问该怎么解决?
2457 浏览 1 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-8 16:35 , Processed in 0.621389 second(s), Total 69, Slave 51 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号