images/build.sh | ●●●●● patch | view | raw | blame | history | |
yocto/build.sh | ●●●●● patch | view | raw | blame | history |
images/build.sh
@@ -12,6 +12,9 @@ # binaries finally install path if needed #INST_PATH=/tftp # compress system image or not COMPRESS=yes # download taballs path TARBALL_PATH=$PRJ_PATH/tarballs @@ -101,6 +104,7 @@ export UBOOT_BINPATH=$TOP_PATH/bootloader/install/ export KERNEL_BINPATH=$TOP_PATH/kernel/install/ export ROOTFS_YCTPATH=$TOP_PATH/yocto/install/ export IMAGE_NAME=${DIS_TYPE}-${DIS_VER}-${BSP_VER}.img if [[ $BOARD =~ mx8ulp ]] || [[ $BOARD =~ mx8mq ]] || [[ $BOARD =~ mx8mm ]] ; then export UBOOT_OFFSET_SECTOR=66 @@ -129,7 +133,7 @@ # Decompress the rootfs form Yocto build install path if [[ $DIS_TYPE == yocto ]] ; then for tarball in $ROOTFS_YCTPATH/*$BOARD*.${TAR_TYPE} for tarball in $ROOTFS_YCTPATH/*.${TAR_TYPE} do if [ -s $tarball ] ; then pr_warn "Decompress $ROOTFS from yocto install path" @@ -176,8 +180,6 @@ function build_image() { export IMAGE_NAME=$BOARD-$DIS_VER.img # Uboot size set be 10MB and deployed in 64th sector on eMMC/TFCard UBOOT_SIZE=10 @@ -224,7 +226,7 @@ cp -af $ROOTFS/* ${MNT_POINT} sync && umount ${MNT_POINT} pr_warn "Build $BOARD-$BSP_VER-$DIS_VER system image done" pr_warn "Build system image $IMAGE_NAME done" } function exit_handler() @@ -262,17 +264,22 @@ { cd $PRJ_PATH if [[ `echo $COMPRESS | tr 'A-Z' 'a-z'` == "yes" ]] ; then pr_info "Start bzip2 compress $IMAGE_NAME" rm -f $IMAGE_NAME.bz2 bzip2 $IMAGE_NAME fi mkdir -p $PRFX_PATH mv $IMAGE_NAME* $PRFX_PATH cp $UBOOT_BINPATH/u-boot-${BOARD}.imx $PRFX_PATH mv $IMAGE_NAME $PRFX_PATH if [[ -n "$INST_PATH" && -w $INST_PATH ]] ; then pr_info "install bootloader and system image to '$INST_PATH'" cp $PRFX_PATH/u-boot-${BOARD}.imx $INST_PATH cp $PRFX_PATH/$IMAGE_NAME $INST_PATH cp $PRFX_PATH/$IMAGE_NAME* $INST_PATH fi } function do_clean() { @@ -305,7 +312,7 @@ exit; fi pr_warn "Build $BOARD-$BSP_VER-$DIS_VER system image" pr_warn "Build system image $IMAGE_NAME" trap 'exit_handler' EXIT yocto/build.sh
@@ -185,14 +185,17 @@ function do_install() { IMAGE_NAME=yocto-${YCT_VER}-${BSP_VER}.wic ROOTFS_TAR=rootfs-yocto-${YCT_VER}.tar.zst cd $YCT_PATH echo "" pr_info "Yocto($YCT_VER) installed to '$PRFX_PATH'" mkdir -p ${PRFX_PATH} cp $YCT_PATH/$BUILD_DIR/tmp/deploy/images/$BOARD/$BB_TARGET-$BOARD.wic ${PRFX_PATH}/ cp $YCT_PATH/$BUILD_DIR/tmp/deploy/images/$BOARD/$BB_TARGET-$BOARD.tar.zst ${PRFX_PATH}/ cp $YCT_PATH/$BUILD_DIR/tmp/deploy/images/$BOARD/$BB_TARGET-$BOARD.wic ${PRFX_PATH}/$IMAGE_NAME cp $YCT_PATH/$BUILD_DIR/tmp/deploy/images/$BOARD/$BB_TARGET-$BOARD.tar.zst ${PRFX_PATH}/$ROOTFS_TAR if [[ $BOARD =~ mx6ull ]] ; then cp $YCT_PATH/$BUILD_DIR/tmp/deploy/images/$BOARD/u-boot-${BOARD}.imx ${PRFX_PATH}/u-boot-${BOARD}.imx @@ -203,9 +206,9 @@ cd ${PRFX_PATH}/ if [[ `echo $COMPRESS | tr 'A-Z' 'a-z'` == "yes" ]] ; then pr_info "Start bzip2 compress $BB_TARGET-$BOARD.wic" rm -f $BB_TARGET-$BOARD.wic.bz2 bzip2 $BB_TARGET-$BOARD.wic pr_info "Start bzip2 compress $IMAGE_NAME" rm -f $IMAGE_NAME.bz2 bzip2 $IMAGE_NAME fi chmod a+x u-boot-${BOARD}.imx @@ -215,8 +218,8 @@ pr_info "Start copy Yocto system images to $INST_PATH" cp u-boot-${BOARD}.imx $INST_PATH cp $BB_TARGET-$BOARD.wic* $INST_PATH cp $BB_TARGET-$BOARD.tar.zst $INST_PATH cp $IMAGE_NAME* $INST_PATH cp $ROOTFS_TAR $INST_PATH ls ${INST_PATH} && echo "" fi