X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=scripts%2Fhvk-compile.sh;h=f9076d30ba1225445ca1de7af229e016ef9d236f;hb=1fb7f27af45bc56ba87fd9ad73751fcafb332ee3;hp=11b2ce6833159d2e66c9875e2657172066aa9bd7;hpb=a5da940f226a74aba1c50279d04b37897beeec63;p=hvutilities.git diff --git a/scripts/hvk-compile.sh b/scripts/hvk-compile.sh index 11b2ce6..f9076d3 100755 --- a/scripts/hvk-compile.sh +++ b/scripts/hvk-compile.sh @@ -4,6 +4,58 @@ SCRIPT="`readlink -e $0`" SCRIPTPATH=$(dirname ${SCRIPT}) source ${SCRIPTPATH}/hvk-common.sh +print_usage() +{ + echo "${PROG_NAME} -- U-Boot/kernel compile script" + echo "Usage: ${PROG_NAME} [OPTIONS...] [IP ADDRESS]" + echo + echo "Options:" + echo " -h display this help and exit" + echo " -r reboot after deploying files" + echo " -w compile with W=1" + echo +} + +reboot=0 +warnings_opts="" + +while getopts "hrw" flag ;do + case ${flag} in + h) + print_usage + exit 0 + ;; + r) + reboot=1 + ;; + w) + warnings_opts="W=1" + ;; + ?) + echo "${PROG_NAME}: Invalid option: ${OPTARG}." + echo "Try \`${PROG_NAME} -h' for more information." + exit 1 + ;; + esac +done +shift `expr "${OPTIND}" - 1` + +# `$#' now represents the number of arguments after the options. +# `$1' is the first argument, etc. +if [ $# -gt 1 ]; then + echo "${PROG_NAME}: Too many arguments." + echo "Try \`${PROG_NAME} -h' for more information." + exit 1 +fi + +if [ ! -f .config ]; then + echo "Missing configuration file .config." + echo "Configure your kernel by running 'hvk-init.sh'" + exit 1 +fi + +KMAKE="${KMAKE} ${warnings_opts}" + ${KMAKE} if [ x"${mode}" = x"linux" ]; then @@ -36,5 +88,9 @@ if [ ${#} -eq 1 ]; then rm /tmp/modules.tar.gz # Switch to latest kernel and DTB: - ssh root@${EVK_IP} "fw_setenv image Image-latest; fw_setenv fdt_file latest.dtb" + ssh root@${EVK_IP} "sed -i -e 's@^DEFAULT.*@DEFAULT test@' /boot/extlinux/extlinux.conf" + + if [ x"${reboot}" = x"1" ]; then + ssh root@${EVK_IP} "reboot" + fi fi