summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuli Piippo <samuli.piippo@digia.com>2014-10-07 13:51:03 +0300
committerSamuli Piippo <samuli.piippo@digia.com>2014-10-14 08:16:18 +0300
commiteb498abc47e8f01c77d27506fa430ac1fdbf6f44 (patch)
tree8dfa4f76dcc9af65f9fbb40428e0eb12e5decba5
parentabd189a666802ad8c1c6315eef9ef292169edcbd (diff)
downloadmeta-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>
-rwxr-xr-xb2qt-init-build-env6
-rwxr-xr-xscripts/setup-environment.sh (renamed from scripts/setup_environment.sh)42
2 files changed, 20 insertions, 28 deletions
diff --git a/b2qt-init-build-env b/b2qt-init-build-env
index 2deb8a4..0fa07ba 100755
--- a/b2qt-init-build-env
+++ b/b2qt-init-build-env
@@ -120,7 +120,7 @@ mirror() {
120 mkdir -p .repo/manifests 120 mkdir -p .repo/manifests
121 cp ${DIR}/scripts/manifest.xml .repo/manifests/ 121 cp ${DIR}/scripts/manifest.xml .repo/manifests/
122 MANIFEST="manifest.xml" 122 MANIFEST="manifest.xml"
123 ${REPO} init -u https://gerrit.googlesource.com/git-repo -m ${MANIFEST} -g all --mirror 123 ${REPO} init -u .repo/repo -m ${MANIFEST} -g all --mirror
124 ${REPO} sync 124 ${REPO} sync
125} 125}
126 126
@@ -139,14 +139,14 @@ init() {
139 else 139 else
140 MANIFEST="manifest.xml" 140 MANIFEST="manifest.xml"
141 fi 141 fi
142 ${REPO} init -u https://gerrit.googlesource.com/git-repo -m ${MANIFEST} -g "${GROUPS}" ${REFERENCE} 142 ${REPO} init -u .repo/repo -m ${MANIFEST} -g "${GROUPS}" ${REFERENCE}
143 ${REPO} sync 143 ${REPO} sync
144 144
145 if [ ! -e "sources/meta-b2qt" ]; then 145 if [ ! -e "sources/meta-b2qt" ]; then
146 ln -s ${DIR} sources/meta-b2qt 146 ln -s ${DIR} sources/meta-b2qt
147 fi 147 fi
148 148
149 cp ${DIR}/scripts/setup_environment.sh . 149 cp ${DIR}/scripts/setup-environment.sh .
150 150
151} 151}
152 152
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
24usage() {
25 echo "source setup-environment <build-dir>"
26}
27
28clean() {
29 unset BUILDDIR
30 unset TEMPLATECONF
31 unset LAYERSCONF
32}
33
34CWD=`pwd`
35
36while test -n "$1"; do 24while 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
47done 35done
48 36
49if [ -z "${BUILDDIR}" ]; then 37THIS_SCRIPT="setup-environment.sh"
50 usage 38if [ "$(basename $0)" = "${THIS_SCRIPT}" ]; then
51 return 1 39 echo "Error: This script needs to be sourced. Please run as '. $0'"
40 exit 1
52fi 41fi
53 42
43BUILDDIR=${BUILDDIR:-build-${MACHINE}}
44
54if [ -z "$MACHINE" ]; then 45if [ -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
58fi 48fi
59 49
60if [ ! -f ${CWD}/${BUILDDIR}/conf/bblayers.conf ]; then 50if [ ! -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
88fi 78fi
89 79
90export TEMPLATECONF=${CWD}/sources/meta-b2qt/conf 80export TEMPLATECONF="${PWD}/sources/meta-b2qt/conf"
91cd sources/poky 81. sources/poky/oe-init-build-env ${BUILDDIR}
92. ./oe-init-build-env ${CWD}/${BUILDDIR} 82
93clean 83unset BUILDDIR
84unset TEMPLATECONF
85unset LAYERSCONF