From: Joshua Watt <jpewhacker@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: Joshua Watt <JPEWhacker@gmail.com>
Subject: [OE-core][RFC] Layer Setup JSON schema and example
Date: Wed, 6 Jul 2022 14:53:11 -0500 [thread overview]
Message-ID: <20220706195311.974830-1-JPEWhacker@gmail.com> (raw)
Defines a common schema for layer setup that can be consumed by tools to
know how to fetch and assemble layers for end users. Also includes an
example of the layer setup that constructs poky for reference.
The schema can be used to validate a layer setup file with the commands:
$ python3 -m pip install jsonschema
$ jsonschema -i meta/lib/layers.example.json meta/lib/layers.schema.json
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
meta/lib/layers.example.json | 35 +++++++++++
meta/lib/layers.schema.json | 113 +++++++++++++++++++++++++++++++++++
2 files changed, 148 insertions(+)
create mode 100644 meta/lib/layers.example.json
create mode 100644 meta/lib/layers.schema.json
diff --git a/meta/lib/layers.example.json b/meta/lib/layers.example.json
new file mode 100644
index 0000000000..33264dac9e
--- /dev/null
+++ b/meta/lib/layers.example.json
@@ -0,0 +1,35 @@
+{
+ "version": "1.0",
+ "sources": [
+ {
+ "name": "poky",
+ "path": "poky",
+ "description": "Poky reference distribution",
+ "remote": {
+ "type": "git",
+ "branch": "master",
+ "rev": "bc6d96e69684253a7236594cb0af2738be06b7a9",
+ "remotes": [
+ {
+ "name": "origin",
+ "uri": "git://git.yoctoproject.org/poky"
+ }
+ ]
+ },
+ "layers": [
+ {
+ "name": "meta",
+ "subpath": "meta"
+ },
+ {
+ "name": "meta-poky",
+ "subpath": "meta-poky"
+ },
+ {
+ "name": "meta-yocto-bsp",
+ "subpath": "meta-yocto-bsp"
+ }
+ ]
+ }
+ ]
+}
diff --git a/meta/lib/layers.schema.json b/meta/lib/layers.schema.json
new file mode 100644
index 0000000000..19df89d38b
--- /dev/null
+++ b/meta/lib/layers.schema.json
@@ -0,0 +1,113 @@
+{
+ "description": "OpenEmbedder Layer Setup Manifest",
+ "type": "object",
+ "additionalProperties": false,
+ "required": [
+ "version"
+ ],
+ "properties": {
+ "version": {
+ "description": "The version of this document; currently '1.0'",
+ "enum": ["1.0"]
+ },
+ "sources": {
+ "description": "The list of layer sources",
+ "type": "array",
+ "items": {
+ "type": "object",
+ "description": "The upstream source from which a set of layers may be fetched",
+ "additionalProperties": false,
+ "required": [
+ "name",
+ "path"
+ ],
+ "properties": {
+ "name": {
+ "description": "The name of this layer source",
+ "type": "string"
+ },
+ "path": {
+ "description": "The path where this layer source will be placed when fetching",
+ "type": "string"
+ },
+ "description": {
+ "description": "A description of this layer source",
+ "type": "string"
+ },
+ "layers": {
+ "description": "The list of layers to be used from this upstream source",
+ "type": "array",
+ "items": {
+ "description": "A layer from the upstream source",
+ "type": "object",
+ "additionalProperties": false,
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "name": {
+ "description": "The name of the layer",
+ "type": "string"
+ },
+ "subpath": {
+ "description": "The subpath (relative to the source root) for this layer. Omit if the source root is the layer path",
+ "type": "string"
+ }
+ }
+ }
+ },
+ "remote": {
+ "oneOf": [
+ {
+ "description": "A remote git source from which to fetch",
+ "type": "object",
+ "additionalProperties": false,
+ "required": [
+ "type",
+ "rev"
+ ],
+ "properties": {
+ "type": {
+ "description": "This is a git source",
+ "enum": ["git"]
+ },
+ "branch": {
+ "description": "The git branch to fetch (optional)",
+ "type": "string"
+ },
+ "rev": {
+ "description": "The git revision to checkout",
+ "type": "string"
+ },
+ "remotes": {
+ "description": "The list of git remotes to add to this repository",
+ "type": "array",
+ "items": {
+ "description": "A git remote",
+ "type": "object",
+ "addtionalProperties": false,
+ "required": [
+ "name",
+ "uri"
+ ],
+ "properties": {
+ "name": {
+ "description": "The name of the remote",
+ "type": "string"
+ },
+ "uri": {
+ "description": "The URI for the remote",
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ }
+}
--
2.33.0
next reply other threads:[~2022-07-06 19:54 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-06 19:53 Joshua Watt [this message]
2022-07-06 21:10 ` [OE-core][RFC] Layer Setup JSON schema and example Alexander Kanavin
2022-07-06 21:44 ` Joshua Watt
2022-07-07 10:02 ` Ross Burton
2022-07-07 10:17 ` Alexander Kanavin
2022-07-07 10:36 ` Ross Burton
2022-07-07 10:39 ` Alexander Kanavin
2022-07-07 13:14 ` Joshua Watt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220706195311.974830-1-JPEWhacker@gmail.com \
--to=jpewhacker@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox