summaryrefslogtreecommitdiffstats
path: root/meta/lib/bblayers
Commit message (Collapse)AuthorAgeFilesLines
* bblayers/machines: add bitbake-layers command to list machinesRoss Burton2024-08-091-0/+37
| | | | | | | | | | Add a command to bitbake-layers to list the machines available in the current configuration. (From OE-Core rev: 837d32dafc125d58bb11da990ac251bd5aad027e) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bblayers/makesetup: move check for existence of git remotes to ↵Alexander Kanavin2024-05-282-4/+3
| | | | | | | | | | | | | | | | oe-setup-layers plugin This helps when making a local copy of all the layers: it's fine to not have any remotes configured in that case. Also correct the mistake in accessing 'contains_this_file' property: it may not necessarily exist, and if so, it should default to False. (From OE-Core rev: 639df31e57b7f3da2d475cbae9a79d45755dede6) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bblayers/makesetup: include local repository paths in discovered layer repo dataAlexander Kanavin2024-05-282-0/+3
| | | | | | | | | | | | | | | This can be useful when the caller needs to know where the repos actually are on local disk (for example to make a local copy of them or obtain additional information about them). This field however should be removed from the json output in oe-setup-layers plugin, as it is host-specific and not part of the schema. (From OE-Core rev: ee33ebf6140ad13e401c2cccbb106a22043be356) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bblayers/makesetup: raise exceptions when errors happenAlexander Kanavin2024-05-281-4/+6
| | | | | | | | | | | | Otherwise the calling code can only issue a generic, unhelpful erorr message, and it's difficult to tell what went wrong if logger.error output is obscured or redirected. (From OE-Core rev: 155fe6bda2d715aa616fa8db922dbaa11ebb8080) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bblayers/makesetup.py: Move git utility functions to oe.buildcfg moduleJermain Horsman2024-03-301-23/+10
| | | | | | | | | | | | This allows other classes to make use of these as well. Includes a git describe and git toplevel function and functions to get info for git remotes. (From OE-Core rev: a04a084b6e513d15cb57ee103c6d6215ce1c75b9) Signed-off-by: Jermain Horsman <jermain.horsman@nedap.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake-layers: Add ability to update the reference of repositoriesJermain Horsman2024-02-191-7/+72
| | | | | | | | | | | | | | | This creates a new layers setup with, or, modifies an existing layers setup using, one or more repositories where the references are provided by the user. This is a very minimal implementation, no validation of any reference is done and it is left to the user to provide a valid value. (From OE-Core rev: e69444de713e1ec7959c71f9cdf965d3b5a1c6be) Signed-off-by: Jermain Horsman <jermain.horsman@nedap.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta/lib/bblayers/buildconf.py: add support for configuration summariesAlexander Kanavin2024-02-191-3/+9
| | | | | | | (From OE-Core rev: 7117e3d08570202c79d618d4fb6a67895b1df564) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/bblayers/buildconf.py: Remove unused imports/variablesJermain Horsman2024-01-041-7/+0
| | | | | | | (From OE-Core rev: 720f48c0692a4cbb00535151b049704645748216) Signed-off-by: Jermain Horsman <jermain.horsman@nedap.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/bblayers/makesetup.py: Remove unused importsJermain Horsman2024-01-041-2/+0
| | | | | | | (From OE-Core rev: 789549ed28c043a6d9b304f99f528546f4ade957) Signed-off-by: Jermain Horsman <jermain.horsman@nedap.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/bblayers/setupwriters/oe-setup-layers.py: Fix indentationJermain Horsman2023-11-091-1/+1
| | | | | | | | | | The writer always printed the script was written even if this was not the case when specififying '--json-only'. (From OE-Core rev: b2efb4c6c8bd938aac5146e14bd0c38f3f632bc4) Signed-off-by: Jermain Horsman <jermain.horsman@nedap.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* create.py: add command arg to add layer to bblayers.confPedro Baptista2023-02-241-1/+10
| | | | | | | | | | | Add command arg `--add-layer` which enables the create and add layer in a single step. (From OE-Core rev: f3be788a55a2dde1f627aa85b08dc3ffa55d751f) Signed-off-by: Pedro Baptista <pedro.miguel.baptista@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bblayers/makesetup: skip git repos that are submodulesAlexander Kanavin2023-02-151-0/+10
| | | | | | | | (From OE-Core rev: d8bc9cd4ca8ae268a61024f8ac5083a2bbdc432f) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bblayers/setupwriters/oe-setup-layers: create dir if not existsAdrian Freihofer2023-02-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without this patch: $ bitbake-layers create-layers-setup /home/adrian/temp/poky-clone NOTE: Starting bitbake server... Traceback (most recent call last): File "/home/adrian/projects/poky/bitbake/lib/bb/process.py", line 169, in run pipe = Popen(cmd, **options) File "/home/adrian/projects/poky/bitbake/lib/bb/process.py", line 73, in __init__ subprocess.Popen.__init__(self, *args, **options) File "/usr/lib64/python3.10/subprocess.py", line 971, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/lib64/python3.10/subprocess.py", line 1847, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: '/home/adrian/temp/poky-clone' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/adrian/projects/poky/bitbake/bin/bitbake-layers", line 95, in <module> ret = main() File "/home/adrian/projects/poky/bitbake/bin/bitbake-layers", line 88, in main return args.func(args) File "/home/adrian/projects/poky/meta/lib/bblayers/makesetup.py", line 90, in do_make_setup p.do_write(self, args) File "/home/adrian/projects/poky/meta/lib/bblayers/setupwriters/oe-setup-layers.py", line 36, in do_write repos = parent.make_repo_config(args.destdir, args.include_layer_repo) File "/home/adrian/projects/poky/meta/lib/bblayers/makesetup.py", line 55, in make_repo_config destdir_repo = self._get_repo_path(destdir) File "/home/adrian/projects/poky/meta/lib/bblayers/makesetup.py", line 30, in _get_repo_path repo_path, _ = bb.process.run('git rev-parse --show-toplevel', cwd=layer_path) File "/home/adrian/projects/poky/bitbake/lib/bb/process.py", line 172, in run raise NotFoundError(cmd) bb.process.NotFoundError: Execution of 'git rev-parse --show-toplevel' failed: command not found with this patch: $ bitbake-layers create-layers-setup /home/adrian/temp/poky-clone NOTE: Starting bitbake server... NOTE: Created /home/adrian/temp/poky-clone/setup-layers.json NOTE: Created /home/adrian/temp/poky-clone/setup-layers (From OE-Core rev: 2da12ccada46443d58dd8fab463156fa763b84cc) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake-layers: fix a typoEnguerrand de Ribaucourt2023-01-021-1/+1
| | | | | | | (From OE-Core rev: fab3aa7b1b7003bb03678c5cfc62ad2b597f0932) Signed-off-by: Enguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool/friends: Use LAYERSERIES_CORENAMES when generating ↵4.2_M1Richard Purdie2022-12-081-1/+1
| | | | | | | | | | | | | | | | | | LAYERSERIES_COMPAT entries It seems some layers want to subvert the intent of LAYERSERIES_COMPAT so bitbake is going to have to become stricter about the values there. To work with this, use LAYERSERIES_CORENAMES to generate the entries in LAYERSERIES_COMPAT instead of the current magic LAYERSERIES_COMPAT_core value which may not continue to work. The downside to this is when migating between releases, people would need to update devtool workspace layer.conf files. I guess you could argue this is a feature! (From OE-Core rev: 96ff9baa8ead57504f40f362ed3a4aaa776d1b58) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* buildconf: compare abspathAdrian Freihofer2022-10-261-1/+1
| | | | | | | | | | | We have something like ${TOPDIR}/../../poky/meta in the bblayers.conf file. This does not work without normalizing the path for comparison. (From OE-Core rev: e0d45bcd34311ae248bac9378f46962198d148ef) Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta/files/layers.schema.json: drop the layers propertyAlexander Kanavin2022-09-021-2/+1
| | | | | | | | | | | | | | | | | This is a leftover from one of the RFC iterations, where the property contained available machines, distros and templates. As all of those were dropped from the final version, there is no reason to list the layers either anymore. Normally this would be a backwards incompatible change, but as the layer setup itself was just merged, I think we can do a quick fixup :-) (From OE-Core rev: 64a774de0e154ef81f20853fec903b17d9985a72) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake-layers: add ability to save current layer repository configuration ↵Alexander Kanavin2022-09-012-0/+158
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into a file This addresses a long standing gap in the core offering: there is no tooling to capture the currently configured layers with their revisions, or restore the layers from a configuration file (without using external tools, some of which aren't particularly suitable for the task). This plugin addresses the 'capture' part. Note that the actual writing is performed by a sub-plugin; one such sub-plugin is provided (for the json + python script format), but more can be added (e.g. kas, repo, etc.). How to save a layer configuration: a) Running with default choices: $ bitbake-layers create-layers-setup /srv/work/alex/meta-alex/ NOTE: Starting bitbake server... NOTE: Created /srv/work/alex/meta-alex/setup-layers.json NOTE: Created /srv/work/alex/meta-alex/setup-layers b) Command line options: NOTE: Starting bitbake server... usage: bitbake-layers create-layers-setup [-h] [--output-prefix OUTPUT_PREFIX] [--writer {oe-setup-layers}] [--json-only] destdir Writes out a configuration file and/or a script that replicate the directory structure and revisions of the layers in a current build. positional arguments: destdir Directory where to write the output (if it is inside one of the layers, the layer becomes a bootstrap repository and thus will be excluded from fetching). optional arguments: -h, --help show this help message and exit --output-prefix OUTPUT_PREFIX, -o OUTPUT_PREFIX File name prefix for the output files, if the default (setup-layers) is undesirable. --writer {oe-setup-layers}, -w {oe-setup-layers} Choose the output format (defaults to oe-setup-layers). Currently supported options are: oe-setup-layers - a self-contained python script and a json config for it. --json-only When using the oe-setup-layers writer, write only the layer configuruation in json format. Otherwise, also a copy of scripts/oe-setup-layers (from oe-core or poky) is provided, which is a self contained python script that fetches all the needed layers and sets them to correct revisions using the data from the json. (From OE-Core rev: 5606d1a123a3816ab45e49ee7707ed84c9c23c5c) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake-layers: add a command to save the active build configuration as a ↵Alexander Kanavin2022-09-011-0/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | template into a layer This is the reverse of setting up a build by pointing TEMPLATECONF to a directory with a template and running '. oe-init-build-env': this takes the config files from build/conf, replaces site-specific paths in bblayers.conf with ##OECORE##-relative paths, and copies the config files into a specified layer under a specified template name. In many or perhaps most cases such static prefabricated configurations (that require no further editing) are just enough, and I believe they should be offered by the official configuration management. On the other hand, generating build configurations with a sufficiently versatile tool is a far more complex problem, and one we should try to tackle once we see where and how static configs fall short. Tooling to discover and select these templates when setting up a build will be provided later on. How to use: alex@Zen2:/srv/work/alex/poky/build-layersetup$ bitbake-layers save-build-conf ../../meta-alex/ test-1 NOTE: Starting bitbake server... NOTE: Configuration template placed into /srv/work/alex/meta-alex/conf/templates/test-1 Please review the files in there, and particularly provide a configuration description in /srv/work/alex/meta-alex/conf/templates/test-1/conf-notes.txt You can try out the configuration with TEMPLATECONF=/srv/work/alex/meta-alex/conf/templates/test-1 . /srv/work/alex/poky/oe-init-build-env build-try-test-1 alex@Zen2:/srv/work/alex/poky/build-layersetup$ (From OE-Core rev: f319534dc8fc68dfe120d129154a509f0cd6a3b0) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib: Add copyright statements to files without oneRichard Purdie2022-08-121-0/+2
| | | | | | | | | Where there isn't a copyright statement, add one to make it explicit. Also add license identifiers as MIT if there isn't one. (From OE-Core rev: bb731d1f3d2a1d50ec0aed864dbca54cf795b040) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake-bblayers/create: Add optional layerid argumentCharlie Davies2021-03-062-6/+8
| | | | | | | | | | | | | | This commit adds an optional layerid argument which can be passed to the bitbake-layers create-layer command. This allows for creation of a layer with a layer id different to that of the layer's name. The default behaviour of the command where the layer's id is set to the layer's name is still retained. (From OE-Core rev: 8f896bd9b34f19535838757c8f3049bae438e4fe) Signed-off-by: Charlie Davies <charles.davies@whitetree.xyz> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake-bblayers/create: Fix incorrect priority help messageCharlie Davies2021-03-061-1/+1
| | | | | | | | | | The help message for the optional argument of setting the priority of the new layer was incorrect. (From OE-Core rev: d10d928c6030951994bc2404cde78137c86917a4) Signed-off-by: Charlie Davies <charles.davies@whitetree.xyz> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake-bblayers/create: Make the example recipe print its messageYoann Congal2020-10-101-1/+3
| | | | | | | | | | | | | | The example recipe is setup to print a message using bb.plain() in the "do_build" task but this task is "noexec" so the message never prints. This might be confusing. This moves the message printing into another "do_display_banner" task and add it to the do_build "before" list. (From OE-Core rev: 252385bef9b226f32691b8513869ea3e41813b40) Signed-off-by: Yoann Congal <yoann.congal@smile.fr> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta/lib+scripts: Convert to SPDX license headersRichard Purdie2019-05-091-0/+4
| | | | | | | | | | | | | | | | | | | | | | | This adds SPDX license headers in place of the wide assortment of things currently in our script headers. We default to GPL-2.0-only except for the oeqa code where it was clearly submitted and marked as MIT on the most part or some scripts which had the "or later" GPL versioning. The patch also drops other obsolete bits of file headers where they were encoountered such as editor modelines, obsolete maintainer information or the phrase "All rights reserved" which is now obsolete and not required in copyright headers (in this case its actually confusing for licensing as all rights were not reserved). More work is needed for OE-Core but this takes care of the bulk of the scripts and meta/lib directories. The top level LICENSE files are tweaked to match the new structure and the SPDX naming. (From OE-Core rev: f8c9c511b5f1b7dbd45b77f345cb6c048ae6763e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake-bblayers/create: Fix layer name generationJoshua Watt2018-06-293-16/+19
| | | | | | | | | | | | | | | | | | | | | | | The path to where the layer was being created was taken verbatim as the name of the layer when generating the layer.conf and README files from templates. This causes problems in the layer.conf file because it would result in strangely named variables like BBFILE_PATTERN_../my-layer = "..." Instead of blindly taking the path, use the name of the last component of the path as the layer name. Additionally, rework the template files to use python format strings with named parameters so that the same argument doesn't have to be repeated multiple times. [YOCTO #12808] (From OE-Core rev: 01071c5d524a878d9de4814196cba2f15739796e) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake-layers/create: add LAYERSERIES_COMPATAnuj Mittal2018-06-182-1/+7
| | | | | | | | | | | | Derive the value for template layer.conf from core layer and add dependendency on it too. Fixes [YOCTO #12767] (From OE-Core rev: 461c305078c40fca8b5382e393e3e8513d4abfa4) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake-blayers/create: add version for example recipeAnuj Mittal2018-06-151-1/+2
| | | | | | | | | | | | | Add version field in recipe name for example recipe created by bitbake-layers. Fixes [YOCTO #12767] (From OE-Core rev: c62f6b9643d31b465ea0e919882e411a5ed35c56) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* templates/layer.conf: remove backslash to enable bbappend settingChen Qi2017-12-101-1/+1
| | | | | | | | | | | | Remove the redundant backslash in template layer.conf file, otherwise, the bbappend line setting wouldn't have effect, causing bbappend files in these created layers not having any effect. (From OE-Core rev: 7909b258ac87d4be9bb7aba00d12fd363bd9b248) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* action: new bitbake-layer plugin to create a simple layerLeonardo Sandoval2017-08-094-0/+128
Though the script bitbake-layers (from the bitbake project), this plugin creates a simple layer with a example recipe, the latter with a single task (do_build). Layer's license and priority is MIT and 6, respectively. Example recipe and layer's priority can be specified through the command line. [YOCTO #11567] (From OE-Core rev: 2bd1dc287b8b0f7edac8c6fee076a70ebf7adf43) Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>