summaryrefslogtreecommitdiffstats
path: root/scripts/lib/bsp/engine.py
Commit message (Collapse)AuthorAgeFilesLines
* scripts/lib/bsp: delete, all users have been removedJoshua Lock2017-11-051-1931/+0
| | | | | | | | | | | With the removal of yocto-bsp and yocto-kernel there are no longer any users of this library, therefore delete it. (From meta-yocto rev: 0d44e59bfaa95162cf2133df1d08f6419314bb8e) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* yocto-bsp: Refactor script to use argparse instead of optparseHumberto Ibarra2016-07-071-23/+7
| | | | | | | | | | | Optparse is deprecated and should be avoided. The arparse library is better suited and has more tools to handling the parsing of arguments. This patch makes necessary changes to migrate to the better library and uses arparse subcommand feature to improve organization of this script. [YOCTO #8321] (From meta-yocto rev: 3f45993b96d4d960da0efe8672dc323c9db091a2) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/lib/bsp/engine.py: Add error message for wrong input fileHumberto Ibarra2016-07-071-2/+4
| | | | | | | | | | | Format of properties file is expected to be a simple json detailing properties, if this format fails an exception is thrown. This patch adds a graceful error message to the case when the properties file has a wrong format. [YOCTO #9750] (From meta-yocto rev: 7e543aa19d0d4b2112e6316783fb31b76df3493e) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/lib/bsp/engine.py: Added missing parentheses to string formattingHumberto Ibarra2016-06-121-1/+1
| | | | | | | | | | | | | | Commit ab75075e7941c8c2ec429c180976702cd311c978 broke the string formatting for multiple arguments. Since parentheses were removed the formatting considers only first argument instead of all of them. Fixed parentheses on the formatting. [YOCTO #9723] (From meta-yocto rev: d6d641d5b4bb0c8b9acd5cd1341a4a3214bff086) Signed-off-by: Humberto Ibarra <humberto.ibarra.lopez@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/lib/bsp/engine.py: Rename raw_input commands to inputHumberto Ibarra2016-06-121-2/+2
| | | | | | | | | | | | | | According to https://docs.python.org/3/whatsnew/3.0.html python3 renamed 'raw_input' to 'input'. Making the appropiate changes for this. [YOCTO #9723] (From meta-yocto rev: 76efeeeac7fb30b44ee7057b3b3d1fd84329dae1) Signed-off-by: Humberto Ibarra <humberto.ibarra.lopez@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/lib/bsp/engine.py: Added missing keyword to fix syntax errorHumberto Ibarra2016-06-071-1/+1
| | | | | | | | | | | | Commit af9f6b88fcc5d7fddff01595f9bcf2aba548720 introduced a syntax error in engine.py by removing keyword "in". This patch adds it back. [Yocto #9719] (From meta-yocto rev: 49f02f3344617f8b077edf61e8f5ead05e8405eb) Signed-off-by: Humberto Ibarra <humberto.ibarra.lopez@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* engine: python3: replace iteritems() -> items()Ed Bartosh2016-06-031-3/+3
| | | | | | | | | Used items() as iteritems() doesn't exist in python 3. (From meta-yocto rev: 0fd2e739cd14c6a02b6f4610176a0ad29b2ecc0e) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts: python3: replace exec statement with builtinEd Bartosh2016-06-031-1/+1
| | | | | | | | | | Used exec() builtin instead of 'exec' statement as this statement doesn't exist in python 3. (From meta-yocto rev: ceb6c6fac212c5e1e76bf58b793dc2b9420b4a66) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts: python3: use explicit relative importsEd Bartosh2016-06-031-1/+1
| | | | | | | | | | | | Implicit relative imports within packages are not supported in python 3. They have to be converted to explicit imports. Used 'from .module import' syntax for relative imports. (From meta-yocto rev: 8eb2befc544e29fd87ac1fc75886cc6d7f40ad90) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* engine.py: python3: rename sys.maxint to sys.maxsizeEd Bartosh2016-06-031-3/+3
| | | | | | | | | | Renamed sys.maxint -> sys.maxsize as sys.maxint doesn't exist in python 3. (From meta-yocto rev: b165be8c7f6d44c03bc76dd25c2b9e4cb54bb65a) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts: python3: use new metaclass syntaxEd Bartosh2016-06-031-4/+2
| | | | | | | | | | | Used metaclass=<metaclass> syntax instead old __metaclass__ = <metaclass> as only new one is supported in python 3. (From meta-yocto rev: 70ba79981d904b4b67440c0b5755b5449cddb025) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts: python3: rename raw_input to inputEd Bartosh2016-06-031-6/+6
| | | | | | | | | | Renamed raw_input to input as raw_input does not exist in python 3. (From meta-yocto rev: c9df9f2699885f2ba5b031c8761aefbf3c796067) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts: python3: Use print functionEd Bartosh2016-06-011-19/+19
| | | | | | | | | | Used print function instead of print statement to make the code work in python 3. (From meta-yocto rev: d6eea5a794dd8802b773a9186479a863847e6e55) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/lib/bsp/engine: trailing whitespace cleanupMaciej Borzecki2016-02-081-2/+2
| | | | | | | | (From meta-yocto rev: 3f19a080b2370c0317f88299d392a5b1a5f9c830) Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/lib/bsp/engine: fix path separatorMaciej Borzecki2016-02-081-1/+1
| | | | | | | | | | Make path to newly generated README file legitimate (From meta-yocto rev: 32286bb798c2778457b5578b4b590629c96a0ee2) Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/lib/bsp/engine: Indent the karch properties when stored into a fileLeonardo Sandoval2015-10-011-1/+1
| | | | | | | | | | Make a bit more human-friendly the karch properties when storing into a file. (From meta-yocto rev: 39292d397658a8e30c73d4cdaced66cb0efa8380) Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scrips/lib/bsp/engine: List properties to stdout when output parameter is ↵Leonardo Sandoval2015-10-011-2/+2
| | | | | | | | | | | | | omitted When user wants to output the list of properties for a corresponding architecture and the output parameter is given (--o/-outfile), there is no need to show the properties into the console. (From meta-yocto rev: bd133e2a6e626b4158f5a303d85205de9c66e8f2) Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* yocto-bsp: Add a processing pass to get rid of 'strange' filenamesTom Zanussi2014-12-181-3/+170
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Operating systems that can't handle filenames containing anything but uppercase letters don't like to see 'strange' characters in filenames such as the file and directory names yocto-bsp uses as part of its templating mechanism. To fix this, we essentially add another level of metadata into the template files themselves rather than into their names, and add a processing pass that internally gives us what we had before. Specifically: - strange characters in filenames are moved inside the files they apply to, to the first line of the file prepended with '# yocto-bsp-filename {{...}} filename | this' - strange characters in directory names are moved inside a new file of the same name but ending in .noinstall and with the first (and only) line of the file prepended with '# yocto-bsp-dirname {{...}} dirname' If the new filename contained in the yocto-bsp-* tag is 'this', the filename is the existing name of the file. For a dirname, this would be the filename with .noinstall removed. "Fixes" [YOCTO #5312]. (From meta-yocto rev: 3dad2decbd682713f717950fc39fa0f63f1b8c98) Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* yocto-bsp: filter out 'layer' from arch listTom Zanussi2013-07-051-1/+1
| | | | | | | | | | | | | | | | | The yocto-layer tool added a new directory alongside the actual architectures and 'common', which is already screened out as not an actual architecture when displaying the architecures. The same needs to be done for 'layer' which isn't actually an architecuture and likewise needs to be screened out. Fixes [YOCTO #4735]. (From meta-yocto rev: 7459485bf75855a40d124915d38284f737a25cc4) Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* yocto-bsp: have replace_file() close file before copyingTom Zanussi2013-04-051-1/+2
| | | | | | | | | | | | replace_file needs to make sure the file it's replacing is closed before replacing it, otherwise unexpected results may ensue. Fixes [YOCTO #4145]. (From meta-yocto rev: 1339dbb690d51456b4474356992e430638469e47) Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/lib/bsp/engine.py: add preempt-rt and tiny to map_standard_kbranch()Tom Zanussi2013-03-171-0/+36
| | | | | | | | | Update map_standard_kbranch() with preempt-rt and tiny variants. (From meta-yocto rev: 48233b051b0599ee745d0b8d24863a08e7440d6a) Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/lib/bsp/engine.py: update map_standard_kbranch()Tom Zanussi2013-03-171-8/+6
| | | | | | | | | | Update map_standard_kbranch() to be consistent with the new changes in meta naming and remove obsolete standard/default mapping. (From meta-yocto rev: 40998ba44e1a4ebb1c165cab1a250025041e0da0) Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/lib/bsp/engine.py: add handling for JSON stringsTom Zanussi2013-01-201-4/+7
| | | | | | | | | | | | | | | | | Normally pre-canned properties are supplied as JSON from a file, which the user can specify using e.g. the -i option. We can reuse that basic functionality for dedicated command-line parameters by sythesizing a JSON string containing those param values on the fly and passing that in instead. This adds the ability for the common creation code to accept JSON strings as well as JSON files. (From meta-yocto rev: 5a2e840b24822e018de94ec4f554363b59c4e8bd) Signed-off-by: Tom Zanussi <tom.zanussi@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/lib/bsp/engine.py: refactor bsp-creation codeTom Zanussi2013-01-201-65/+76
| | | | | | | | | | | | | This does a bit of refactoring of the bsp-generation code to make it generically reusable for generating non-bsp layers. The first user remains the existing yocto-bsp tool; these changes allow a second user, the new yocto-layer tool, to use the same code. (From meta-yocto rev: 1527a0ee7bce08a527c9d80516531b17816dff17) Signed-off-by: Tom Zanussi <tom.zanussi@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/lib/bsp/engine.py: add yocto_layer_create()Tom Zanussi2013-01-201-0/+56
| | | | | | | | | | Add a new yocto_layer_create() function that will be used to generate a generic yocto layer (for the new 'yocto-layer' command). (From meta-yocto rev: 44acd01bf47c2e0a777e686c9339a6ff951fc972) Signed-off-by: Tom Zanussi <tom.zanussi@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* yocto-bsp: add replace_file()Tom Zanussi2012-12-131-3/+15
| | | | | | | | | | | Add a function that can be used to replace a template file by a user-specified file. The initial use of this capability is to allow users-specified defconfigs. (From meta-yocto rev: b52a22d40d4701a9515490bdd31c8d0341fb12bc) Signed-off-by: Tom Zanussi <tom.zanussi@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* yocto-bsp: add 'edit-file' input lineTom Zanussi2012-12-131-0/+57
| | | | | | | | | | Add a subclassed edit box that verifies the existence of a user-specified file. (From meta-yocto rev: 8ca7f688a6a0e41dd6527b1c13ebaa77bbfeba69) Signed-off-by: Tom Zanussi <tom.zanussi@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* yocto-bsp: add 'edit-git-repo' input lineTom Zanussi2012-12-131-0/+76
| | | | | | | | | | | | | Add a subclassed edit box that verifies the existence of a user-specified git repo. Also adds a verify_git_repo() function that can be used as a basic sanity check for local git setup. (From meta-yocto rev: 64f1176d62ed02d7c61d32fdae11dc8b7d365603) Signed-off-by: Tom Zanussi <tom.zanussi@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* yocto-bsp: set branches_base for list_property_values()Tom Zanussi2012-10-221-0/+4
| | | | | | | | | | | | yocto_bsp_list_property_values() is missing the context it needs to properly filter choicelists, so add it to the context object. Fixes [YOCTO #3233] (From meta-yocto rev: 064b15f76c5b52899f4c3fdef06412c3063062a5) Signed-off-by: Tom Zanussi <tom.zanussi@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* yocto-bsp: add new strip_base() functionTom Zanussi2012-09-021-0/+10
| | | | | | | | | | | Add a strip_base() function to remove '/base' from the branch names presented to the user. (From meta-yocto rev: 216a38f6bb453e8e6617f82c3642151dbde2f377) Signed-off-by: Tom Zanussi <tom.zanussi@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* yocto-bsp: update standard branch mappingTom Zanussi2012-08-251-3/+3
| | | | | | | | | | Remove mapping for 3.0 and add mapping for 3.4. (From meta-yocto rev: e4ddfcda2cc6aad0c3e99066d43d69f5c1ab2f18) Signed-off-by: Tom Zanussi <tom.zanussi@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* yocto-bsp: generate default properties even if json specifiedTom Zanussi2012-08-251-2/+2
| | | | | | | | | | | | | Users seem to want to specify incomplete property sets when using json input. Allow this by generating default properties before the user-specified properties are applied; the user will then get the defaults for any unspecified values, and avoid cryptic backtraces. (From meta-yocto rev: 3f0361f77cf64844da93ba4a76c42cd5befff5ad) Signed-off-by: Tom Zanussi <tom.zanussi@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* yocto-bsp: use rstrip() for assignment linesTom Zanussi2012-08-251-1/+1
| | | | | | | | | | | | strip() isn't necessary and causes unintended formatting changes in the output; rstrip() remove the trailing newlines as intended while leaving indenting whitespace intact. (From meta-yocto rev: 0caa6cd8c094b531ee8e78154dbf5a8e6014d1fd) Signed-off-by: Tom Zanussi <tom.zanussi@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* yocto-bsp: add standard branch mappingTom Zanussi2012-08-251-0/+21
| | | | | | | | | | | Add a mechanism to distinguish common-pc variants of standard branches. (From meta-yocto rev: c313ad936499104235c47f05bd98ef86b990d713) Signed-off-by: Tom Zanussi <tom.zanussi@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* yocto-bsp: allow branch display filteringTom Zanussi2012-08-251-0/+7
| | | | | | | | | | | Add a "branches_base" property that can be used to allow only matching branches to be returned from all_branches(). (From meta-yocto rev: c3481e22fc4690ff5e449f9c16c2453fa964205d) Signed-off-by: Tom Zanussi <tom.zanussi@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* yocto-bsp: enable property value display of nested propertiesTom Zanussi2012-04-141-2/+54
| | | | | | | | | | | Previous versions of yocto-bsp mapped every input element to a unique variable name, which is what the current property value display code expects. When that was changed to a nested form, the display code wasn't updated to match - this updated does that. Fixes [YOCTO #2222] Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
* yocto-bsp: add templating engineTom Zanussi2012-03-221-0/+1436
The main implementation of the Yocto BSP templating engine, essentially containing the internal implementation of the 'yocto-bsp create' and yocto-bsp list' commands. Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>