meta: introduce KCONFIG_CONFIG_ENABLE_MENUCONFIG
PATCH 1/1 meta: introduce KCONFIG_CONFIG_ENABLE_MENUCONFIG
From: Ming Liu <[email protected]>
Currently, uboot do_menuconfig task is breaking when UBOOT_CONFIG is chosen rather than UBOOT_MACHINE, it simply fails with the following errors:
| make: *** No rule to make target 'menuconfig'. Stio. | Command failed. | Press any key to continue...
this is due to the work directory of do_menuconfig is set to ${B} but not ${B}/$config.
We should distinguish two situations:
1) When there is only one config item in UBOOT_CONFIG, do_menuconfig should work just like how it works for UBOOT_MACHINE.
2) When there are multiple config items in UBOOT_CONFIG, do_menuconfig should print out some information saying it's not supported other than just failing.
This patch mainly aims to fix that by introducing a extra variable KCONFIG_CONFIG_ENABLE_MENUCONFIG, it would be set to 'false' for situation 2), and when it's set to 'true', then set KCONFIG_CONFIG_ROOTDIR correctly in uboot-config.bbclass to let do_menuconfig task work.
DEVTOOL_DISABLE_MENUCONFIG could be replaced by this new variable KCONFIG_CONFIG_ENABLE_MENUCONFIG.
--- meta/classes-recipe/cml1.bbclass | 5 +++++ meta/classes-recipe/uboot-config.bbclass | 6 ++++++ meta/recipes-bsp/u-boot/u-boot-configure.inc | 1 - scripts/lib/devtool/standard.py | 6 +++--- 4 files changed, 14 insertions(+), 4 deletions(-)
meta/classes-recipe/cml1.bbclass +5 -0
@@ -32,10 +32,15 @@ CROSS_CURSES_INC = '-DCURSES_LOC="<curses.h>"' TERMINFO = "${STAGING_DATADIR_NATIVE}/terminfo" KCONFIG_CONFIG_COMMAND ??= "menuconfig" +KCONFIG_CONFIG_ENABLE_MENUCONFIG ??= "true" KCONFIG_CONFIG_ROOTDIR ??= "${B}" python do_menuconfig() { import shutil + if not bb.utils.to_boolean(d.getVar("KCONFIG_CONFIG_ENABLE_MENUCONFIG")): + bb.fatal("do_menuconfig is disabled, please check KCONFIG_CONFIG_ENABLE_MENUCONFIG variable.") + return + config = os.path.join(d.getVar('KCONFIG_CONFIG_ROOTDIR'), ".config") configorig = os.path.join(d.getVar('KCONFIG_CONFIG_ROOTDIR'), ".config.orig")
meta/classes-recipe/uboot-config.bbclass +6 -0
@@ -140,4 +140,10 @@ python () { if not found: raise bb.parse.SkipRecipe("The selected UBOOT_CONFIG key %s has no match in %s." % (ubootconfig, ubootconfigflags.keys())) + + if len(ubootconfig) == 1: + d.setVar('KCONFIG_CONFIG_ROOTDIR', os.path.join(d.getVar("B"), d.getVar("UBOOT_MACHINE").strip())) + else: + # Disable menuconfig for multiple configs + d.setVar('KCONFIG_CONFIG_ENABLE_MENUCONFIG', "false") }
meta/recipes-bsp/u-boot/u-boot-configure.inc +0 -1
@@ -26,7 +26,6 @@ do_configure () { unset j done unset i - DEVTOOL_DISABLE_MENUCONFIG=true else if [ -n "${UBOOT_MACHINE}" ]; then oe_runmake -C ${S} O=${B} ${UBOOT_MACHINE}
scripts/lib/devtool/standard.py +3 -3
@@ -968,9 +968,9 @@ def modify(args, config, basepath, workspace): '}\n') if rd.getVarFlag('do_menuconfig','task'): f.write('\ndo_configure:append() {\n' - ' if [ ! ${DEVTOOL_DISABLE_MENUCONFIG} ]; then\n' - ' cp ${B}/.config ${S}/.config.baseline\n' - ' ln -sfT ${B}/.config ${S}/.config.new\n' + ' if [ ${@ oe.types.boolean(\'${KCONFIG_CONFIG_ENABLE_MENUCONFIG}\') } = True ]; then\n' + ' cp ${KCONFIG_CONFIG_ROOTDIR}/.config ${S}/.config.baseline\n' + ' ln -sfT ${KCONFIG_CONFIG_ROOTDIR}/.config ${S}/.config.new\n' ' fi\n' '}\n') if initial_rev:
Signature · 1 line
2.25.1
Hi, Dear maintainers:
Ping, could you please review this at your convenient time? It's blocking our uboot do_menuconfig task.
the best,
thank you
<[email protected]> 於 2023年5月13日 週六 下午6:05寫道:
Quoted 117 lines
From: Ming Liu <[email protected]>
Currently, uboot
do_menuconfigtask is breaking whenUBOOT_CONFIGis chosen rather thanUBOOT_MACHINE, it simply fails with the following errors:| make: *** No rule to make target 'menuconfig'. Stio. | Command failed. | Press any key to continue...this is due to the work directory of
do_menuconfigis set to ${B} but not ${B}/$config.We should distinguish two situations:
1) When there is only one config item inUBOOT_CONFIG,do_menuconfigshould work just like how it works forUBOOT_MACHINE.
2) When there are multiple config items inUBOOT_CONFIG,do_menuconfigshould print out some information saying it's not supported other than just failing.This patch mainly aims to fix that by introducing a extra variable
KCONFIG_CONFIG_ENABLE_MENUCONFIG, it would be set to 'false' for situation 2), and when it's set to 'true', then setKCONFIG_CONFIG_ROOTDIRcorrectly in uboot-config.bbclass to letdo_menuconfigtask work.
DEVTOOL_DISABLE_MENUCONFIGcould be replaced by this new variableKCONFIG_CONFIG_ENABLE_MENUCONFIG.Signed-off-by Ming Liu <[email protected]>--- meta/classes-recipe/cml1.bbclass | 5 +++++ meta/classes-recipe/uboot-config.bbclass | 6 ++++++ meta/recipes-bsp/u-boot/u-boot-configure.inc | 1 - scripts/lib/devtool/standard.py | 6 +++--- 4 files changed, 14 insertions(+), 4 deletions(-)meta/classes-recipe/cml1.bbclass +2
-0@@ -32,10 +32,15 @@ CROSS_CURSES_INC = '-DCURSES_LOC="<curses.h>"' TERMINFO = "${STAGING_DATADIR_NATIVE}/terminfo" KCONFIG_CONFIG_COMMAND ??= "menuconfig" +KCONFIG_CONFIG_ENABLE_MENUCONFIG ??= "true" KCONFIG_CONFIG_ROOTDIR ??= "${B}" python do_menuconfig() { import shutil + if notbb.utils.to_boolean(d.getVar("KCONFIG_CONFIG_ENABLE_MENUCONFIG")):
+ bb.fatal("do_menuconfig is disabled, please checkKCONFIG_CONFIG_ENABLE_MENUCONFIGvariable.")meta/classes-recipe/cml1.bbclass +2
-0+ return + config = os.path.join(d.getVar('KCONFIG_CONFIG_ROOTDIR'), ".config") configorig = os.path.join(d.getVar('KCONFIG_CONFIG_ROOTDIR'),".config.orig")
meta/classes-recipe/uboot-config.bbclass +3
-0@@ -140,4 +140,10 @@ python () { if not found: raise bb.parse.SkipRecipe("The selected UBOOT_CONFIG key %s has no match in %s." % (ubootconfig, ubootconfigflags.keys())) + + if len(ubootconfig) == 1: + d.setVar('KCONFIG_CONFIG_ROOTDIR',
os.path.join(d.getVar("B"), d.getVar("UBOOT_MACHINE").strip()))meta/classes-recipe/uboot-config.bbclass +3
-0+ else: + # Disable menuconfig for multiple configs + d.setVar('KCONFIG_CONFIG_ENABLE_MENUCONFIG', "false") }meta/recipes-bsp/u-boot/u-boot-configure.inc +0
-1@@ -26,7 +26,6 @@ do_configure () { unset j done unset i - DEVTOOL_DISABLE_MENUCONFIG=true else if [ -n "${UBOOT_MACHINE}" ]; then oe_runmake -C ${S} O=${B} ${UBOOT_MACHINE}scripts/lib/devtool/standard.py +1
-3@@ -968,9 +968,9 @@ def modify(args, config, basepath, workspace): '}\n') if rd.getVarFlag('do_menuconfig','task'): f.write('\ndo_configure:append() {\n' - ' if [ ! ${DEVTOOL_DISABLE_MENUCONFIG} ]; then\n' - ' cp ${B}/.config ${S}/.config.baseline\n' - ' ln -sfT ${B}/.config ${S}/.config.new\n' + ' if [ ${@ oe.types.boolean(\'${KCONFIG_CONFIG_ENABLE_MENUCONFIG}\') } = True ];then\n'
+ ' cp ${KCONFIG_CONFIG_ROOTDIR}/.config
${S}/.config.baseline\n'
+ ' ln -sfT ${KCONFIG_CONFIG_ROOTDIR}/.config
${S}/.config.new\n'' fi\n' '}\n') if initial_rev:--
2.25.1
Quoted 5 lines · Ming Liu
Hi, Dear maintainers:
Ping, could you please review this at your convenient time? It's blocking our uboot
do_menuconfigtask.
This is in my testing queue but other patches have proven difficult and I didn't have any green builds since.
Quoted 132 lines
the best,
thank you<[email protected]> 於 2023年5月13日 週六 下午6:05寫道:
Quoted 110 lines
From: Ming Liu <[email protected]>
Currently, uboot
do_menuconfigtask is breaking whenUBOOT_CONFIGis chosen rather thanUBOOT_MACHINE, it simply fails with the following errors:| make: *** No rule to make target 'menuconfig'. Stio. | Command failed. | Press any key to continue...this is due to the work directory of
do_menuconfigis set to ${B} but not ${B}/$config.We should distinguish two situations:
1) When there is only one config item inUBOOT_CONFIG,do_menuconfigshould work just like how it works forUBOOT_MACHINE.
2) When there are multiple config items inUBOOT_CONFIG,do_menuconfigshould print out some information saying it's not supported other than just failing.This patch mainly aims to fix that by introducing a extra variable
KCONFIG_CONFIG_ENABLE_MENUCONFIG, it would be set to 'false' for situation 2), and when it's set to 'true', then setKCONFIG_CONFIG_ROOTDIRcorrectly in uboot-config.bbclass to letdo_menuconfigtask work.
DEVTOOL_DISABLE_MENUCONFIGcould be replaced by this new variableKCONFIG_CONFIG_ENABLE_MENUCONFIG.Signed-off-by Ming Liu <[email protected]>--- meta/classes-recipe/cml1.bbclass | 5 +++++ meta/classes-recipe/uboot-config.bbclass | 6 ++++++ meta/recipes-bsp/u-boot/u-boot-configure.inc | 1 - scripts/lib/devtool/standard.py | 6 +++--- 4 files changed, 14 insertions(+), 4 deletions(-)meta/classes-recipe/cml1.bbclass +2
-0@@ -32,10 +32,15 @@ CROSS_CURSES_INC = '-DCURSES_LOC="<curses.h>"' TERMINFO = "${STAGING_DATADIR_NATIVE}/terminfo" KCONFIG_CONFIG_COMMAND ??= "menuconfig" +KCONFIG_CONFIG_ENABLE_MENUCONFIG ??= "true" KCONFIG_CONFIG_ROOTDIR ??= "${B}" python do_menuconfig() { import shutil + if notbb.utils.to_boolean(d.getVar("KCONFIG_CONFIG_ENABLE_MENUCONFIG")):
+ bb.fatal("do_menuconfig is disabled, please checkKCONFIG_CONFIG_ENABLE_MENUCONFIGvariable.")meta/classes-recipe/cml1.bbclass +2
-0+ return + config = os.path.join(d.getVar('KCONFIG_CONFIG_ROOTDIR'), ".config") configorig = os.path.join(d.getVar('KCONFIG_CONFIG_ROOTDIR'),".config.orig")
meta/classes-recipe/uboot-config.bbclass +3
-0@@ -140,4 +140,10 @@ python () { if not found: raise bb.parse.SkipRecipe("The selected UBOOT_CONFIG key %s has no match in %s." % (ubootconfig, ubootconfigflags.keys())) + + if len(ubootconfig) == 1: + d.setVar('KCONFIG_CONFIG_ROOTDIR',
os.path.join(d.getVar("B"), d.getVar("UBOOT_MACHINE").strip()))meta/classes-recipe/uboot-config.bbclass +3
-0+ else: + # Disable menuconfig for multiple configs + d.setVar('KCONFIG_CONFIG_ENABLE_MENUCONFIG', "false") }meta/recipes-bsp/u-boot/u-boot-configure.inc +0
-1@@ -26,7 +26,6 @@ do_configure () { unset j done unset i - DEVTOOL_DISABLE_MENUCONFIG=true else if [ -n "${UBOOT_MACHINE}" ]; then oe_runmake -C ${S} O=${B} ${UBOOT_MACHINE}scripts/lib/devtool/standard.py +1
-3@@ -968,9 +968,9 @@ def modify(args, config, basepath, workspace): '}\n') if rd.getVarFlag('do_menuconfig','task'): f.write('\ndo_configure:append() {\n' - ' if [ ! ${DEVTOOL_DISABLE_MENUCONFIG} ]; then\n' - ' cp ${B}/.config ${S}/.config.baseline\n' - ' ln -sfT ${B}/.config ${S}/.config.new\n' + ' if [ ${@ oe.types.boolean(\'${KCONFIG_CONFIG_ENABLE_MENUCONFIG}\') } = True ];then\n'
+ ' cp ${KCONFIG_CONFIG_ROOTDIR}/.config
${S}/.config.baseline\n'
+ ' ln -sfT ${KCONFIG_CONFIG_ROOTDIR}/.config
${S}/.config.new\n'Quoted 7 lines
' fi\n' '}\n') if initial_rev:--
2.25.1-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#182425): https://lists.openembedded.org/g/openembedded-core/message/182425
Mute This Topic: https://lists.openembedded.org/mt/98870753/3617179
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com