common: build.sh: add cleanall command. modify usage to discribe all command
Change-Id: I84a0ac25ae1c43352b3143b4187d8576b4fd9f44
This commit is contained in:
@ -31,7 +31,12 @@ usage()
|
|||||||
echo "ros -build ros rootfs"
|
echo "ros -build ros rootfs"
|
||||||
echo "debian -build debian rootfs"
|
echo "debian -build debian rootfs"
|
||||||
echo "pcba -build pcba"
|
echo "pcba -build pcba"
|
||||||
|
echo "recovery -build recovery"
|
||||||
echo "all -build uboot, kernel, rootfs, recovery image"
|
echo "all -build uboot, kernel, rootfs, recovery image"
|
||||||
|
echo "cleanall -clean uboot, kernel, rootfs, recovery"
|
||||||
|
echo "firmware -pack all the image we need to boot up system"
|
||||||
|
echo "updateimg -pack update image"
|
||||||
|
echo "save -save images, patches, commands used to debug"
|
||||||
echo "default -build all modules"
|
echo "default -build all modules"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -151,15 +156,19 @@ function build_all(){
|
|||||||
echo "TARGET_RECOVERY_CONFIG=$CFG_RECOVERY"
|
echo "TARGET_RECOVERY_CONFIG=$CFG_RECOVERY"
|
||||||
echo "TARGET_PCBA_CONFIG=$CFG_PCBA"
|
echo "TARGET_PCBA_CONFIG=$CFG_PCBA"
|
||||||
echo "============================================"
|
echo "============================================"
|
||||||
# clean uboot and kernel before build all
|
|
||||||
#cd $TOP_DIR/u-boot/ && make distclean && cd -
|
|
||||||
#cd $TOP_DIR/kernel && make distclean && cd -
|
|
||||||
build_uboot
|
build_uboot
|
||||||
build_kernel
|
build_kernel
|
||||||
build_rootfs
|
build_rootfs
|
||||||
build_recovery
|
build_recovery
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function clean_all(){
|
||||||
|
echo "clean uboot, kernel, rootfs, recovery"
|
||||||
|
cd $TOP_DIR/u-boot/ && make distclean && cd -
|
||||||
|
cd $TOP_DIR/kernel && make distclean && cd -
|
||||||
|
rm -rf buildroot/out
|
||||||
|
}
|
||||||
|
|
||||||
function build_firmware(){
|
function build_firmware(){
|
||||||
# mkfirmware.sh to genarate image
|
# mkfirmware.sh to genarate image
|
||||||
./mkfirmware.sh $BOARD_CONFIG
|
./mkfirmware.sh $BOARD_CONFIG
|
||||||
@ -172,9 +181,8 @@ function build_firmware(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
function build_updateimg(){
|
function build_updateimg(){
|
||||||
IMAGE_PATH=$TOP_DIR/rockdev/Image-$TARGET_PRODUCT
|
IMAGE_PATH=$TOP_DIR/rockdev
|
||||||
PACK_TOOL_DIR=$TOP_DIR/tools/linux/Linux_Pack_Firmware
|
PACK_TOOL_DIR=$TOP_DIR/tools/linux/Linux_Pack_Firmware
|
||||||
cp -f $IMAGE_PATH/* $PACK_TOOL_DIR/rockdev/Image/
|
|
||||||
|
|
||||||
echo "Make update.img"
|
echo "Make update.img"
|
||||||
cd $PACK_TOOL_DIR/rockdev && ./mkupdate.sh && cd -
|
cd $PACK_TOOL_DIR/rockdev && ./mkupdate.sh && cd -
|
||||||
@ -184,11 +192,10 @@ function build_updateimg(){
|
|||||||
echo "Make update image failed!"
|
echo "Make update image failed!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
mv $PACK_TOOL_DIR/rockdev/update.img $IMAGE_PATH/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function build_save(){
|
function build_save(){
|
||||||
IMAGE_PATH=$TOP_DIR/rockdev/Image-$TARGET_PRODUCT
|
IMAGE_PATH=$TOP_DIR/rockdev
|
||||||
DATE=$(date +%Y%m%d.%H%M)
|
DATE=$(date +%Y%m%d.%H%M)
|
||||||
STUB_PATH=Image/"$KERNEL_DTS"_"$DATE"_RELEASE_TEST
|
STUB_PATH=Image/"$KERNEL_DTS"_"$DATE"_RELEASE_TEST
|
||||||
STUB_PATH="$(echo $STUB_PATH | tr '[:lower:]' '[:upper:]')"
|
STUB_PATH="$(echo $STUB_PATH | tr '[:lower:]' '[:upper:]')"
|
||||||
@ -255,6 +262,12 @@ elif [ $BUILD_TARGET == firmware ];then
|
|||||||
elif [ $BUILD_TARGET == save ];then
|
elif [ $BUILD_TARGET == save ];then
|
||||||
build_save
|
build_save
|
||||||
exit 0
|
exit 0
|
||||||
|
elif [ $BUILD_TARGET == cleanall ];then
|
||||||
|
clean_all
|
||||||
|
exit 0
|
||||||
|
elif [ $BUILD_TARGET == --help ] || [ $BUILD_TARGET == help ] || [ $BUILD_TARGET == -h ];then
|
||||||
|
usage
|
||||||
|
exit 0
|
||||||
elif [ $BUILD_TARGET != allsave ];then
|
elif [ $BUILD_TARGET != allsave ];then
|
||||||
echo "Can't found build config, please check again"
|
echo "Can't found build config, please check again"
|
||||||
usage
|
usage
|
||||||
|
|||||||
Reference in New Issue
Block a user