mirror of
https://git.yoctoproject.org/poky
synced 2026-05-09 17:39:31 +00:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
bf2b4c6943
commit
bfabdcfa37
@@ -27,12 +27,16 @@ CROSS_CURSES_INC = '-DCURSES_LOC="<curses.h>"'
|
|||||||
TERMINFO = "${STAGING_DATADIR_NATIVE}/terminfo"
|
TERMINFO = "${STAGING_DATADIR_NATIVE}/terminfo"
|
||||||
|
|
||||||
KCONFIG_CONFIG_COMMAND ??= "menuconfig"
|
KCONFIG_CONFIG_COMMAND ??= "menuconfig"
|
||||||
|
KCONFIG_CONFIG_ROOTDIR ??= "${B}"
|
||||||
python do_menuconfig() {
|
python do_menuconfig() {
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
|
config = os.path.join(d.getVar('KCONFIG_CONFIG_ROOTDIR'), ".config")
|
||||||
|
configorig = os.path.join(d.getVar('KCONFIG_CONFIG_ROOTDIR'), ".config.orig")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
mtime = os.path.getmtime(".config")
|
mtime = os.path.getmtime(config)
|
||||||
shutil.copy(".config", ".config.orig")
|
shutil.copy(config, configorig)
|
||||||
except OSError:
|
except OSError:
|
||||||
mtime = 0
|
mtime = 0
|
||||||
|
|
||||||
@@ -42,7 +46,7 @@ python do_menuconfig() {
|
|||||||
# FIXME this check can be removed when the minimum bitbake version has been bumped
|
# FIXME this check can be removed when the minimum bitbake version has been bumped
|
||||||
if hasattr(bb.build, 'write_taint'):
|
if hasattr(bb.build, 'write_taint'):
|
||||||
try:
|
try:
|
||||||
newmtime = os.path.getmtime(".config")
|
newmtime = os.path.getmtime(config)
|
||||||
except OSError:
|
except OSError:
|
||||||
newmtime = 0
|
newmtime = 0
|
||||||
|
|
||||||
@@ -52,7 +56,7 @@ python do_menuconfig() {
|
|||||||
}
|
}
|
||||||
do_menuconfig[depends] += "ncurses-native:do_populate_sysroot"
|
do_menuconfig[depends] += "ncurses-native:do_populate_sysroot"
|
||||||
do_menuconfig[nostamp] = "1"
|
do_menuconfig[nostamp] = "1"
|
||||||
do_menuconfig[dirs] = "${B}"
|
do_menuconfig[dirs] = "${KCONFIG_CONFIG_ROOTDIR}"
|
||||||
addtask menuconfig after do_configure
|
addtask menuconfig after do_configure
|
||||||
|
|
||||||
python do_diffconfig() {
|
python do_diffconfig() {
|
||||||
@@ -61,8 +65,8 @@ python do_diffconfig() {
|
|||||||
|
|
||||||
workdir = d.getVar('WORKDIR')
|
workdir = d.getVar('WORKDIR')
|
||||||
fragment = workdir + '/fragment.cfg'
|
fragment = workdir + '/fragment.cfg'
|
||||||
configorig = '.config.orig'
|
configorig = os.path.join(d.getVar('KCONFIG_CONFIG_ROOTDIR'), ".config.orig")
|
||||||
config = '.config'
|
config = os.path.join(d.getVar('KCONFIG_CONFIG_ROOTDIR'), ".config")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
md5newconfig = bb.utils.md5_file(configorig)
|
md5newconfig = bb.utils.md5_file(configorig)
|
||||||
@@ -85,5 +89,5 @@ python do_diffconfig() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
do_diffconfig[nostamp] = "1"
|
do_diffconfig[nostamp] = "1"
|
||||||
do_diffconfig[dirs] = "${B}"
|
do_diffconfig[dirs] = "${KCONFIG_CONFIG_ROOTDIR}"
|
||||||
addtask diffconfig
|
addtask diffconfig
|
||||||
|
|||||||
Reference in New Issue
Block a user