From 71249866df72be654a2456fbf1b0f452005bdec9 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 16 Jun 2020 12:45:29 +0200 Subject: [PATCH 1/6] CI: add tooling for schema validation The config files have fairly extensive documentation but no formal description; adding JSON-Schema into the mix makes it possible to write a machine-checkable description. --- ci/configvalidator.py | 110 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 ci/configvalidator.py diff --git a/ci/configvalidator.py b/ci/configvalidator.py new file mode 100644 index 000000000..e3b8ac24e --- /dev/null +++ b/ci/configvalidator.py @@ -0,0 +1,110 @@ +#! /usr/bin/env python3 +# +# SPDX-FileCopyrightText: 2020 Adriaan de Groot +# SPDX-License-Identifier: BSD-2-Clause +# License-Filename: LICENSES/BSD2 +# +usage = """ +Validates a Calamares config file -- YAML syntax -- against a schema. + +The schema is also written in YAML syntax, but the schema itself +is JSON-schema. This is possible because all JSON is YAML, and most +YAML is JSON. The limited subset of YAML that Calamares uses is +JSON-representable, anyway. + +Usage: + configvalidator.py ... +""" + +# The schemata originally lived outside the Calamares repository, +# without documented tooling. By putting them in the repository +# with the example files and explicit tooling, there's a better +# chance of them catching problems and acting as documentation. + +dependencies = """ +Dependencies for this tool are: py-yaml and py-jsonschema. + + https://pyyaml.org/ + https://github.com/Julian/jsonschema + +Simple installation is `pip install pyyaml jsonschema` +""" + +ERR_IMPORT, ERR_USAGE, ERR_FILE_NOT_FOUND, ERR_SYNTAX, ERR_INVALID = range(1,6) + +### DEPENDENCIES +# +# +try: + from jsonschema import validate, SchemaError, ValidationError + from yaml import safe_load, YAMLError +except ImportError as e: + print(e) + print(dependencies) + exit(ERR_IMPORT) + +from os.path import exists +import sys + +### INPUT VALIDATION +# +# +if len(sys.argv) < 3: + print(usage) + exit(ERR_USAGE) + +schema_file_name = sys.argv[1] +config_file_names = sys.argv[2:] + +if not exists(schema_file_name): + print(usage) + print("\nSchema file '{}' does not exist.".format(schema_file_name)) + exit(ERR_FILE_NOT_FOUND) +for f in config_file_names: + if not exists(f): + print(usage) + print("\nYAML file '{}' does not exist.".format(f)) + exit(ERR_FILE_NOT_FOUND) + +### FILES SYNTAX CHECK +# +# +with open(schema_file_name, "r") as data: + try: + schema = safe_load(data) + except YAMLError as e: + print("Schema error: {} {}.".format(e.problem, e.problem_mark)) + print("\nSchema file '{}' is invalid YAML.".format(schema_file_name)) + exit(ERR_SYNTAX) + +try: + validate(instance={}, schema=schema) +except SchemaError as e: + print(e.message) + print("\nSchema file '{}' is invalid JSON-Schema.".format(schema_file_name)) + exit(ERR_INVALID) +except ValidationError: + # Just means that empty isn't valid, but the Schema itself is + pass + +configs = [] +for f in config_file_names: + config = None + with open(f, "r") as data: + try: + config = safe_load(data) + except YAMLError as e: + print("YAML error: {} {}.".format(e.problem, e.problem_mark)) + print("\nYAML file '{}' is invalid.".format(f)) + exit(ERR_SYNTAX) + if config is None: + print("YAML file '{}' is empty.".format(f)) + configs.append(config) + +### SCHEMA VALIDATION +# +# +# Here a ValidationError from jsonschema carries a lot of useful information, +# so just let it go. +for c in configs: + validate(instance=c, schema=schema) From deec0b862fbb34aec8de96b2457a102d78c16805 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 16 Jun 2020 13:04:34 +0200 Subject: [PATCH 2/6] [finished] Add schema for config - Original schema from artoo@manjaro.org, modified for current JSON-Schema use --- src/modules/finished/finished.schema.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/modules/finished/finished.schema.yaml diff --git a/src/modules/finished/finished.schema.yaml b/src/modules/finished/finished.schema.yaml new file mode 100644 index 000000000..56a844f50 --- /dev/null +++ b/src/modules/finished/finished.schema.yaml @@ -0,0 +1,11 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/finished +type: object +properties: + restartNowEnabled: { type: boolean, default: true } # TODO:3.3: remove + restartNowChecked: { type: boolean, default: false } # TODO:3.3: remove + restartNowCommand: { type: string } + restartNowMode: { type: string, enum: [ never, user-unchecked, user-checked, always ] } + notifyOnFinished: { type: boolean } +additionalProperties: false From b48c2745c149a608a9c3dc47ec6c0e18b660cb11 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 16 Jun 2020 14:38:13 +0200 Subject: [PATCH 3/6] CI: apply schema-validation to the example config files - Any config file with a schema gets a test (validate-) to test the file. --- src/modules/CMakeLists.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/modules/CMakeLists.txt b/src/modules/CMakeLists.txt index 533c704f8..0b81c4b3f 100644 --- a/src/modules/CMakeLists.txt +++ b/src/modules/CMakeLists.txt @@ -66,3 +66,21 @@ endforeach() include( CalamaresAddTranslations ) add_calamares_python_translations( ${CALAMARES_TRANSLATION_LANGUAGES} ) + +# TODO:3.3: Use FindPython3 +if ( BUILD_TESTING AND PYTHONINTERP_FOUND AND PYTHON_EXECUTABLE ) + # The tests for each config file are independent of whether the + # module is enabled or not: the config file should match its schema + # regardless. + foreach( SUBDIRECTORY ${SUBDIRECTORIES} ) + set( _schema_file "${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}/${SUBDIRECTORY}.schema.yaml" ) + set( _conf_file "${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}/${SUBDIRECTORY}.conf" ) + if ( EXISTS "${_schema_file}" AND EXISTS "${_conf_file}" ) + add_test( + NAME validate-${SUBDIRECTORY} + COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_SOURCE_DIR}/ci/configvalidator.py" "${_schema_file}" "${_conf_file}" + ) + endif() + endforeach() +endif() + From a0d56acabee57a845c004483baf944a578c18fbc Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 16 Jun 2020 15:37:19 +0200 Subject: [PATCH 4/6] CI: verbose schema-failure diagnostics --- ci/configvalidator.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/ci/configvalidator.py b/ci/configvalidator.py index e3b8ac24e..858c53224 100644 --- a/ci/configvalidator.py +++ b/ci/configvalidator.py @@ -79,8 +79,9 @@ with open(schema_file_name, "r") as data: try: validate(instance={}, schema=schema) +# While developing the schemata, get full exceptions from schema failure except SchemaError as e: - print(e.message) + print(e) print("\nSchema file '{}' is invalid JSON-Schema.".format(schema_file_name)) exit(ERR_INVALID) except ValidationError: @@ -101,10 +102,15 @@ for f in config_file_names: print("YAML file '{}' is empty.".format(f)) configs.append(config) +assert len(configs) == len(config_file_names), "Not all configurations loaded." + ### SCHEMA VALIDATION # # -# Here a ValidationError from jsonschema carries a lot of useful information, -# so just let it go. -for c in configs: - validate(instance=c, schema=schema) +for c, f in zip(configs, config_file_names): + try: + validate(instance=c, schema=schema) + except ValidationError as e: + print(e) + print("\nConfig file '{}' does not validate in schema.".format(f)) + exit(ERR_INVALID) From df183d40269e63bc8406ee7e2df7d9ce24795583 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 16 Jun 2020 16:03:28 +0200 Subject: [PATCH 5/6] [welcome] Add schema for welcome config - Note that this is missing *languageIcon* so if that gets uncommented, it will fail validation. - While here decide that should be right up front in object (mappings) declaration. --- src/modules/finished/finished.schema.yaml | 2 +- src/modules/welcome/welcome.schema.yaml | 36 +++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 src/modules/welcome/welcome.schema.yaml diff --git a/src/modules/finished/finished.schema.yaml b/src/modules/finished/finished.schema.yaml index 56a844f50..53189c7fa 100644 --- a/src/modules/finished/finished.schema.yaml +++ b/src/modules/finished/finished.schema.yaml @@ -1,6 +1,7 @@ --- $schema: https://json-schema.org/schema# $id: https://calamares.io/schemas/finished +additionalProperties: false type: object properties: restartNowEnabled: { type: boolean, default: true } # TODO:3.3: remove @@ -8,4 +9,3 @@ properties: restartNowCommand: { type: string } restartNowMode: { type: string, enum: [ never, user-unchecked, user-checked, always ] } notifyOnFinished: { type: boolean } -additionalProperties: false diff --git a/src/modules/welcome/welcome.schema.yaml b/src/modules/welcome/welcome.schema.yaml new file mode 100644 index 000000000..56a79be06 --- /dev/null +++ b/src/modules/welcome/welcome.schema.yaml @@ -0,0 +1,36 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/welcome +additionalProperties: false +type: object +properties: + # TODO:3.3: drop the string alternatives and put the URL part in Branding + showSupportUrl: { anyOf: [ { type: boolean, default: true }, { type: string } ] } + showKnownIssuesUrl: { anyOf: [ { type: boolean, default: true }, { type: string } ] } + showReleaseNotesUrl: { anyOf: [ { type: boolean, default: true }, { type: string } ] } + showDonateUrl: { anyOf: [ { type: boolean, default: true }, { type: string } ] } + + requirements: + additionalProperties: false + type: object + properties: + requiredStorage: { type: number } + requiredRam: { type: number } + internetCheckUrl: { type: string } + check: + type: array + items: { type: string, enum: [storage, ram, power, internet, root, screen], unique: true } + required: # Key-name in the config-file + type: array + items: { type: string, enum: [storage, ram, power, internet, root, screen], unique: true } + required: [ requiredStorage, requiredRam, check ] # Schema keyword + + # TODO: refactor, this is reused in locale + geoip: + additionalProperties: false + type: object + properties: + style: { type: string, enum: [ none, fixed, xml, json ] } + url: { type: string } + selector: { type: string } + required: [ style, url, selector ] From 4a07bd4ae3ad297b48ee520f099434fa456e88bb Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 16 Jun 2020 16:06:56 +0200 Subject: [PATCH 6/6] CI: import all the rest of the YAML schema - These have **not** been fixed for validation, so the schema's themselves will fail to load. This is a consequence of variations in JSON-Schema representations through various drafts. Fixing the schemata is fairly straightforward. This gives us 19 new tests, all of which fail. --- src/modules/bootloader/bootloader.schema.yaml | 18 ++++++++++ .../displaymanager/displaymanager.schema.yaml | 16 +++++++++ src/modules/fstab/fstab.schema.yaml | 19 +++++++++++ src/modules/grubcfg/grubcfg.schema.yaml | 15 +++++++++ src/modules/initcpio/initcpio.schema.yaml | 7 ++++ src/modules/keyboard/keyboard.schema.yaml | 8 +++++ src/modules/license/license.schema.yaml | 17 ++++++++++ src/modules/locale/locale.schema.yaml | 10 ++++++ .../luksopenswaphookcfg.schema.yaml | 7 ++++ src/modules/machineid/machineid.schema.yaml | 9 +++++ src/modules/mount/mount.schema.yaml | 24 ++++++++++++++ src/modules/netinstall/netinstall.schema.yaml | 7 ++++ src/modules/packages/packages.schema.yaml | 33 +++++++++++++++++++ src/modules/partition/partition.schema.yaml | 11 +++++++ .../plymouthcfg/plymouthcfg.schema.yaml | 7 ++++ src/modules/removeuser/removeuser.schema.yaml | 7 ++++ src/modules/umount/umount.schema.yaml | 8 +++++ src/modules/unpackfs/unpackfs.schema.yaml | 14 ++++++++ src/modules/users/users.schema.yaml | 18 ++++++++++ 19 files changed, 255 insertions(+) create mode 100644 src/modules/bootloader/bootloader.schema.yaml create mode 100644 src/modules/displaymanager/displaymanager.schema.yaml create mode 100644 src/modules/fstab/fstab.schema.yaml create mode 100644 src/modules/grubcfg/grubcfg.schema.yaml create mode 100644 src/modules/initcpio/initcpio.schema.yaml create mode 100644 src/modules/keyboard/keyboard.schema.yaml create mode 100644 src/modules/license/license.schema.yaml create mode 100644 src/modules/locale/locale.schema.yaml create mode 100644 src/modules/luksopenswaphookcfg/luksopenswaphookcfg.schema.yaml create mode 100644 src/modules/machineid/machineid.schema.yaml create mode 100644 src/modules/mount/mount.schema.yaml create mode 100644 src/modules/netinstall/netinstall.schema.yaml create mode 100644 src/modules/packages/packages.schema.yaml create mode 100644 src/modules/partition/partition.schema.yaml create mode 100644 src/modules/plymouthcfg/plymouthcfg.schema.yaml create mode 100644 src/modules/removeuser/removeuser.schema.yaml create mode 100644 src/modules/umount/umount.schema.yaml create mode 100644 src/modules/unpackfs/unpackfs.schema.yaml create mode 100644 src/modules/users/users.schema.yaml diff --git a/src/modules/bootloader/bootloader.schema.yaml b/src/modules/bootloader/bootloader.schema.yaml new file mode 100644 index 000000000..45e8d4996 --- /dev/null +++ b/src/modules/bootloader/bootloader.schema.yaml @@ -0,0 +1,18 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/bootloader +additionalProperties: false +type: object +properties: + efiBootLoader: { type: string, required: true } + kernel: { type: string, required: true } + img: { type: string, required: true } + fallback: { type: str } + timeout: { type: str } + bootloaderEntryName: { type: str } + kernelLine: { type: str } + fallbackKernelLine: { type: str } + grubInstall: { type: string, required: true } + grubMkconfig: { type: string, required: true } + grubCfg: { type: string, required: true } + efiBootloaderId: { type: str } diff --git a/src/modules/displaymanager/displaymanager.schema.yaml b/src/modules/displaymanager/displaymanager.schema.yaml new file mode 100644 index 000000000..a16af732f --- /dev/null +++ b/src/modules/displaymanager/displaymanager.schema.yaml @@ -0,0 +1,16 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/displaymanager +additionalProperties: false +type: object +properties: + "displaymanagers": + type: seq + sequence: + - { type: string, required: true, enum: [slim, sddm, lightdm, gdm, mdm, lxdm, kdm] } + "defaultDesktopEnvironment": + type: map + mapping: + "executable": { type: str } + "desktopFile": { type: str } + "basicSetup": { type: boolean, default: false } diff --git a/src/modules/fstab/fstab.schema.yaml b/src/modules/fstab/fstab.schema.yaml new file mode 100644 index 000000000..1c2bf459c --- /dev/null +++ b/src/modules/fstab/fstab.schema.yaml @@ -0,0 +1,19 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/fstab +additionalProperties: false +type: object +properties: + "mountOptions": + type: map + mapping: + "default": { type: string, required: true } + "btrfs": { type: string, required: true } + "ssdExtraMountOptions": + type: map + mapping: + "ext4": { type: string, required: true } + "jfs": { type: string, required: true } + "xfs": { type: string, required: true } + "swap": { type: string, required: true } + "btrfs": { type: string, required: true } diff --git a/src/modules/grubcfg/grubcfg.schema.yaml b/src/modules/grubcfg/grubcfg.schema.yaml new file mode 100644 index 000000000..10aa34c2b --- /dev/null +++ b/src/modules/grubcfg/grubcfg.schema.yaml @@ -0,0 +1,15 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/grubcfg +additionalProperties: false +type: object +properties: + "overwrite": { type: boolean, default: false } + "defaults": + type: map + mapping: + "GRUB_TIMEOUT": { type: int, required: true } + "GRUB_DEFAULT": { type: string, required: true } + "GRUB_DISABLE_SUBMENU": { type: boolean, default: true } + "GRUB_TERMINAL_OUTPUT": { type: string, required: true } + "GRUB_DISABLE_RECOVERY": { type: boolean, default: true } diff --git a/src/modules/initcpio/initcpio.schema.yaml b/src/modules/initcpio/initcpio.schema.yaml new file mode 100644 index 000000000..db81ba68e --- /dev/null +++ b/src/modules/initcpio/initcpio.schema.yaml @@ -0,0 +1,7 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/initcpio +additionalProperties: false +type: object +properties: + kernel: { type: string, required: true } diff --git a/src/modules/keyboard/keyboard.schema.yaml b/src/modules/keyboard/keyboard.schema.yaml new file mode 100644 index 000000000..33175b84d --- /dev/null +++ b/src/modules/keyboard/keyboard.schema.yaml @@ -0,0 +1,8 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/finished +additionalProperties: keyboard +type: object +properties: + xOrgConfFileName: { type: string, required: true } + convertedKeymapPath: { type: string, required: true } diff --git a/src/modules/license/license.schema.yaml b/src/modules/license/license.schema.yaml new file mode 100644 index 000000000..62bd07035 --- /dev/null +++ b/src/modules/license/license.schema.yaml @@ -0,0 +1,17 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/license +additionalProperties: false +type: object +properties: + "entries": + type: seq + sequence: + - type: map + mapping: + "id": { type: str } + "name": { type: str } + "vendor": { type: str } + "type": { type: str } + "url": { type: str } + "required": { type: boolean, default: false } diff --git a/src/modules/locale/locale.schema.yaml b/src/modules/locale/locale.schema.yaml new file mode 100644 index 000000000..41c3ad487 --- /dev/null +++ b/src/modules/locale/locale.schema.yaml @@ -0,0 +1,10 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/locale +additionalProperties: false +type: object +properties: + "region": { type: str } + "zone": { type: str } + "localeGenPath": { type: string, required: true } + "geoipUrl": { type: str } diff --git a/src/modules/luksopenswaphookcfg/luksopenswaphookcfg.schema.yaml b/src/modules/luksopenswaphookcfg/luksopenswaphookcfg.schema.yaml new file mode 100644 index 000000000..660e06d0b --- /dev/null +++ b/src/modules/luksopenswaphookcfg/luksopenswaphookcfg.schema.yaml @@ -0,0 +1,7 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/luksopenswaphookcfg +additionalProperties: false +type: object +properties: + "configFilePath": { type: string, required: true } diff --git a/src/modules/machineid/machineid.schema.yaml b/src/modules/machineid/machineid.schema.yaml new file mode 100644 index 000000000..588a7fa4e --- /dev/null +++ b/src/modules/machineid/machineid.schema.yaml @@ -0,0 +1,9 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/machineid +additionalProperties: false +type: object +properties: + "systemd": { type: boolean, default: true } + "dbus": { type: boolean, default: true } + "symlink": { type: boolean, default: true } diff --git a/src/modules/mount/mount.schema.yaml b/src/modules/mount/mount.schema.yaml new file mode 100644 index 000000000..8a81d9462 --- /dev/null +++ b/src/modules/mount/mount.schema.yaml @@ -0,0 +1,24 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/mount +additionalProperties: false +type: object +properties: + "extraMounts": + type: seq + sequence: + - type: map + mapping: + "device": { type: string, required: true } + "fs": { type: str } + "mountPoint": { type: string, required: true } + "options": { type: str } + "extraMountsEfi": + type: seq + sequence: + - type: map + mapping: + "device": { type: string, required: true } + "fs": { type: str } + "mountPoint": { type: string, required: true } + "options": { type: str } diff --git a/src/modules/netinstall/netinstall.schema.yaml b/src/modules/netinstall/netinstall.schema.yaml new file mode 100644 index 000000000..8420ea501 --- /dev/null +++ b/src/modules/netinstall/netinstall.schema.yaml @@ -0,0 +1,7 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/netinstall +additionalProperties: false +type: object +properties: + groupsUrl: { type: string, required: true } diff --git a/src/modules/packages/packages.schema.yaml b/src/modules/packages/packages.schema.yaml new file mode 100644 index 000000000..8b8a9eb1d --- /dev/null +++ b/src/modules/packages/packages.schema.yaml @@ -0,0 +1,33 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/packages +additionalProperties: false +type: object +properties: + "backend": { type: string, required: true, enum: [packagekit, zypp, yum, dnf, urpmi, apt, pacman, portage, entropy] } + "update_db": { type: boolean, default: true } + "operations": + type: seq + sequence: + - type: map + mapping: + "install": + type: seq + sequence: + - { type: text } + "remove": + type: seq + sequence: + - { type: text } + "localInstall": + type: seq + sequence: + - { type: text } + "try_install": + type: seq + sequence: + - { type: text } + "try_remove": + type: seq + sequence: + - { type: text } diff --git a/src/modules/partition/partition.schema.yaml b/src/modules/partition/partition.schema.yaml new file mode 100644 index 000000000..198123dd5 --- /dev/null +++ b/src/modules/partition/partition.schema.yaml @@ -0,0 +1,11 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/partition +additionalProperties: false +type: object +properties: + efiSystemPartition: { type: string, required: true } + ensureSuspendToDisk: { type: boolean, default: true } + drawNestedPartitions: { type: boolean, default: false } + alwaysShowPartitionLabels: { type: boolean, default: true } + defaultFileSystemType: { type: string, required: true } diff --git a/src/modules/plymouthcfg/plymouthcfg.schema.yaml b/src/modules/plymouthcfg/plymouthcfg.schema.yaml new file mode 100644 index 000000000..b15db1527 --- /dev/null +++ b/src/modules/plymouthcfg/plymouthcfg.schema.yaml @@ -0,0 +1,7 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/plymouthcfg +additionalProperties: false +type: object +properties: + plymouth_theme: { type: str } diff --git a/src/modules/removeuser/removeuser.schema.yaml b/src/modules/removeuser/removeuser.schema.yaml new file mode 100644 index 000000000..7ed6cfbbe --- /dev/null +++ b/src/modules/removeuser/removeuser.schema.yaml @@ -0,0 +1,7 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/removeuser +additionalProperties: false +type: object +properties: + "username": { type: string, required: true } diff --git a/src/modules/umount/umount.schema.yaml b/src/modules/umount/umount.schema.yaml new file mode 100644 index 000000000..b76a14ac6 --- /dev/null +++ b/src/modules/umount/umount.schema.yaml @@ -0,0 +1,8 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/umount +additionalProperties: false +type: object +properties: + "srcLog": { type: str } + "destLog": { type: str } diff --git a/src/modules/unpackfs/unpackfs.schema.yaml b/src/modules/unpackfs/unpackfs.schema.yaml new file mode 100644 index 000000000..0d6f0955a --- /dev/null +++ b/src/modules/unpackfs/unpackfs.schema.yaml @@ -0,0 +1,14 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/unpackfs +additionalProperties: false +type: object +properties: + "unpack": + type: seq + sequence: + - type: map + mapping: + "source": { type: string, required: true } + "sourcefs": { type: str } + "destination": { type: str } diff --git a/src/modules/users/users.schema.yaml b/src/modules/users/users.schema.yaml new file mode 100644 index 000000000..b667df7f6 --- /dev/null +++ b/src/modules/users/users.schema.yaml @@ -0,0 +1,18 @@ +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/users +additionalProperties: false +type: object +properties: + "defaultGroups": + required: true + type: seq + sequence: + - { type: str } + "autologinGroup": { type: string, required: true } + "doAutologin": { type: boolean, default: true } + "sudoersGroup": { type: string, required: true } + "setRootPassword": { type: boolean, default: true } + "availableShells": { type: str } + "avatarFilePath": { type: str } + "doReusePassword": { type: boolean, default: true }