diff --git a/build.sh b/build.sh old mode 100644 new mode 100755 index 0d7987c..6fda77a --- a/build.sh +++ b/build.sh @@ -132,7 +132,8 @@ function cleanup_build() { } function usage() { - echo "Usage: $0 build/clean" + echo "Usage: $0 \n" + echo "Here can be: linux, opensbi, uboot, rootfs, img, linux_opensbi_uboot, all or clean." } function fault() { @@ -141,34 +142,31 @@ function fault() { } function main() { + echo $# if [[ $# < 1 ]]; then fault fi - if [ "$1" = "build" ]; then - if [ "$2" = "linux" ]; then - build_linux - elif [ "$2" = "opensbi" ]; then - build_opensbi - elif [ "$2" = "uboot" ]; then - build_uboot - elif [ "$2" = "rootfs" ]; then - build_rootfs - elif [ "$2" = "img" ]; then - build_img - elif [ "$2" = "linux_opensbi_uboot" ]; then - build_linux - build_opensbi - build_uboot - elif [ "$2" = "all" ]; then - build_linux - build_opensbi - build_uboot - build_rootfs - build_img - else - fault - fi + if [ "$1" = "linux" ]; then + build_linux + elif [ "$1" = "opensbi" ]; then + build_opensbi + elif [ "$1" = "uboot" ]; then + build_uboot + elif [ "$1" = "rootfs" ]; then + build_rootfs + elif [ "$1" = "img" ]; then + build_img + elif [ "$1" = "linux_opensbi_uboot" ]; then + build_linux + build_opensbi + build_uboot + elif [ "$1" = "all" ]; then + build_linux + build_opensbi + build_uboot + build_rootfs + build_img elif [ "$1" = "clean" ]; then cleanup_build else