summaryrefslogtreecommitdiff
path: root/recipes-bsp
diff options
context:
space:
mode:
authorStefan Christ <s.christ@phytec.de>2015-11-05 09:46:27 +0100
committerStefan Müller-Klieser <s.mueller-klieser@phytec.de>2015-11-06 14:05:29 +0100
commit603d96f4f62b5c2ba527906b495dc424676148eb (patch)
treead278caecfe55317f6450036553894def6ff52d7 /recipes-bsp
parent1bb2262954f7d8fb669e83a7ba9ad87a71915d5e (diff)
downloadmeta-phytec-603d96f4f62b5c2ba527906b495dc424676148eb.tar.bz2
meta-phytec-603d96f4f62b5c2ba527906b495dc424676148eb.zip
common: recipes-bsp: barebox: rewrite task in bash
Rewrite the python do_prepare_configure task in shell script. The advantage is that you can call the tasks 'do_default_defconfig' and 'do_savedefconfig' directly without the function bb.build.exec_func. This way the locking mechanism in function bb.build.exec_func is avoided. The bitbake designers have implemented a lock around each bb function call (It's only activated if requested): def exec_func(func, d, dirs = None): """Execute a BB 'function'""" [...] with bb.utils.fileslocked(lockfiles): if ispython: exec_func_python(func, d, runfile, cwd=adir) else: exec_func_shell(func, d, runfile, cwd=adir) So calling bb.build.exec_func from a bb function maybe lead to a deadlock. This patch removes the new need for your own externalsrc implementation. Signed-off-by: Stefan Christ <s.christ@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.inc31
1 files changed, 14 insertions, 17 deletions
diff --git a/recipes-bsp/barebox/barebox.inc b/recipes-bsp/barebox/barebox.inc
index 1142db7..697c352 100644
--- a/recipes-bsp/barebox/barebox.inc
+++ b/recipes-bsp/barebox/barebox.inc
@@ -29,7 +29,7 @@ inherit kernel-arch cml1 deploy
inherit kconfig-prepare-configure
# Increase INC_PR everytime the include file is changed.
-INC_PR = "r3"
+INC_PR = "r4"
PACKAGE_ARCH = "${MACHINE_ARCH}"
# verbose build 0/1
@@ -56,24 +56,21 @@ BAREBOX_MACHINE_ENVDIR = "${WORKDIR}/machineenv"
BAREBOX_BOARD_ENVDIR = "${WORKDIR}/boardenv"
-python do_prepare_configure_append() {
- localversion = d.getVar('BAREBOX_LOCALVERSION', True)
- bb.note("Setting LOCALVERSION in .config to %s" % localversion)
- cmd = 'kconfig-tweak --file %s --set-str LOCALVERSION "%s"' % (config, localversion)
- subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+do_prepare_configure_append() {
+ bbnote "Setting LOCALVERSION in .config to ${BAREBOX_LOCALVERSION}"
+ kconfig-tweak --file "${S}/.config" --set-str "LOCALVERSION" "${BAREBOX_LOCALVERSION}"
# Add environment directories to .config if they exist
- env_dirs = ""
- for env_dir in [".commonenv", ".boardenv", ".machineenv"]: # order is important!
- if os.path.isdir(os.path.join(S, env_dir)):
- env_dirs += " " + env_dir
-
- if env_dirs.strip() != "":
- ret = subprocess.call(["kconfig-tweak", "--file", config,
- "--set-str", "DEFAULT_ENVIRONMENT_PATH", env_dirs])
- if ret != 0:
- bb.error("Cannot set DEFAULT_ENVIRONMENT_PATH. kconfig-tweak exit code is %d." % (ret))
-
+ env_dirs=""
+ for env_dir in .commonenv .boardenv .machineenv; do # order is important!
+ if test -d "${S}/$env_dir"; then
+ env_dirs="$env_dirs $env_dir"
+ fi
+ done
+
+ if test ! -z "$env_dirs"; then
+ kconfig-tweak --file "${S}/.config" --set-str "DEFAULT_ENVIRONMENT_PATH" "$env_dirs"
+ fi
}
# its possible to give three environment folders to barebox: commonenv,