diff options
author | Nathan Rossi <nathan@nathanrossi.com> | 2016-10-29 23:50:19 +1000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-11-06 23:35:32 +0000 |
commit | 25f9530f784d5d1b3644b38295762e0395a51437 (patch) | |
tree | 8847d32fa0fe9af482f0019ff81d768cfa2eff76 | |
parent | ebe531b38bea54bd29ed7b3d2ea6c533b9331953 (diff) | |
download | poky-25f9530f784d5d1b3644b38295762e0395a51437.tar.gz |
qemuboot.bbclass: Setup the vardeps for write_qemuboot_conf
Setting up the vardeps on write_qemuboot_conf forces the updating of
variables in qemuboot.conf when machine/deploy configuration changes.
This is particularly useful when developing or setting up the qemuboot
(e.g. changing QB_* variables) for new targets or when changing
deployment variables (e.g. KERNEL_IMAGETYPE).
(From OE-Core rev: c568f6ce06512a108cada5c7100eb1f6de73f2ff)
Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/qemuboot.bbclass | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/meta/classes/qemuboot.bbclass b/meta/classes/qemuboot.bbclass index b5cc93dc93..39df3ad388 100644 --- a/meta/classes/qemuboot.bbclass +++ b/meta/classes/qemuboot.bbclass | |||
@@ -44,25 +44,22 @@ QB_OPT_APPEND ?= "-show-cursor" | |||
44 | # Create qemuboot.conf | 44 | # Create qemuboot.conf |
45 | ROOTFS_POSTPROCESS_COMMAND += "write_qemuboot_conf; " | 45 | ROOTFS_POSTPROCESS_COMMAND += "write_qemuboot_conf; " |
46 | 46 | ||
47 | python write_qemuboot_conf() { | 47 | def qemuboot_vars(d): |
48 | import configparser | 48 | build_vars = ['MACHINE', 'TUNE_ARCH', 'DEPLOY_DIR_IMAGE', |
49 | 49 | 'KERNEL_IMAGETYPE', 'IMAGE_NAME', 'IMAGE_LINK_NAME', | |
50 | build_vars = ['MACHINE', 'TUNE_ARCH', 'DEPLOY_DIR_IMAGE', \ | 50 | 'STAGING_DIR_NATIVE', 'STAGING_BINDIR_NATIVE', |
51 | 'KERNEL_IMAGETYPE', 'IMAGE_NAME', 'IMAGE_LINK_NAME', \ | ||
52 | 'STAGING_DIR_NATIVE', 'STAGING_BINDIR_NATIVE', \ | ||
53 | 'STAGING_DIR_HOST'] | 51 | 'STAGING_DIR_HOST'] |
52 | return build_vars + [k for k in d.keys() if k.startswith('QB_')] | ||
54 | 53 | ||
55 | # Vars from bsp | 54 | write_qemuboot_conf[vardeps] += "${@' '.join(qemuboot_vars(d))}" |
56 | qb_vars = [] | 55 | python write_qemuboot_conf() { |
57 | for k in d.keys(): | 56 | import configparser |
58 | if k.startswith('QB_'): | ||
59 | qb_vars.append(k) | ||
60 | 57 | ||
61 | qemuboot = "%s/%s.qemuboot.conf" % (d.getVar('DEPLOY_DIR_IMAGE', True), d.getVar('IMAGE_NAME', True)) | 58 | qemuboot = "%s/%s.qemuboot.conf" % (d.getVar('DEPLOY_DIR_IMAGE', True), d.getVar('IMAGE_NAME', True)) |
62 | qemuboot_link = "%s/%s.qemuboot.conf" % (d.getVar('DEPLOY_DIR_IMAGE', True), d.getVar('IMAGE_LINK_NAME', True)) | 59 | qemuboot_link = "%s/%s.qemuboot.conf" % (d.getVar('DEPLOY_DIR_IMAGE', True), d.getVar('IMAGE_LINK_NAME', True)) |
63 | cf = configparser.ConfigParser() | 60 | cf = configparser.ConfigParser() |
64 | cf.add_section('config_bsp') | 61 | cf.add_section('config_bsp') |
65 | for k in build_vars + qb_vars: | 62 | for k in qemuboot_vars(d): |
66 | cf.set('config_bsp', k, '%s' % d.getVar(k, True)) | 63 | cf.set('config_bsp', k, '%s' % d.getVar(k, True)) |
67 | 64 | ||
68 | # QB_DEFAULT_KERNEL's value of KERNEL_IMAGETYPE is the name of a symlink | 65 | # QB_DEFAULT_KERNEL's value of KERNEL_IMAGETYPE is the name of a symlink |