From 2061024a031edc5dabcbf24317ec5227a6a7a9a6 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Wed, 12 Aug 2020 10:04:05 +0200 Subject: [PATCH 1/5] [unpackfs] Fix schema -- new fields *exclude* and *excludeFile* --- src/modules/unpackfs/unpackfs.schema.yaml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/modules/unpackfs/unpackfs.schema.yaml b/src/modules/unpackfs/unpackfs.schema.yaml index 0d6f0955a..b72a5a69b 100644 --- a/src/modules/unpackfs/unpackfs.schema.yaml +++ b/src/modules/unpackfs/unpackfs.schema.yaml @@ -4,11 +4,15 @@ $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 } + unpack: + type: array + items: + type: object + additionalProperties: false + properties: + source: { type: string } + sourcefs: { type: string } + destination: { type: string } + excludeFile: { type: string } + exclude: { type: array, items: { type: string } } + required: [ source , sourcefs, destination ] From efab699479eea1efc0c0faaef1d242cdca72b7bd Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Wed, 12 Aug 2020 10:05:46 +0200 Subject: [PATCH 2/5] [umount] Fix schema -- prefer *preservefiles* for keeping the log --- src/modules/umount/umount.conf | 28 ++++----------------------- src/modules/umount/umount.schema.yaml | 4 ++-- 2 files changed, 6 insertions(+), 26 deletions(-) diff --git a/src/modules/umount/umount.conf b/src/modules/umount/umount.conf index 22a2e7441..3d4eb7d95 100644 --- a/src/modules/umount/umount.conf +++ b/src/modules/umount/umount.conf @@ -2,35 +2,15 @@ # # This module represents the last part of the installation, the unmounting # of partitions used for the install. It is also the last place where it -# is possible to copy files to the target system, thus the best place to -# copy an installation log. +# is possible to copy files to the target system. +# +# The "copy log files" functionality is deprecated; use the *preservefiles* +# module instead, which is more flexible. # # This module has two configuration keys: # srcLog location in the live system where the log is # destLog location in the target system to copy the log # -# You can either use the default source path (which is -# `/root/.cache/calamares/session.log` ) to copy the regular log, -# or if you want to use the full output of `sudo calamares -d` you will need -# to redirect standard output, for instance in a launcher script or -# in the desktop file. -# -# Example launcher script: -# -# ``` -# #!/bin/sh -# sudo /usr/bin/calamares -d > installation.log -# ``` -# -# Example desktop line: -# -# ``` -# Exec=sudo /usr/bin/calamares -d > installation.log -# ``` -# -# If no source and destination are set, no copy is attempted. If the -# copy fails for some reason, a warning is printed but the installation -# does not fail. --- # example when using the normal Calamares log: diff --git a/src/modules/umount/umount.schema.yaml b/src/modules/umount/umount.schema.yaml index b76a14ac6..585946fbe 100644 --- a/src/modules/umount/umount.schema.yaml +++ b/src/modules/umount/umount.schema.yaml @@ -4,5 +4,5 @@ $id: https://calamares.io/schemas/umount additionalProperties: false type: object properties: - "srcLog": { type: str } - "destLog": { type: str } + srcLog: { type: string } + destLog: { type: string } From fcbd6e38c548f45f20a0c13033f7226182cb6468 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Wed, 12 Aug 2020 10:24:31 +0200 Subject: [PATCH 3/5] [keyboard] Fix schema -- forgotten field *writeEtcDefaultKeyboard* --- src/modules/keyboard/keyboard.schema.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/modules/keyboard/keyboard.schema.yaml b/src/modules/keyboard/keyboard.schema.yaml index 33175b84d..05d98bfde 100644 --- a/src/modules/keyboard/keyboard.schema.yaml +++ b/src/modules/keyboard/keyboard.schema.yaml @@ -1,8 +1,10 @@ --- $schema: https://json-schema.org/schema# $id: https://calamares.io/schemas/finished -additionalProperties: keyboard +additionalProperties: false type: object properties: - xOrgConfFileName: { type: string, required: true } - convertedKeymapPath: { type: string, required: true } + xOrgConfFileName: { type: string } + convertedKeymapPath: { type: string } + writeEtcDefaultKeyboard: { type: boolean, default: true } +required: [ xOrgConfFileName, convertedKeymapPath ] From 14afce538bade7a302087d5b1d90281cb1a8eef5 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Wed, 12 Aug 2020 10:26:40 +0200 Subject: [PATCH 4/5] [netinstall] Fix schema -- the groups file still needs attention --- src/modules/netinstall/netinstall.schema.yaml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/modules/netinstall/netinstall.schema.yaml b/src/modules/netinstall/netinstall.schema.yaml index 8420ea501..739af635e 100644 --- a/src/modules/netinstall/netinstall.schema.yaml +++ b/src/modules/netinstall/netinstall.schema.yaml @@ -4,4 +4,13 @@ $id: https://calamares.io/schemas/netinstall additionalProperties: false type: object properties: - groupsUrl: { type: string, required: true } + groupsUrl: { type: string } + required: { type: boolean, default: false } + label: # Translatable labels + type: object + additionalProperties: true + properties: + sidebar: { type: string } + title: { type: string } + groups: { type: array } # TODO: the schema for the whole groups file +required: [ groupsUrl ] From 050d74b4beb0855466fa06335e1ec8f6f0bc9392 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Wed, 12 Aug 2020 10:27:17 +0200 Subject: [PATCH 5/5] Fix YAML schemas for all the remaining config files --- src/modules/fstab/fstab.schema.yaml | 32 +++++++++------ src/modules/initcpio/initcpio.schema.yaml | 4 +- src/modules/license/license.schema.yaml | 24 ++++++----- .../luksopenswaphookcfg.schema.yaml | 3 +- src/modules/mount/mount.schema.yaml | 41 +++++++++++-------- .../plymouthcfg/plymouthcfg.schema.yaml | 2 +- src/modules/removeuser/removeuser.schema.yaml | 3 +- 7 files changed, 63 insertions(+), 46 deletions(-) diff --git a/src/modules/fstab/fstab.schema.yaml b/src/modules/fstab/fstab.schema.yaml index 1c2bf459c..5b54d767f 100644 --- a/src/modules/fstab/fstab.schema.yaml +++ b/src/modules/fstab/fstab.schema.yaml @@ -4,16 +4,22 @@ $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 } + mountOptions: + type: object + additionalProperties: true # we don't know which FS exist + properties: + default: { type: string } + btrfs: { type: string } + required: [ default ] + ssdExtraMountOptions: + type: object + additionalProperties: true # we don't know which FS exist + properties: + ext4: { type: string } + jfs: { type: string } + xfs: { type: string } + swap: { type: string } + btrfs: { type: string } + efiMountOptions: { type: string } + crypttabOptions: { type: string } +required: [ mountOptions ] diff --git a/src/modules/initcpio/initcpio.schema.yaml b/src/modules/initcpio/initcpio.schema.yaml index db81ba68e..d3fda6be0 100644 --- a/src/modules/initcpio/initcpio.schema.yaml +++ b/src/modules/initcpio/initcpio.schema.yaml @@ -4,4 +4,6 @@ $id: https://calamares.io/schemas/initcpio additionalProperties: false type: object properties: - kernel: { type: string, required: true } + kernel: { type: string } + be_unsafe: { type: boolean, default: false } +required: [ kernel ] diff --git a/src/modules/license/license.schema.yaml b/src/modules/license/license.schema.yaml index 62bd07035..090b2428e 100644 --- a/src/modules/license/license.schema.yaml +++ b/src/modules/license/license.schema.yaml @@ -4,14 +4,16 @@ $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 } + entries: + type: array + items: + type: object + additionalProperties: false + properties: + id: { type: string } + name: { type: string } + vendor: { type: string } + type: { type: string } + url: { type: string } + required: { type: boolean, default: false } + expand: { type: boolean, default: false } diff --git a/src/modules/luksopenswaphookcfg/luksopenswaphookcfg.schema.yaml b/src/modules/luksopenswaphookcfg/luksopenswaphookcfg.schema.yaml index 660e06d0b..426822e27 100644 --- a/src/modules/luksopenswaphookcfg/luksopenswaphookcfg.schema.yaml +++ b/src/modules/luksopenswaphookcfg/luksopenswaphookcfg.schema.yaml @@ -4,4 +4,5 @@ $id: https://calamares.io/schemas/luksopenswaphookcfg additionalProperties: false type: object properties: - "configFilePath": { type: string, required: true } + configFilePath: { type: string } +required: [ configFilePath ] diff --git a/src/modules/mount/mount.schema.yaml b/src/modules/mount/mount.schema.yaml index 8a81d9462..55ee88644 100644 --- a/src/modules/mount/mount.schema.yaml +++ b/src/modules/mount/mount.schema.yaml @@ -4,21 +4,26 @@ $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 } + # TODO: share the schema definition, since these are identical + extraMounts: + type: array + items: + type: object + additionalProperties: false + properties: + device: { type: string } + fs: { type: string } + mountPoint: { type: string } + options: { type: string } + required: [ device, mountPoint ] + extraMountsEfi: + type: array + items: + type: object + additionalProperties: false + properties: + device: { type: string } + fs: { type: string } + mountPoint: { type: string } + options: { type: string } + required: [ device, mountPoint ] diff --git a/src/modules/plymouthcfg/plymouthcfg.schema.yaml b/src/modules/plymouthcfg/plymouthcfg.schema.yaml index b15db1527..5100e2cd3 100644 --- a/src/modules/plymouthcfg/plymouthcfg.schema.yaml +++ b/src/modules/plymouthcfg/plymouthcfg.schema.yaml @@ -4,4 +4,4 @@ $id: https://calamares.io/schemas/plymouthcfg additionalProperties: false type: object properties: - plymouth_theme: { type: str } + plymouth_theme: { type: string } diff --git a/src/modules/removeuser/removeuser.schema.yaml b/src/modules/removeuser/removeuser.schema.yaml index 7ed6cfbbe..d1fed47fe 100644 --- a/src/modules/removeuser/removeuser.schema.yaml +++ b/src/modules/removeuser/removeuser.schema.yaml @@ -4,4 +4,5 @@ $id: https://calamares.io/schemas/removeuser additionalProperties: false type: object properties: - "username": { type: string, required: true } + username: { type: string } +required: [ username ]