Commit graph

11 commits

Author SHA1 Message Date
Christian Kellner
5b1cd2b1c5 schema/v2: make mount source and target optional
The previous commit gave the individual mounts more control over the
source and target properties. Do not require them at the global
schema but hand the control if they are optional over to the modules.
2021-10-30 15:32:44 +01:00
Christian Kellner
45d0594b1b device: add support for parent devices
This allows device nesting, i.e. one device being opened inside another
one.
2021-08-13 12:20:54 +02:00
Christian Kellner
ae1296e33a formats/v2: mounts are arrays
The order of entries in a dictionary is not specified by the JSON
standard and hard to control when marshalling dictionaries in Go.
Since the order of mounts is important and the wrong order leads
to wrong mount trees change the `mounts` field to an array. This
breaks existing manifests but after careful deliberation it was
concluded that the original schema with mounts as dictionaries
is not something we want to support. Apologies to everyone.

Adjust the schema of the copy and zipl stage accordingly.
2021-07-21 13:28:22 +02:00
Christian Kellner
50627b713c schema/v2: make options for devices optional
Some devices might not need any options.
2021-07-21 13:28:22 +02:00
Christian Kellner
367a044453 osbuild: introduce mount host service
Allows stages to access file systems provided by devices.
This makes mount handling transparent to the stages, i.e.
the individual stages do not need any code for different
file system types and the underlying devices.
2021-06-09 18:37:47 +01:00
Christian Kellner
4f211eb0a5 osbuild: introduce device host service
A new host service that provides device functionality to stages.
Since stages run in a container and are restricted from creating
device nodes, all device handling is done in the main osbuild
process. Currently this is done with the help of APIs and RPC,
e.g. `LoopServer`. Device host services on the other hand allow
declaring devices in the manifest itself and then osbuild will
prepare all devices before running the stage. One desired effect
is that it makes device handling transparent to the stages, e.g.
they don't have to know about loopback devices, LVM or LUKS.
Another result is that specific device handling is now modular
like Inputs and Source are and thus moved out of osbuild itself.
2021-06-09 18:37:47 +01:00
Christian Kellner
47fefe7e2d schema/v2: restrict input names
Ensure that input names start with a character and otherwise only
contain characters, numbers, `-`, `_` and `.`. Limit their length
to 255.
2021-06-09 18:37:47 +01:00
Christian Kellner
2771656f02 schema: add version 2 manifest schema
This is the first draft of the new manifest version.
2021-02-12 15:55:43 +01:00
Christian Kellner
20a4ba45c6 schema/osbuild1.json: convert to draft4 standard
The 'required' array with an empty is the only thing that requires
this to be draft6 (or higher) [1]. Remove that and downgrade the
schema to draft4 [2].
[1] https://json-schema.org/draft-06/json-schema-release-notes.html
[2] https://json-schema.org/specification-links.html#draft-4
2020-05-12 22:00:38 +02:00
Christian Kellner
651326c610 schemas/osbuild1: specify exact schema version
Using the "$schema" without any specific version has been
deprecated[1] and will lead to warnings like:

  DeprecationWarning: The metaschema specified by
  $schema was not found. Using the latest draft to validate,
  but this will raise an error in the future

Fix this by pointing $schema to "draft-07", which is the latest
version fully supported the jsonschema python package, that is
being used internally.

[1]
  "The possibility to declare $schema without specific version
  (http://json-schema.org/schema#) was deprecated after Draft 4
  and should no longer be used."
  https://json-schema.org/understanding-json-schema/reference/schema.html
2020-05-06 15:42:23 +02:00
David Rheinsberg
911fa1d92b schema: add json-schema describing our manifest
This adds a non-binding, documentational-only json-schema to
schemas/osbuild1.json which describes the format of the pipeline
manifest taken as input to osbuild. This is currently for
documentational purposes, but is definitely open to be used for actual
runtime verification.

The manifest does not describe options to assemblers, stages, or
sources. These are left as arbitrary json-objects and need separate
validation, if required. Note that most stages already contain an
embedded schema for their parameters.
2020-03-07 13:43:24 +01:00