diff options
author | Diego Sueiro <diego.sueiro@arm.com> | 2020-08-06 11:37:51 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-08-08 09:17:49 +0100 |
commit | bfabdcfa3786f6b7c8d4df5130f653df299d3ab6 (patch) | |
tree | 2788b4db9d1c40fa9ae551299b11f968913062a5 /meta | |
parent | bf2b4c69439c48845e8a74c2a99b945032cf844c (diff) | |
download | poky-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')
-rw-r--r-- | meta/classes/cml1.bbclass | 18 |
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>"' | |||
27 | TERMINFO = "${STAGING_DATADIR_NATIVE}/terminfo" | 27 | TERMINFO = "${STAGING_DATADIR_NATIVE}/terminfo" |
28 | 28 | ||
29 | KCONFIG_CONFIG_COMMAND ??= "menuconfig" | 29 | KCONFIG_CONFIG_COMMAND ??= "menuconfig" |
30 | KCONFIG_CONFIG_ROOTDIR ??= "${B}" | ||
30 | python do_menuconfig() { | 31 | python 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 | } |
53 | do_menuconfig[depends] += "ncurses-native:do_populate_sysroot" | 57 | do_menuconfig[depends] += "ncurses-native:do_populate_sysroot" |
54 | do_menuconfig[nostamp] = "1" | 58 | do_menuconfig[nostamp] = "1" |
55 | do_menuconfig[dirs] = "${B}" | 59 | do_menuconfig[dirs] = "${KCONFIG_CONFIG_ROOTDIR}" |
56 | addtask menuconfig after do_configure | 60 | addtask menuconfig after do_configure |
57 | 61 | ||
58 | python do_diffconfig() { | 62 | python 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 | ||
87 | do_diffconfig[nostamp] = "1" | 91 | do_diffconfig[nostamp] = "1" |
88 | do_diffconfig[dirs] = "${B}" | 92 | do_diffconfig[dirs] = "${KCONFIG_CONFIG_ROOTDIR}" |
89 | addtask diffconfig | 93 | addtask diffconfig |