summaryrefslogtreecommitdiffstats
path: root/meta-poky
diff options
context:
space:
mode:
authorBill Randle <william.c.randle@intel.com>2016-03-21 18:24:48 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-03-26 07:34:59 (GMT)
commit54eca753082af7d4c44379f879945f449d4f56cf (patch)
tree595ea9735db3dfd1e46e3b3c22549b902c181eed /meta-poky
parent2b992f3e5633e69fa53850d082ab68f3a4620f77 (diff)
downloadpoky-54eca753082af7d4c44379f879945f449d4f56cf.tar.gz
poky-sanity.bbclass: update conf/templateconf.cfg for existing installations
Updates of existing installations for the meta-yocto to meta-poky transition will update the bblayers.conf file, but not the templateconf.cfg file. This patch updates the template file to point to meta-poky/conf, if necessary. Fixes [YOCTO #9278] (From meta-yocto rev: e560e9b157fd53cccbe73659b44777715660f0b2) Signed-off-by: Bill Randle <william.c.randle@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta-poky')
-rw-r--r--meta-poky/classes/poky-sanity.bbclass42
-rw-r--r--meta-poky/conf/bblayers.conf.sample2
-rw-r--r--meta-poky/conf/layer.conf2
3 files changed, 40 insertions, 6 deletions
diff --git a/meta-poky/classes/poky-sanity.bbclass b/meta-poky/classes/poky-sanity.bbclass
index 287a9e3..81cd2eb 100644
--- a/meta-poky/classes/poky-sanity.bbclass
+++ b/meta-poky/classes/poky-sanity.bbclass
@@ -3,10 +3,44 @@
3python poky_update_bblayersconf() { 3python poky_update_bblayersconf() {
4 current_version = int(d.getVar('POKY_BBLAYERS_CONF_VERSION', True) or -1) 4 current_version = int(d.getVar('POKY_BBLAYERS_CONF_VERSION', True) or -1)
5 latest_version = int(d.getVar('REQUIRED_POKY_BBLAYERS_CONF_VERSION', True) or -1) 5 latest_version = int(d.getVar('REQUIRED_POKY_BBLAYERS_CONF_VERSION', True) or -1)
6 if current_version == -1 or latest_version == -1:
7 # one or the other missing => malformed configuration
8 raise NotImplementedError("You need to update bblayers.conf manually for this version transition")
6 9
7 # No version transitions here yet 10 success = True
8 raise NotImplementedError("You need to update bblayers.conf manually for this version transision") 11
12 # check for out of date templateconf.cfg file
13 lines = []
14 fn = os.path.join(d.getVar('TOPDIR', True), 'conf/templateconf.cfg')
15
16 lines = sanity_conf_read(fn)
17 index, meta_yocto_line = sanity_conf_find_line(r'^meta-yocto/', lines)
18 if meta_yocto_line:
19 lines[index] = meta_yocto_line.replace('meta-yocto', 'meta-poky')
20 with open(fn, "w") as f:
21 f.write(''.join(lines))
22 bb.note("Your conf/templateconf.cfg file was updated from meta-yocto to meta-poky")
23
24 # add any additional layer checks/changes here
25
26 if success:
27 current_version = latest_version
28 bblayers_fn = bblayers_conf_file(d)
29 lines = sanity_conf_read(bblayers_fn)
30 # sanity_conf_update() will erroneously find a match when the var name
31 # is used in a comment, so do our own here. The code below can be
32 # removed when sanity_conf_update() is fixed in OE-Core.
33 #sanity_conf_update(bblayers_fn, lines, 'POKY_BBLAYERS_CONF_VERSION', current_version)
34 index, line = sanity_conf_find_line(r'^POKY_BBLAYERS_CONF_VERSION', lines)
35 lines[index] = 'POKY_BBLAYERS_CONF_VERSION = "%d"\n' % current_version
36 with open(bblayers_fn, "w") as f:
37 f.write(''.join(lines))
38 bb.note("Your conf/bblayers.conf has been automatically updated.")
39 if success:
40 return
41
42 raise NotImplementedError("You need to update bblayers.conf manually for this version transition")
9} 43}
10 44
11# Prepend to ensure our function runs before the OE-Core one 45# ensure our function runs after the OE-Core one
12BBLAYERS_CONF_UPDATE_FUNCS =+ "conf/bblayers.conf:POKY_BBLAYERS_CONF_VERSION:REQUIRED_POKY_BBLAYERS_CONF_VERSION:poky_update_bblayersconf" 46BBLAYERS_CONF_UPDATE_FUNCS += "conf/bblayers.conf:POKY_BBLAYERS_CONF_VERSION:REQUIRED_POKY_BBLAYERS_CONF_VERSION:poky_update_bblayersconf"
diff --git a/meta-poky/conf/bblayers.conf.sample b/meta-poky/conf/bblayers.conf.sample
index a371994..8b1cbdf 100644
--- a/meta-poky/conf/bblayers.conf.sample
+++ b/meta-poky/conf/bblayers.conf.sample
@@ -1,6 +1,6 @@
1# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf 1# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
2# changes incompatibly 2# changes incompatibly
3POKY_BBLAYERS_CONF_VERSION = "1" 3POKY_BBLAYERS_CONF_VERSION = "2"
4 4
5BBPATH = "${TOPDIR}" 5BBPATH = "${TOPDIR}"
6BBFILES ?= "" 6BBFILES ?= ""
diff --git a/meta-poky/conf/layer.conf b/meta-poky/conf/layer.conf
index b5ffd9e..8b7b33d 100644
--- a/meta-poky/conf/layer.conf
+++ b/meta-poky/conf/layer.conf
@@ -15,4 +15,4 @@ LAYERVERSION_yocto = "3"
15 15
16LAYERDEPENDS_yocto = "core" 16LAYERDEPENDS_yocto = "core"
17 17
18REQUIRED_POKY_BBLAYERS_CONF_VERSION = "1" 18REQUIRED_POKY_BBLAYERS_CONF_VERSION = "2"