summaryrefslogtreecommitdiff
path: root/recipes-bsp
diff options
context:
space:
mode:
authorJan Remmet <j.remmet@phytec.de>2016-01-07 14:56:35 +0100
committerStefan Müller-Klieser <s.mueller-klieser@phytec.de>2016-01-18 09:24:12 +0100
commit31e46a46bfad637908edfab5fec1cf8cbf263844 (patch)
tree1fb7b66784a5f1f619f70d932d7bb7af150bbc75 /recipes-bsp
parent99e1cfdfca35d775fc04840b0ab6ee191f6fef05 (diff)
downloadmeta-phytec-31e46a46bfad637908edfab5fec1cf8cbf263844.tar.bz2
meta-phytec-31e46a46bfad637908edfab5fec1cf8cbf263844.zip
barebox: cleanup environment in prepare_env
Start with clean environment directory and install "far" only if debug-tweaks are set. Signed-off-by: Jan Remmet <j.remmet@phytec.de> Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de>
Diffstat (limited to 'recipes-bsp')
-rw-r--r--recipes-bsp/barebox/barebox.inc13
1 files changed, 11 insertions, 2 deletions
diff --git a/recipes-bsp/barebox/barebox.inc b/recipes-bsp/barebox/barebox.inc
index 3507386..e68a3cd 100644
--- a/recipes-bsp/barebox/barebox.inc
+++ b/recipes-bsp/barebox/barebox.inc
@@ -16,7 +16,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=057bf9e50e1ca857d0eb97bfe4ba8e5d"
SRC_URI = "http://barebox.org/download/barebox-${PV}.tar.bz2"
SRC_URI_append = " \
file://0001-Makefile-add-TARGETCC.patch \
- ${@bb.utils.contains("EXTRA_IMAGE_FEATURES", "debug-tweaks", "file://far.env.bin", "", d)} \
+ file://far.env.bin \
"
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
@@ -71,6 +71,14 @@ do_configure_append() {
python do_prepare_env() {
import shutil, subprocess
S = d.getVar('S', True)
+ bb.note("cleanup environment in source directory")
+ source_env_dirs = [ oe.path.join(S, '.machineenv'),
+ oe.path.join(S, '.boardenv'),
+ oe.path.join(S, '.commonenv') ]
+ for env_dir in source_env_dirs:
+ if os.path.isdir(env_dir):
+ oe.path.remove(env_dir)
+
machine_env_dir = d.getVar('BAREBOX_MACHINE_ENVDIR', True)
board_env_dir = d.getVar('BAREBOX_BOARD_ENVDIR', True)
common_env_dir = d.getVar('BAREBOX_COMMON_ENVDIR', True)
@@ -88,7 +96,8 @@ python do_prepare_env() {
# added, if you enable "debug-tweaks" in EXTRA_IMAGE_FEATURES in your
# local.conf.
workdir_far_env_bin = os.path.join("${WORKDIR}", "far.env.bin")
- if os.path.isfile(workdir_far_env_bin):
+ if os.path.isfile(workdir_far_env_bin) and \
+ bb.utils.contains('EXTRA_IMAGE_FEATURES', 'debug-tweaks', True, False, d):
bb.utils.mkdirhier(os.path.join(S, ".commonenv/bin"))
shutil.copyfile(workdir_far_env_bin,
os.path.join(S, ".commonenv/bin", "far"))