more friendly --parameters to configure the execution of the script

This commit is contained in:
Gwenhael Le Moine 2014-02-28 08:23:39 +01:00
parent 2a8768d10c
commit a1832a9004
2 changed files with 67 additions and 1 deletions

View file

@ -1,7 +1,7 @@
# --- TODO # --- TODO
* TODO [#A] offer pre-built binaries * TODO [#A] offer pre-built binaries
* TODO [#A] configure by passing --parameters * DONE [#A] configure by passing --parameters
* TODO [#A] reinstall mpfr and/or aaa_elflids to fix missing libmpfr...so * TODO [#A] reinstall mpfr and/or aaa_elflids to fix missing libmpfr...so
* DONE [#B] UNTESTED allow for running on ARM host * DONE [#B] UNTESTED allow for running on ARM host
* TODO [#B] build rootfs from slackwarearm-current * TODO [#B] build rootfs from slackwarearm-current

View file

@ -19,6 +19,72 @@ ROOTFS_VERSION=${ROOTFS_VERSION:-04Nov13}
TOOLCHAIN_VERSION=${TOOLCHAIN_VERSION:-4.8-2013.10} TOOLCHAIN_VERSION=${TOOLCHAIN_VERSION:-4.8-2013.10}
TOOLCHAIN_URL_RANDOM_NUMBER=${TOOLCHAIN_URL_RANDOM_NUMBER:-155358238} TOOLCHAIN_URL_RANDOM_NUMBER=${TOOLCHAIN_URL_RANDOM_NUMBER:-155358238}
# commandline arguments processing
while [ "x$1" != "x" ]
do
case "$1" in
-c | --compile )
shift
COMPILE="true"
;;
-dc | --dont-compile )
shift
COMPILE="false"
;;
-d | --display )
shift
CUBIETRUCK_DISPLAY=$1
shift
;;
-n | --image-name )
shift
IMG_NAME=$1
shift
;;
-r | --rootfs-version )
shift
ROOTFS_VERSION=$1
shift
;;
-o | --output )
shift
DEST=$1
shift
;;
-v | --image-version )
shift
VERSION=$1
shift
;;
-xv | --toolchain-version )
shift
TOOLCHAIN_VERSION=$1
shift
;;
-xumn | --toolchain-url-magic-number )
shift
TOOLCHAIN_URL_RANDOM_NUMBER=$1
shift
;;
-h | --help )
echo -e "Usage: run as root: $0 <options>"
echo -e "Options:"
echo -e "\t-c | --compile"
echo -e "\t-dc | --dont-compile"
echo -e "\t-d | --display [\"HDMI\"|\"VGA\"] (default: $CUBIETRUCK_DISPLAY)"
echo -e "\t-n | --image-name [\"nom\"] (default: $IMG_NAME)"
echo -e "\t-r | --rootfs-version [\"version number\"] (default: $ROOTFS_VERSION)"
echo -e "\t-o | --output [/directory/] (default: $DEST)"
echo -e "\t-v | --image-version [\"version number\"] (default: $VERSION)"
echo -e "\t-xv | --toolchain-version [\"version number\"] (default: $TOOLCHAIN_VERSION)"
echo -e "\t-xumn | --toolchain-url-magic-number [\"magic number\"] (default: $TOOLCHAIN_URL_RANDOM_NUMBER)"
exit 0
;;
esac
done
# --- Script -------------------------------------------------------------------- # --- Script --------------------------------------------------------------------
CWD=$(pwd) CWD=$(pwd)