summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorDiego Sueiro <diego.sueiro@arm.com>2020-08-06 11:37:51 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-08-08 09:17:49 +0100
commitbfabdcfa3786f6b7c8d4df5130f653df299d3ab6 (patch)
tree2788b4db9d1c40fa9ae551299b11f968913062a5 /meta/classes
parentbf2b4c69439c48845e8a74c2a99b945032cf844c (diff)
downloadpoky-bfabdcfa3786f6b7c8d4df5130f653df299d3ab6.tar.gz
cml1: Add the option to choose the .config root dir
Introduce the KCONFIG_CONFIG_ROOTDIR variable to allow recipes which the .config file is not under the ${B} to select the root directory location for the config file. (From OE-Core rev: f86282ad2c66f843e000a889c403b3f09bce33f0) Signed-off-by: Diego Sueiro <diego.sueiro@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/cml1.bbclass18
1 files changed, 11 insertions, 7 deletions
diff --git a/meta/classes/cml1.bbclass b/meta/classes/cml1.bbclass
index 8ab240589a..9b9866f4c3 100644
--- a/meta/classes/cml1.bbclass
+++ b/meta/classes/cml1.bbclass
@@ -27,12 +27,16 @@ CROSS_CURSES_INC = '-DCURSES_LOC="<curses.h>"'
27TERMINFO = "${STAGING_DATADIR_NATIVE}/terminfo" 27TERMINFO = "${STAGING_DATADIR_NATIVE}/terminfo"
28 28
29KCONFIG_CONFIG_COMMAND ??= "menuconfig" 29KCONFIG_CONFIG_COMMAND ??= "menuconfig"
30KCONFIG_CONFIG_ROOTDIR ??= "${B}"
30python do_menuconfig() { 31python do_menuconfig() {
31 import shutil 32 import shutil
32 33
34 config = os.path.join(d.getVar('KCONFIG_CONFIG_ROOTDIR'), ".config")
35 configorig = os.path.join(d.getVar('KCONFIG_CONFIG_ROOTDIR'), ".config.orig")
36
33 try: 37 try:
34 mtime = os.path.getmtime(".config") 38 mtime = os.path.getmtime(config)
35 shutil.copy(".config", ".config.orig") 39 shutil.copy(config, configorig)
36 except OSError: 40 except OSError:
37 mtime = 0 41 mtime = 0
38 42
@@ -42,7 +46,7 @@ python do_menuconfig() {
42 # FIXME this check can be removed when the minimum bitbake version has been bumped 46 # FIXME this check can be removed when the minimum bitbake version has been bumped
43 if hasattr(bb.build, 'write_taint'): 47 if hasattr(bb.build, 'write_taint'):
44 try: 48 try:
45 newmtime = os.path.getmtime(".config") 49 newmtime = os.path.getmtime(config)
46 except OSError: 50 except OSError:
47 newmtime = 0 51 newmtime = 0
48 52
@@ -52,7 +56,7 @@ python do_menuconfig() {
52} 56}
53do_menuconfig[depends] += "ncurses-native:do_populate_sysroot" 57do_menuconfig[depends] += "ncurses-native:do_populate_sysroot"
54do_menuconfig[nostamp] = "1" 58do_menuconfig[nostamp] = "1"
55do_menuconfig[dirs] = "${B}" 59do_menuconfig[dirs] = "${KCONFIG_CONFIG_ROOTDIR}"
56addtask menuconfig after do_configure 60addtask menuconfig after do_configure
57 61
58python do_diffconfig() { 62python do_diffconfig() {
@@ -61,8 +65,8 @@ python do_diffconfig() {
61 65
62 workdir = d.getVar('WORKDIR') 66 workdir = d.getVar('WORKDIR')
63 fragment = workdir + '/fragment.cfg' 67 fragment = workdir + '/fragment.cfg'
64 configorig = '.config.orig' 68 configorig = os.path.join(d.getVar('KCONFIG_CONFIG_ROOTDIR'), ".config.orig")
65 config = '.config' 69 config = os.path.join(d.getVar('KCONFIG_CONFIG_ROOTDIR'), ".config")
66 70
67 try: 71 try:
68 md5newconfig = bb.utils.md5_file(configorig) 72 md5newconfig = bb.utils.md5_file(configorig)
@@ -85,5 +89,5 @@ python do_diffconfig() {
85} 89}
86 90
87do_diffconfig[nostamp] = "1" 91do_diffconfig[nostamp] = "1"
88do_diffconfig[dirs] = "${B}" 92do_diffconfig[dirs] = "${KCONFIG_CONFIG_ROOTDIR}"
89addtask diffconfig 93addtask diffconfig