summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Müller-Klieser <s.mueller-klieser@phytec.de>2020-08-27 15:42:48 +0200
committerStefan Müller-Klieser <s.mueller-klieser@phytec.de>2020-08-27 15:42:48 +0200
commitbd41da177485f6f11b79ad87b6ef542dee5e98fe (patch)
treebd65b4dbe71272916b1fef2a77b3a7e3746cde68
parent18c19921c0e2f08f3713e7d2ea492a5f6ef52fcf (diff)
downloadmeta-phytec-bd41da177485f6f11b79ad87b6ef542dee5e98fe.tar.bz2
meta-phytec-bd41da177485f6f11b79ad87b6ef542dee5e98fe.zip
bblayers.conf: move meta data about active layers to the manifest.xml
The meta data about all active layers are now merged in the manifest.xml. Init_bblayers.py creates the bblayers.conf dynamically. This makes handling of different BSP layer composition and customer BSP layer composition more consistent. Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de> Reviewed-by: Norbert Wesp <n.wesp@phytec.de>
-rw-r--r--conf/bblayers.conf.sample12
-rwxr-xr-xscripts/init_bblayers.py10
-rw-r--r--scripts/phylib.py10
3 files changed, 17 insertions, 15 deletions
diff --git a/conf/bblayers.conf.sample b/conf/bblayers.conf.sample
index 01dd1ee..045ed1a 100644
--- a/conf/bblayers.conf.sample
+++ b/conf/bblayers.conf.sample
@@ -6,11 +6,7 @@ BBPATH = "${TOPDIR}"
BBFILES ?= ""
OEROOT := "##OEROOT##"
-BBLAYERS ?= " \
- ${OEROOT}/meta \
- ${OEROOT}/meta-poky \
- ${OEROOT}/../meta-openembedded/meta-oe \
- ${OEROOT}/../meta-openembedded/meta-networking \
- ${OEROOT}/../meta-openembedded/meta-python \
- ${OEROOT}/../meta-openembedded/meta-multimedia \
- "
+
+# In our BSPs active layers are defined by the manifest.xml for all BSPs. The
+# bblayers.conf gets created by the init_bblayers.py script.
+BBLAYERS ?= ""
diff --git a/scripts/init_bblayers.py b/scripts/init_bblayers.py
index b92ac0a..3906569 100755
--- a/scripts/init_bblayers.py
+++ b/scripts/init_bblayers.py
@@ -14,11 +14,9 @@ class BSP_BBLayer(BoardSupportPackage):
def __init__(self):
super(BSP_BBLayer, self).__init__()
self.bblayers_conf = os.path.join(self.src.bsp_dir, "build/conf/bblayers.conf")
- #layers in those project dirs will be controlled by the bblayers.conf.example
- self.project_filter = ["poky", "meta-openembedded"]
def init_bblayers(self):
- layers_to_add = set(self.project_paths).difference(self.project_filter)
+ layers_to_add = self.project_paths
print("Layers to add:", layers_to_add)
with open(self.bblayers_conf, "a") as f:
f.write("BBLAYERS += \"\\\n")
@@ -33,8 +31,10 @@ class BSP_BBLayer(BoardSupportPackage):
##############
def main():
- parser = argparse.ArgumentParser(description='Init the bblayers.conf. Poky and meta-openembedded will be handled by the bblayers.conf.example. The other layers will be added from the repo manifest.xml')
-
+ parser = argparse.ArgumentParser(description='This script dynamically creates '
+ 'the bblayers.conf. Active layers are defined by all projects in the '
+ 'manifest.xml and, in addition, the sublayers entries. Projects in '
+ 'the manifest can be deactivated with the <ignorebaselayer/> tag.')
args = parser.parse_args()
bsp = BSP_BBLayer()
diff --git a/scripts/phylib.py b/scripts/phylib.py
index b5baba6..0dbfdd7 100644
--- a/scripts/phylib.py
+++ b/scripts/phylib.py
@@ -195,7 +195,12 @@ class BoardSupportPackage(object):
if child.tag == "phytec":
release_info = child.attrib
elif child.tag == "project":
- projects.append(child.attrib)
+ if not child.findall("ignorebaselayer"):
+ projects.append(child.attrib)
+ for sublayer in child.iter("sublayer"):
+ subproject = sublayer.attrib
+ subproject["path"] = os.path.join(child.attrib["path"], subproject["path"])
+ projects.append(subproject)
# import meta data, some keys need special treatments
for key in list(release_info.keys()):
@@ -214,7 +219,8 @@ class BoardSupportPackage(object):
for project in projects:
for key in list(project.keys()):
if key == "path":
- path = os.path.split(project[key].rstrip('/'))[1]
+ path = project[key].split('/')[1:]
+ path = os.path.join(*path)
self.project_paths.append(path)
def probe_selected_release(self):