Android->FFTool:update make.sh

This commit is contained in:
cjp
2018-02-08 17:14:13 +08:00
parent 80da607b50
commit 78407d5bbd
2 changed files with 73 additions and 19 deletions

View File

@ -1,37 +1,91 @@
#!/bin/bash #!/bin/bash
set -e
usage() usage()
{ {
echo "usage: $(basename $0) [-j make_thread]" cat << EOF
usage:
$(basename $0) [-u|k|a] [-d dts_file_name] [-l lunch] [-j make_thread]
-u|k|a: make uboot|kernel|android alone, if this arg is not exist, make all images default
-d: kernel dts name
-l: lunch name when make android
-j: make theard num, if have not this arg, default theard is 1
NOTE: Run in the path of SDKROOT
EOF
if [ ! -z $1 ] ; then
exit $1
fi
} }
MAKE_THEARD=1 MAKE_THEARD=1
while getopts "j:" arg KERNEL_DTS='firefly-rk3288'
USER_LUNCH='rk3288_box-userdebug'
MAKE_MODULES=''
MAKE_ALL=true
while getopts "ukahj:d:l:" arg
do do
case $arg in case $arg in
u|k|a)
MAKE_MODULES=$arg
MAKE_ALL=false
;;
j) j)
MAKE_THEARD=$OPTARG MAKE_THEARD=$OPTARG
;; ;;
?) #当有不认识的选项的时候arg为? d)
usage KERNEL_DTS=$OPTARG
exit 1 ;;
l)
USER_LUNCH=$OPTARG
;;
h)
usage 0
;;
?)
usage 1
;; ;;
esac esac
done done
pushd u-boot/ FFTOOLS_PATH=$(dirname $0)
make rk3288_box_defconfig
make -j $MAKE_THEARD
popd
pushd kernel/ if $MAKE_ALL || [ $MAKE_MODULES = 'u' ]; then
make firefly-rk3288_defconfig pushd u-boot/
make firefly-rk3288.img -j $MAKE_THEARD rm -f *_loader_*.bin
popd make rk3288_defconfig
make -j $MAKE_THEARD
popd
fi
source build.sh if $MAKE_ALL || [ $MAKE_MODULES = 'k' ]; then
make installclean pushd kernel/
make -j $MAKE_THEARD if [ ! -f "arch/arm/configs/${KERNEL_DTS}_defconfig" ]; then
./mkimage.sh if [ `echo ${KERNEL_DTS} | grep -c AIO` == 1 ]; then
make firefly-rk3288-AIO_defconfig
elif [ `echo ${KERNEL_DTS} | grep -c reload` == 1 ]; then
make firefly-rk3288-reload_defconfig
else
make firefly-rk3288_defconfig
fi
else
make ${KERNEL_DTS}_defconfig
fi
echo "FireFly build Android finish!" make "${KERNEL_DTS}.img" -j $MAKE_THEARD
popd
fi
if $MAKE_ALL || [ $MAKE_MODULES = 'a' ]; then
source build.sh
lunch "$USER_LUNCH"
make installclean
make -j $MAKE_THEARD
./mkimage.sh
fi
echo "Firefly-RK3288 make images finish!"

View File

@ -9,7 +9,7 @@ usage:
$(basename $0) [-n update_img_name] [-l lunch] $(basename $0) [-n update_img_name] [-l lunch]
-l: lunch name when make android -l: lunch name when make android
-n: dest update.img name, if have not this arg, there are an default name, like: -n: dest update.img name, if have not this arg, there are an default name, like:
Firefly-RK3399_Android6.0_YYMMDD Firefly-RK3288_Android5.1_YYMMDD
NOTE: Run in the path of SDKROOT NOTE: Run in the path of SDKROOT
EOF EOF