diff options
| author | Samuli Piippo <samuli.piippo@digia.com> | 2014-10-07 13:51:03 +0300 |
|---|---|---|
| committer | Samuli Piippo <samuli.piippo@digia.com> | 2014-10-14 08:16:18 +0300 |
| commit | eb498abc47e8f01c77d27506fa430ac1fdbf6f44 (patch) | |
| tree | 8dfa4f76dcc9af65f9fbb40428e0eb12e5decba5 /scripts | |
| parent | abd189a666802ad8c1c6315eef9ef292169edcbd (diff) | |
| download | meta-boot2qt-eb498abc47e8f01c77d27506fa430ac1fdbf6f44.tar.gz | |
Improvements to setup scripts
- use the already fetched .repo/repo as a workaround for repo tool's
mandatory -u argument
- rename environment-setup.sh script
- Add notice about correctly sourcing the environment-setup.sh script
Change-Id: I4ac3cf26ca30ae1c14474cf9fb15e65ebc0be3ac
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@digia.com>
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/setup-environment.sh (renamed from scripts/setup_environment.sh) | 42 |
1 files changed, 17 insertions, 25 deletions
diff --git a/scripts/setup_environment.sh b/scripts/setup-environment.sh index aaba070..2ff9e29 100755 --- a/scripts/setup_environment.sh +++ b/scripts/setup-environment.sh | |||
| @@ -21,22 +21,10 @@ | |||
| 21 | ## | 21 | ## |
| 22 | ############################################################################# | 22 | ############################################################################# |
| 23 | 23 | ||
| 24 | usage() { | ||
| 25 | echo "source setup-environment <build-dir>" | ||
| 26 | } | ||
| 27 | |||
| 28 | clean() { | ||
| 29 | unset BUILDDIR | ||
| 30 | unset TEMPLATECONF | ||
| 31 | unset LAYERSCONF | ||
| 32 | } | ||
| 33 | |||
| 34 | CWD=`pwd` | ||
| 35 | |||
| 36 | while test -n "$1"; do | 24 | while test -n "$1"; do |
| 37 | case "$1" in | 25 | case "$1" in |
| 38 | "--help" | "-h") | 26 | "--help" | "-h") |
| 39 | usage | 27 | echo "Usage: . $0 [build directory]" |
| 40 | return 0 | 28 | return 0 |
| 41 | ;; | 29 | ;; |
| 42 | *) | 30 | *) |
| @@ -46,18 +34,20 @@ while test -n "$1"; do | |||
| 46 | shift | 34 | shift |
| 47 | done | 35 | done |
| 48 | 36 | ||
| 49 | if [ -z "${BUILDDIR}" ]; then | 37 | THIS_SCRIPT="setup-environment.sh" |
| 50 | usage | 38 | if [ "$(basename $0)" = "${THIS_SCRIPT}" ]; then |
| 51 | return 1 | 39 | echo "Error: This script needs to be sourced. Please run as '. $0'" |
| 40 | exit 1 | ||
| 52 | fi | 41 | fi |
| 53 | 42 | ||
| 43 | BUILDDIR=${BUILDDIR:-build-${MACHINE}} | ||
| 44 | |||
| 54 | if [ -z "$MACHINE" ]; then | 45 | if [ -z "$MACHINE" ]; then |
| 55 | echo "MACHINE environment variable not defined" | 46 | echo "Error: MACHINE environment variable not defined" |
| 56 | clean | ||
| 57 | return 1 | 47 | return 1 |
| 58 | fi | 48 | fi |
| 59 | 49 | ||
| 60 | if [ ! -f ${CWD}/${BUILDDIR}/conf/bblayers.conf ]; then | 50 | if [ ! -f ${PWD}/${BUILDDIR}/conf/bblayers.conf ]; then |
| 61 | case ${MACHINE} in | 51 | case ${MACHINE} in |
| 62 | apalis-imx6) | 52 | apalis-imx6) |
| 63 | LAYERSCONF="bblayers.conf.toradex.sample" | 53 | LAYERSCONF="bblayers.conf.toradex.sample" |
| @@ -83,11 +73,13 @@ if [ ! -f ${CWD}/${BUILDDIR}/conf/bblayers.conf ]; then | |||
| 83 | ;; | 73 | ;; |
| 84 | esac | 74 | esac |
| 85 | 75 | ||
| 86 | mkdir -p ${CWD}/${BUILDDIR}/conf | 76 | mkdir -p ${PWD}/${BUILDDIR}/conf |
| 87 | cp ${CWD}/sources/meta-b2qt/conf/${LAYERSCONF} ${CWD}/${BUILDDIR}/conf/bblayers.conf | 77 | cp ${PWD}/sources/meta-b2qt/conf/${LAYERSCONF} ${PWD}/${BUILDDIR}/conf/bblayers.conf |
| 88 | fi | 78 | fi |
| 89 | 79 | ||
| 90 | export TEMPLATECONF=${CWD}/sources/meta-b2qt/conf | 80 | export TEMPLATECONF="${PWD}/sources/meta-b2qt/conf" |
| 91 | cd sources/poky | 81 | . sources/poky/oe-init-build-env ${BUILDDIR} |
| 92 | . ./oe-init-build-env ${CWD}/${BUILDDIR} | 82 | |
| 93 | clean | 83 | unset BUILDDIR |
| 84 | unset TEMPLATECONF | ||
| 85 | unset LAYERSCONF | ||
