summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Savoye <rob.savoye@linaro.org>2015-04-21 11:46:22 -0600
committerFathi Boudra <fathi.boudra@linaro.org>2015-04-22 11:04:07 +0300
commit3c91afd54aa45daa5aa7db06a267ce72d8554dc3 (patch)
tree861681ee6ea9e4208235a3a8a5698baae067edc5
parent072596b2024953c11ea8b4f52672396413e2a486 (diff)
Use base_dir variable instead of hardcoded path for base directory.
Use basename instead of cut for external toolchain path parsing to be more flexible. Change-Id: Ia427b88cc5e97cc147591bfcb03df666990f7f6d Signed-off-by: Robert Savoye <rob.savoye@linaro.org>
-rwxr-xr-xfunctions.sh24
-rwxr-xr-xinit-and-build.sh3
-rwxr-xr-xperiodic-cleanup.sh3
-rwxr-xr-xpost-build-manage-buildhistory.sh3
-rwxr-xr-xpost-build-sort-out-downloads.sh2
-rwxr-xr-xpre-build-do-cleanup.sh8
6 files changed, 24 insertions, 19 deletions
diff --git a/functions.sh b/functions.sh
index 89ea701..aa41759 100755
--- a/functions.sh
+++ b/functions.sh
@@ -206,14 +206,14 @@ conf_toolchain()
echo 'PNBLACKLIST[libgcc] = "Using external toolchain"' >>conf/site.conf
echo 'PNBLACKLIST[gcc-cross] = "Using external toolchain"' >>conf/site.conf
- tarball_name=`echo $external_url | cut -d "/" -f 8`
+ tarball_name=`basename $external_url`
if [ -z $tarball_name ] ; then
- tarball_name=`echo $external_url | cut -d "/" -f 7`
+ tarball_name=`basename $external_url`
fi
if [ -z $tarball_name ] ; then
- tarball_name=`echo $external_url | cut -d "/" -f 6`
+ tarball_name=`basename $external_url`
fi
mkdir -p toolchain
@@ -249,10 +249,10 @@ conf_toolchain()
conf_jenkins()
{
if [ -n "${WORKSPACE}" ]; then
- # As noted during jdk8 integration, toolchain has stubble ties to the build location. Thus in
+ # As noted during jdk8 integration, toolchain has subtle ties to the build location. Thus in
# jenkins use same tmpdir for all builds.
# XXX: make this tmpfs, 10G of ram should be enough
- echo 'TMPDIR = "/mnt/ci_build/workspace/tmp"' >>conf/site.conf
+ echo 'TMPDIR = "${base_dir}/workspace/tmp"' >>conf/site.conf
echo 'TCLIBCAPPEND = ""' >>conf/site.conf
fi
}
@@ -338,7 +338,7 @@ init_env()
# Enable some Linaro CI site specific options
init_env_linaro_ci()
{
- SSTATE_DIR="/mnt/ci_build/workspace/sstate-cache"
+ SSTATE_DIR="${base_dir}/workspace/sstate-cache"
if [ -n "$sstatedir" ]; then
SSTATE_DIR="${SSTATE_DIR}/$sstatedir"
@@ -348,7 +348,7 @@ init_env_linaro_ci()
SCONF_VERSION = "1"
# share downloads and sstate-cache between all builds
-DL_DIR = "/mnt/ci_build/workspace/downloads"
+DL_DIR = "${base_dir}/workspace/downloads"
SSTATE_DIR = "${SSTATE_DIR}"
BB_GENERATE_MIRROR_TARBALLS = "True"
@@ -371,12 +371,12 @@ This script initialize and run OpenEmbedded builds with Linaro settings.
OPTIONS:
-h Show this message
-a Target architecture (armv7a or armv8)
- -b manifest branch
- -m manifest groups
- -r manifest repository
- -g GCC version (4.7 or 4.8)
+ -b Manifest branch
+ -m Manifest groups
+ -r Manifest repository
+ -g GCC version (e.g. x.y)
-u External Linaro toolchain URL
- -i custom workspace init function
+ -i Custom workspace init function
-v Add -v[erbose] to bitbake invocation
EOF
}
diff --git a/init-and-build.sh b/init-and-build.sh
index 50ed596..eb97619 100755
--- a/init-and-build.sh
+++ b/init-and-build.sh
@@ -24,6 +24,7 @@ manifest_groups=
bitbake_verbose=
sstatedir=
binarytoolchain="aarch64-linux-gnu"
+base_dir="/mnt/ci_build"
export PATH=$PATH:$HOME/bin
@@ -69,7 +70,7 @@ done
shift $(( OPTIND-1 ))
if [ -n "${WORKSPACE}" ]; then
- WORKBASE=/mnt/ci_build/workspace
+ WORKBASE=${base_dir}/workspace
fi
show_setup
diff --git a/periodic-cleanup.sh b/periodic-cleanup.sh
index 9201373..b08dad8 100755
--- a/periodic-cleanup.sh
+++ b/periodic-cleanup.sh
@@ -17,9 +17,10 @@
# periodic maintainence for OE builders
job=soft
+base_dir="/mnt/ci_build"
source functions.sh
-WORKBASE=/mnt/ci_build/workspace
+WORKBASE=${base_dir}/workspace
while getopts “w:x:” OPTION
do
diff --git a/post-build-manage-buildhistory.sh b/post-build-manage-buildhistory.sh
index 5c4086f..afefef3 100755
--- a/post-build-manage-buildhistory.sh
+++ b/post-build-manage-buildhistory.sh
@@ -35,6 +35,7 @@ OPTIONS:
EOF
}
+base_dir="/mnt/ci_build"
while getopts “hb:r:v” OPTION
do
@@ -67,7 +68,7 @@ fi
buildhistory_dir=`find build -maxdepth 2 -type d -name buildhistory`
if [ ! -d $buildhistory_dir ]; then
- buildhistory_dir=`find /mnt/ci_build/workspace/tmp -type d -name buildhistory`
+ buildhistory_dir=`find ${base_dir}/workspace/tmp -type d -name buildhistory`
fi
if [ ! -z "$buildhistory_dir" ] && [ -d $buildhistory_dir ]; then
diff --git a/post-build-sort-out-downloads.sh b/post-build-sort-out-downloads.sh
index 9cd8394..eac194c 100755
--- a/post-build-sort-out-downloads.sh
+++ b/post-build-sort-out-downloads.sh
@@ -16,7 +16,7 @@ rm -rf ${WORKSPACE}/downloads
mkdir -p ${WORKSPACE}/downloads
pushd ${WORKSPACE}/downloads
-cp /mnt/ci_build/workspace/downloads/* .
+cp ${base_dir}/workspace/downloads/* .
rm *.done
# remove all sources which were already pushed
diff --git a/pre-build-do-cleanup.sh b/pre-build-do-cleanup.sh
index d3463c1..68861f8 100755
--- a/pre-build-do-cleanup.sh
+++ b/pre-build-do-cleanup.sh
@@ -12,19 +12,21 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>
+base_dir="/mnt/ci_build"
+
if [ -n "${WORKSPACE}" ]; then
# clean builds from all jobs to get disk space back
find ${WORKSPACE} -type d -name build | xargs rm -rf
# clean shared tmpdir
- rm -rf /mnt/ci_build/workspace/tmp || true
+ rm -rf ${base_dir}/workspace/tmp || true
# those should not exist but they may
find ${WORKSPACE} -type d -name downloads | xargs rm -rf
# || true as some of those dirs may not exist
du -hs ${WORKSPACE} \
- /mnt/ci_build/workspace/downloads \
- /mnt/ci_build/workspace/sstate-cache || true
+ ${base_dir}/workspace/downloads \
+ ${base_dir}/workspace/sstate-cache || true
df -h
fi