Update compile.sh

This commit is contained in:
zador-blood-stained 2016-07-27 13:37:23 +03:00
parent c7db88ad5c
commit c7b49e6667

View file

@ -10,33 +10,30 @@
# #
#-------------------------------------------------------------------------------------------------------------------------------- #--------------------------------------------------------------------------------------------------------------------------------
# Read build script documentation # Read build script documentation http://www.armbian.com/using-armbian-tools/
# http://www.armbian.com/using-armbian-tools/ # for detailed explanation of these options and for additional options not listed here
# for detailed explanation of these parameters
# method KERNEL_ONLY="" # leave empty to select each time, set to "yes" or "no" to skip dialog prompt
KERNEL_ONLY="" # leave empty to select each time, set to "yes" or "no" to skip dialog prompt KERNEL_CONFIGURE="no" # change provided kernel configuration
KERNEL_CONFIGURE="no" # want to change my default configuration CLEAN_LEVEL="make,debs" # comma-separated list of clean targets: "make" = make clean for selected kernel and u-boot,
CLEAN_LEVEL="make,debs" # comma-separated list of clean targets: "make" = make clean for selected kernel and u-boot, # "debs" = delete packages in "./output/debs" for current branch and family,
# "debs" = delete packages in "./output/debs" for current branch and family, # "alldebs" - delete all packages in "./output/debs", "images" = delete "./output/images",
# "alldebs" - delete all packages in "./output/debs", "images" = delete "./output/images", # "cache" = delete "./output/cache", "sources" = delete "./sources"
# "cache" = delete "./output/cache", "sources" = delete "./sources"
# user DEST_LANG="en_US.UTF-8" # sl_SI.UTF-8, en_US.UTF-8
DEST_LANG="en_US.UTF-8" # sl_SI.UTF-8, en_US.UTF-8
CONSOLE_CHAR="UTF-8"
# advanced # advanced
KERNEL_KEEP_CONFIG="no" # overwrite kernel config before compilation KERNEL_KEEP_CONFIG="no" # do not overwrite kernel config before compilation
EXTERNAL="yes" # build and install extra applications and drivers EXTERNAL="yes" # build and install extra applications and drivers
DEBUG_MODE="no" # wait that you make changes to uboot and kernel source and creates patches DEBUG_MODE="no" # wait that you make changes to uboot and kernel source and creates patches
FORCE_CHECKOUT="yes" # ignore manual changes to source FORCE_CHECKOUT="yes" # ignore manual changes to source
BUILD_ALL="no" # cycle through available boards and make images or kernel/u-boot packages. BUILD_ALL="no" # cycle through available boards and make images or kernel/u-boot packages.
# set KERNEL_ONLY to "yes" or "no" to build all kernels/all images # set KERNEL_ONLY to "yes" or "no" to build all packages/all images
# build script version to use # build script version to use
LIB_TAG="" # empty for latest version, LIB_TAG="" # empty for latest version,
# one of listed here: https://github.com/igorpecovnik/lib/tags for stable versions, # one of listed here: https://github.com/igorpecovnik/lib/tags for stable versions,
# or commit hash # or commit hash
#-------------------------------------------------------------------------------------------------------------------------------- #--------------------------------------------------------------------------------------------------------------------------------
# source is where compile.sh is located # source is where compile.sh is located
@ -51,23 +48,13 @@ SOURCES=$SRC/sources
#-------------------------------------------------------------------------------------------------------------------------------- #--------------------------------------------------------------------------------------------------------------------------------
if [[ -f $SRC/main.sh && -d $SRC/bin ]]; then if [[ -f $SRC/main.sh && -d $SRC/bin ]]; then
echo -e "[\e[0;31m error \x1B[0m] Copy this file one level up, alter and run again." echo -e "[\e[0;31m error \x1B[0m] Copy this file one level up, alter and run again."
exit exit -1
fi
#--------------------------------------------------------------------------------------------------------------------------------
# Show warning for those who updated the script
#--------------------------------------------------------------------------------------------------------------------------------
if [[ -d $DEST/output ]]; then
echo -e "[\e[0;35m warn \x1B[0m] Structure has been changed. Remove all files and start in a clean directory. \
CTRL-C to exit or any key to continue. Only sources will be doubled ..."
read
fi fi
if [[ $EUID != 0 ]]; then if [[ $EUID != 0 ]]; then
echo -e "[\e[0;35m warn \x1B[0m] This script requires root privileges" echo -e "[\e[0;35m warn \x1B[0m] This script requires root privileges"
sudo "$0" "$@" sudo "$0" "$@"
exit 1 exit $?
fi fi
#-------------------------------------------------------------------------------------------------------------------------------- #--------------------------------------------------------------------------------------------------------------------------------
@ -85,16 +72,17 @@ if [[ ! -f $SRC/.ignore_changes ]]; then
git pull git pull
CHANGED_FILES=$(git diff --name-only) CHANGED_FILES=$(git diff --name-only)
if [[ -n $CHANGED_FILES ]]; then if [[ -n $CHANGED_FILES ]]; then
echo -e "[\e[0;35m warn \x1B[0m] Can't update [\e[0;33mlib/\x1B[0m] since you made changes to: \e[0;32m\n${CHANGED_FILES}\x1B[0m" echo -e "[\e[0;35m warn \x1B[0m] Can't update since you made changes to: \e[0;32m\n${CHANGED_FILES}\x1B[0m"
echo -e "Press \e[0;33m<Ctrl-C>\x1B[0m to abort compilation, \e[0;33m<Enter>\x1B[0m to ignore and continue" echo -e "Press \e[0;33m<Ctrl-C>\x1B[0m to abort compilation, \e[0;33m<Enter>\x1B[0m to ignore and continue"
read read
else else
git checkout ${LIB_TAG:- master} git checkout ${LIB_TAG:- master}
fi fi
fi fi
#--------------------------------------------------------------------------------------------------------------------------------
# Do we need to build all images # source additional configuration file
#-------------------------------------------------------------------------------------------------------------------------------- [[ -n $1 && -f $SRC/config-$1.conf ]] && source $SRC/config-$1.conf
if [[ $BUILD_ALL == yes || $BUILD_ALL == demo ]]; then if [[ $BUILD_ALL == yes || $BUILD_ALL == demo ]]; then
source $SRC/lib/build-all.sh source $SRC/lib/build-all.sh
else else
@ -103,4 +91,4 @@ fi
# If you are committing new version of this file, increment VERSION # If you are committing new version of this file, increment VERSION
# Only integers are supported # Only integers are supported
# VERSION=19 # VERSION=20