summaryrefslogtreecommitdiffstats
path: root/meta/files
diff options
context:
space:
mode:
authorYoann Congal <yoann.congal@smile.fr>2025-10-24 02:16:18 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-10-27 17:20:42 +0000
commit57976f570937d636ff003f22a12e8872ac9fc3b8 (patch)
tree0eef0ef64cd9407c8b7b4c66ca30060d759ee116 /meta/files
parent6a2a827e9ceedcf7d9e43284b26a03289af7ed2a (diff)
downloadpoky-57976f570937d636ff003f22a12e8872ac9fc3b8.tar.gz
meta/files: Add a jsonschema for bitbake-setup configuration files
This schema is a bit loose and should validate any configuration files working with bitbake-setup but, also, some broken ones: * If present, a "bb-layer" can be an empty array. * bb-setup need at least one of "bb-layers" or "oe-template", that is not enforced in the current schema. * bb-setup accepts "configurations = []" but it results in a impossible choice in interactive mode. This is rejected by the schema. * In each configuration, "name" and "description" are optional but the flatten configuration must have them. This is not enforced by the schema. To test a configuration files against this schema: (for exemple to validate bitbake default registry) $ pip install check-jsonschema $ check-jsonschema -v --schemafile meta/files/bitbake-setup.schema.json bitbake/default-registry/configurations/* ok -- validation done The following files were checked: bitbake/default-registry/configurations/oe-nodistro.conf.json bitbake/default-registry/configurations/poky-master.conf.json (From OE-Core rev: 15107ba12ff35b27c2c0ae5a9dcc9c1418f55b13) Signed-off-by: Yoann Congal <yoann.congal@smile.fr> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/files')
-rw-r--r--meta/files/bitbake-setup.schema.json108
1 files changed, 108 insertions, 0 deletions
diff --git a/meta/files/bitbake-setup.schema.json b/meta/files/bitbake-setup.schema.json
new file mode 100644
index 0000000000..5101b0de53
--- /dev/null
+++ b/meta/files/bitbake-setup.schema.json
@@ -0,0 +1,108 @@
1{
2 "$schema": "https://json-schema.org/draft/2020-12/schema",
3 "description": "Schema for bitbake-setup configuration files",
4 "type": "object",
5 "required": [
6 "description",
7 "bitbake-setup",
8 "version"
9 ],
10 "properties": {
11 "description": {
12 "type": "string",
13 "description": "Description of the bitbake-setup configuration file"
14 },
15 "sources": {
16 "$ref": "layers.schema.json#/properties/sources"
17 },
18 "bitbake-setup": {
19 "type": "object",
20 "description": "BitBake-setup configurations",
21 "required": [
22 "configurations"
23 ],
24 "properties": {
25 "configurations": {
26 "type": "array",
27 "minItems": 1,
28 "$anchor": "configurations",
29 "items": {
30 "type": "object",
31 "properties": {
32 "name": {
33 "type": "string",
34 "description": "Name of the configuration"
35 },
36 "description": {
37 "type": "string",
38 "description": "Human-readable description of the configuration"
39 },
40 "bb-layers": {
41 "type": "array",
42 "description": "List of BitBake layers to include",
43 "items": {
44 "type": "string"
45 }
46 },
47 "oe-template": {
48 "type": "string",
49 "description": "OE-template configuration"
50 },
51 "oe-fragments": {
52 "$anchor": "oe-fragments",
53 "type": "array",
54 "description": "List of BitBake configuration fragments to enable",
55 "items": {
56 "type": "string"
57 }
58 },
59 "oe-fragments-one-of": {
60 "type": "object",
61 "description": "Mutually exclusive bitbake configuration fragment",
62 "patternProperties": {
63 ".*": {
64 "type": "object",
65 "required": [
66 "description",
67 "options"
68 ],
69 "properties": {
70 "description": {
71 "type": "string",
72 "description": "Human-readable description of the fragment category"
73 },
74 "options": {
75 "$ref": "#oe-fragments"
76 }
77 },
78 "additionalProperties": false
79 }
80 },
81 "additionalProperties": false
82 },
83 "configurations": {
84 "$ref": "#configurations"
85 },
86 "bb-env-passthrough-additions": {
87 "type": "array",
88 "description": "List of environment variables to include in BB_ENV_PASSTHROUGH_ADDITIONS",
89 "items": {
90 "type": "string"
91 }
92 }
93 },
94 "additionalProperties": false
95 }
96 }
97 },
98 "additionalProperties": false
99 },
100 "version": {
101 "description": "The version of this document; currently '1.0'",
102 "enum": [
103 "1.0"
104 ]
105 }
106 },
107 "additionalProperties": false
108}