summaryrefslogtreecommitdiffstats
path: root/meta/classes/cml1.bbclass
AgeCommit message (Collapse)Author
2022-08-12classes: Update classes to match new bitbake class scope functionalityRichard Purdie
Move classes to classes-global or classes-recipe as appropriate to take advantage of new bitbake functionality to check class scope/usage. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-12classes: Add SPDX license identifiersRichard Purdie
As stated in our top level license files, the license is MIT unless otherwise stated. Add SPDX identifers accordingly. Replace older license statementa with the standardised syntax. Also drop "All Rights Reserved" expression as it isn't used now, doesn't mean anything and is confusing. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-12classes: Add copyright statements to files without oneRichard Purdie
Where there isn't a copyright statement, add one to make it explicit. Also drop editor config lines where they were present. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-18Revert "cml1.bbclass: Return sorted list of cfg files"uninative-3.2Richard Purdie
This reverts commit dee41e92f0efac7e453597bed4b4c02f867e3aa9. This patch breaks cases where some config files make changes to earlier ones, ordering is important. The reproducibility issue in busybox was elsewhere. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-03cml1.bbclass: Return sorted list of cfg filesKhem Raj
Since these files are passed to merge_config.sh its better to use a sorted list, so we can be sure that this list is always fed in same order irrespective of python versions on host Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-11-08cml1.bbclass: Handle ncurses-native being available via pkg-configNathan Rossi
The linux kernel will by default use pkg-config to get ncurses(w) paths, falling back to absolute path checks otherwise. If the build host does not have ncurses installed this will fail as pkg-config will not search the native sysroot for ncurses. To more all kernel/kconfig sources, inject the equivalent native pkg-config variables similar to what is done by the pkg-config-native script. This only affects the menuconfig python task itself and the oe_terminal call inside it. Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-08cml1: Add the option to choose the .config root dirDiego Sueiro
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. Signed-off-by: Diego Sueiro <diego.sueiro@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-07-12cml1: Move find_cfgs() helper to cml1.bbclassRasmus Villemoes
u-boot.inc and busybox.inc contain identical copies of this little helper. They both inherit the cml1 class and use cml1_do_configure right after having used this helper, and other recipes that want to write similar logic for doing Kconfig via fragments will also need it or something equivalent. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-08cml1.bbclass: fix undefined behaviorStefan Müller-Klieser
Whenever cml1 do_configure is used with a defconfig, oldconfig waits for input. This silently fails on recent kconfig projects with: "Error in reading or end of file." We cannot use a more up to date kconfig target such as olddefconfig, because busybox does not support it. Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-04-03cml1.bbclass: Use POSIX sh instead of var-SHELLNathan Rossi
Use the default POSIX sh instead of relying of var-SHELL being set to a compatible shell. Such that in cases where SHELL is set to a incompatible shell (e.g. csh, zsh, fish, etc.) the terminal command does not just silently fail. Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-14meta: Fix python code quoting issuesRichard Purdie
python 3.8 will be stricter about python quoting. Fix up several misquoted expressions and fix Deprecation warnings like: Var <do_compile>:1: DeprecationWarning: invalid escape sequence \$ Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-10-06cml1: remove diffconfig return code checkingBruce Ashfield
The following commit: [ commit 578c8205fd14c48c6d30ef2889d86f1b4aee060a Author: Mikko Rapeli <mikko.rapeli@bmw.de> Date: Thu Jun 22 16:23:14 2017 +0300 meta: Fix return value checks from subprocess.call()'s Python function subprocess.call() returns the return value of the executed process. If return values are not checked, errors may go unnoticed and bad things can happen. Change all callers of subprocess.call() which do not check for the return value to use subprocess.check_call() which raises CalledProcessError if the subprocess returns with non-zero value. https://docs.python.org/2/library/subprocess.html#using-the-subprocess-module All users of the function were found with: $ git grep "subprocess\.call" | \ egrep -v 'if.*subprocess\.call|=\ +subprocess\.call|return.*subprocess\.call' Tested similar patch on top of yocto jethro. Only compile tested core-image-minimal on poky master branch. Signed-off-by: Mikko Rapeli <mikko.rapeli@bmw.de> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> ] Added return code checking to do_diffconfig. Although the change is well intentioned, it isn't correct in this instance since 'diff' returns '1' to indicate that there are differences in the files .. and not as an error code. subprocess.check_call() flags this as an error and the routine aborts. We are already checking the inputs, and in fact already know there's a diff in the files before we even make the call, so there's no need to look for an error in this case. Putting back subprocess.call() restores the routine to working order. [YOCTO #12132] Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-08-08Revert "cml1.bbclass: wait until menuconfig terminal finishes"Leonardo Sandoval
This reverts commit d2ebee7c3a0c8ab9a09ebad12a2fda51f8d10954. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-30cml1.bbclass: wait until menuconfig terminal finishesLeonardo Sandoval
There are at least two terminals types (gnome and tmux) that when launched to show the kernel's menuconfig, we lost track of the corresponding process ID, thus there is no way to see when they finish, yielding identical timestamps before and after menuconfig thus compile's task is never tainted. This commit takes the solution from [1] but now in the menuconfig's context. [1] http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=c706bfbabbf9f7caf2cf509eb91381fb49aa44cb [YOCTO #11146] Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-28meta: Fix return value checks from subprocess.call()'sMikko Rapeli
Python function subprocess.call() returns the return value of the executed process. If return values are not checked, errors may go unnoticed and bad things can happen. Change all callers of subprocess.call() which do not check for the return value to use subprocess.check_call() which raises CalledProcessError if the subprocess returns with non-zero value. https://docs.python.org/2/library/subprocess.html#using-the-subprocess-module All users of the function were found with: $ git grep "subprocess\.call" | \ egrep -v 'if.*subprocess\.call|=\ +subprocess\.call|return.*subprocess\.call' Tested similar patch on top of yocto jethro. Only compile tested core-image-minimal on poky master branch. Signed-off-by: Mikko Rapeli <mikko.rapeli@bmw.de> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-01-06meta/scripts: Various getVar/getVarFlag expansion parameter fixesRichard Purdie
There were a few straggling expansion parameter removals left for getVar/getVarFlag where the odd whitespace meant they were missed on previous passes. There were also some plain broken ussages such as: d.getVar('ALTERNATIVE_TARGET', old_name, True) path = d.getVar('PATH', d, True) d.getVar('IMAGE_ROOTFS', 'True') which I've corrected (they happend to work by luck). Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16meta: remove True option to getVar callsJoshua Lock
getVar() now defaults to expanding by default, thus remove the True option from getVar() calls with a regex search and replace. Search made with the following regex: getVar ?\(( ?[^,()]*), True\) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-08-04cml1: fix tasks after default [dirs] changedRoss Burton
These tasks relied upon [dirs] being ${B} by default. As the functions are not simple, add back [dirs] so they work again. [ YOCTO #10027 ] Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-02-19cml1/sstate: Fix missing getVar parameterRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-18cml1.bbclass: fix do_menuconfigMarkus Lehtonen
The functionality got broken after bitbake commit 8bf33a8e92c0e188fa392030025756196c96fcbb which disabled the (bitbake) variable expansion inside python functions. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-11cml1.bbclass: make menuconfig task configurableStefan Müller-Klieser
Menuconfig is sometimes not the most convenient way to configure a kernel, as the default color scheme can be hard to read. This variable gives you access to the MENUCONFIG_COLOR variable or lets you select nconfig, e.g. by setting it in your local.conf: KCONFIG_CONFIG_COMMAND = "MENUCONFIG_COLOR=mono menuconfig" or KCONFIG_CONFIG_COMMAND = "nconfig" Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de> Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-11-09ncurses, busybox, cml1.bbclass: Fix menuconfig display corruptionJason Wessel
Previously there was a change to the ncurses compile to make it more like the typical way it was compiled on a host system. This fixed a whole class of host machines, but masked the real underlying problem with the display corruption issues and menuconfig. The corner case that led to the discovery that the wrong curses.h file was getting used was when there was no curses libraries at all on one of the development hosts. What had happened before was that /usr/include/curses.h on the host system had to match closely enough to the curses.h in the sysroot and then linking against the sysroot version of curses.so was ok (meaning no display corruption). But on some systems with ncurses.h vs curses.h such as SuSE hosts, there were still issues. If we fix the root of the problem and force the mconf and lxdialog to use the correct headers and libraries from the sysroot there is no further issues and the menuconfig target works properly. It also means we can back out the custom compilation flags to the ncurses recipe because they are no longer needed. For the kernel part of the menuconfig / nconfig changes it will be merged separately and this is all based on: https://lkml.org/lkml/2013/3/3/103 Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Roy Li <rongqing.li@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-08-15cml1.bbclass: fix diffconfig diff commandMaciej Borzecki
Commit 6a7b98993350d0d24eae0058ae26ae19cfdf7c4c introduced a typo in command, a whitespace was missing between --new-line-format and path to original file. As a result, diffconfig task did not work, diff failed with exit status 2, resulting in empty fragment.cfg. Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl> Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-29cml1: correct diffconfig output formatStefan Müller-Klieser
If used with some packages using kconfig mechanism, the diffconfig command generates wrong output format. Diff provides all options to format the output correctly. This method formats as intended, is more robust and works with the merge_config.h script from yocto-kernel-tools. Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-20cml1.bbclass: Add diffconfig task to cml1João Henrique Ferreira de Freitas
diffconfig() is a new task that makes a diff between the old and new config files and writes to the fragment.cfg result file. menuconfig() always copy the original config file, so the user doesn't need to copy it. Signed-off-by: João Henrique Ferreira de Freitas <joaohf@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2014-01-28cml1.bbclass: Fix return code handling in do_menuconfig()Jacob Kroon
On my system, doing "bitbake -c menuconfig busybox" pops up a gnome-terminal, I can see that the compilation starts but then the terminal automatically exits. It turns out I don't have ncurses development package installed on my host, and OE's host sysroot isn't being passed to gcc, so compilation fails. The window automatically closes before I can read the error message since the '$' in the return code check needs to be escaped. Make sure the user can read the error message by properly checking the return code. Signed-off-by: Jacob Kroon <jacob.kroon@mikrodidakt.se> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-25cml1: set and export TERMINFO, to handle ncurses-native relocationFahad Usman
ncurses library looks at the compiled-in search path for the terminfo database, and that path no longer exists, when using cached binaries (sstate). Export TERMINFO pointing at the current sysroot, so the attempt to run mconf is able to find the correct terminfo db. Signed-off-by: Christopher Larson <chris_larson@mentor.com> the patch was imported from meta-mentor layer on yoctoproject git server http://git.yoctoproject.org/cgit/cgit.cgi/meta-mentor as of commit id 0cae284f294e3a2c99d9a4d79c95c25103cd8f8b Signed-off-by: Fahad Usman <fahad_usman@mentor.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-09-27cml1.bbclass: Convert tab indentation in python functions into four-spaceJason Wessel
Based on the previous commit 604d46c686d06d62d5a07b9c7f4fa170f99307d8 (Convert tab indentation in python functions into four-space), the cml.bbclass was not converted, and in order to properly extend it with external bbappend's it needs to be converted. Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-20Replace "echo -e" with "printf" to have the same behavior in dash or bashAndrei Gherzan
oe-core removed the prerequisite to have sh as bash. POSIX doesn't define any options and furthermore allows 'echo -e' to be the default behavior. This means that in dash 'echo -e' will actually print '-e' and interpret backslashes by default. We use instead 'printf' builtin command with or without '\n' to simulate 'echo -e' or 'echo -n'. 'printf' needs format while 'echo' can be used without any arguments. So 'echo >' was replaced by 'printf "" >'. 'echo' without '-n' flag adds a new line by default so to keep the same behavior of two new lines while using 'echo "\n"', 'printf "\n\n"' is used. [YOCTO #3138] Signed-off-by: Andrei Gherzan <andrei@gherzan.ro> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-25cml1.bbclass: Only delay exit if the command failsDarren Hart
Rather than pause for 5 seconds, test the return code of the command and require user input before exiting on failure. This avoids pausing after successful command execution as well as possibly not waiting long enough if the user happens to be doing something else for 5 seconds. Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2012-06-21classes/cml1: ensure -c menuconfig forces a rebuild next timePaul Eggleton
Ensure the following results in the kernel being rebuilt, repackaged and re-deployed in the final step: bitbake virtual/kernel bitbake -c menuconfig virtual/kernel [ make changes to the kernel configuration and save ] bitbake virtual/kernel If there are no changes to the configuration saved, the rebuild will not be triggered. Note that this relies on a function recently added to BitBake and requires full hashing (i.e. BB_SIGNATURE_HANDLER must be set to a signature handler that inherits from BasicHash) - if this is not the case or the function is not available in the version of BitBake being used this change will do nothing. Fixes [YOCTO #2256]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2012-06-12cmd1.bbclass: Ensure ncurses is built and used for menuconfig tasksRichard Purdie
Currently, the task just exits if something goes wrong. This adds the ncurses-native dependency. It also adds a small delay before closing the window so any messages displayed there can be seen. Trying to get the kernel build system to correctly find and link with our copy of ncurses is some kind of nightmare. I ended up having to add it to HOST_LOADLIBES globally for this task which is rather nasty but I couldn't find any other way. [YOCTO #2513] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-15cml1/kernel: Update do_menuconfig to use oe.terminal()Richard Purdie
The recent environment fixes broke the menuconfig task since it couldn't access variables like DISPLAY. This patch updates it to use oe.terminal instead allowing it to work again. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-04kernel,cml1.bbclass: Move menuconfig to cml1Noor, Ahsan
* The menuconfig target exists in places other than the kernel that use kernel style config. Signed-off-by: Noor, Ahsan <noor_ahsan@mentor.com>
2006-07-21Rename /openembedded/ -> /meta/Richard Purdie
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@530 311d38ba-8fff-0310-9ca6-ca027cbcb966