Files
poky/meta/files/bitbake-setup.schema.json
Yoann Congal 57976f5709 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>
2025-10-27 17:20:42 +00:00

109 lines
4.6 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "Schema for bitbake-setup configuration files",
"type": "object",
"required": [
"description",
"bitbake-setup",
"version"
],
"properties": {
"description": {
"type": "string",
"description": "Description of the bitbake-setup configuration file"
},
"sources": {
"$ref": "layers.schema.json#/properties/sources"
},
"bitbake-setup": {
"type": "object",
"description": "BitBake-setup configurations",
"required": [
"configurations"
],
"properties": {
"configurations": {
"type": "array",
"minItems": 1,
"$anchor": "configurations",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Name of the configuration"
},
"description": {
"type": "string",
"description": "Human-readable description of the configuration"
},
"bb-layers": {
"type": "array",
"description": "List of BitBake layers to include",
"items": {
"type": "string"
}
},
"oe-template": {
"type": "string",
"description": "OE-template configuration"
},
"oe-fragments": {
"$anchor": "oe-fragments",
"type": "array",
"description": "List of BitBake configuration fragments to enable",
"items": {
"type": "string"
}
},
"oe-fragments-one-of": {
"type": "object",
"description": "Mutually exclusive bitbake configuration fragment",
"patternProperties": {
".*": {
"type": "object",
"required": [
"description",
"options"
],
"properties": {
"description": {
"type": "string",
"description": "Human-readable description of the fragment category"
},
"options": {
"$ref": "#oe-fragments"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
"configurations": {
"$ref": "#configurations"
},
"bb-env-passthrough-additions": {
"type": "array",
"description": "List of environment variables to include in BB_ENV_PASSTHROUGH_ADDITIONS",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
}
}
},
"additionalProperties": false
},
"version": {
"description": "The version of this document; currently '1.0'",
"enum": [
"1.0"
]
}
},
"additionalProperties": false
}