stages/grub2: extract uuid js schema definition

The uuid schema is duplicated in a few places. Extract it and use
references to it instead.
This commit is contained in:
Christian Kellner 2021-12-17 14:06:59 +01:00 committed by Tom Gundersen
parent 94e9f62f63
commit 7a2b8ac107

View file

@ -89,6 +89,16 @@ SCHEMA = """
"required": ["rootfs"]
}],
"definitions": {
"uuid": {
"description": "Identify the file system by UUID",
"type": "string",
"oneOf": [
{ "pattern": "^[0-9A-Za-z]{8}(-[0-9A-Za-z]{4}){3}-[0-9A-Za-z]{12}$",
"examples": ["9c6ae55b-cf88-45b8-84e8-64990759f39d"] },
{ "pattern": "^[0-9A-Za-z]{4}-[0-9A-Za-z]{4}$",
"examples": ["6699-AFB5"] }
]
},
"filesystem": {
"description": "Description of how to locate a file system",
"type": "object",
@ -102,16 +112,7 @@ SCHEMA = """
"description": "Identify the file system by label",
"type": "string"
},
"uuid": {
"description": "Identify the file system by UUID",
"type": "string",
"oneOf": [
{ "pattern": "^[0-9A-Za-z]{8}(-[0-9A-Za-z]{4}){3}-[0-9A-Za-z]{12}$",
"examples": ["9c6ae55b-cf88-45b8-84e8-64990759f39d"] },
{ "pattern": "^[0-9A-Za-z]{4}-[0-9A-Za-z]{4}$",
"examples": ["6699-AFB5"] }
]
}
"uuid": { "$ref": "#/definitions/uuid" }
}
},
"terminal": {
@ -125,26 +126,8 @@ SCHEMA = """
"properties": {
"rootfs": { "$ref": "#/definitions/filesystem" },
"bootfs": { "$ref": "#/definitions/filesystem" },
"root_fs_uuid": {
"description": "UUID of the root filesystem image",
"type": "string",
"oneOf": [
{ "pattern": "^[0-9A-Za-z]{8}(-[0-9A-Za-z]{4}){3}-[0-9A-Za-z]{12}$",
"examples": ["9c6ae55b-cf88-45b8-84e8-64990759f39d"] },
{ "pattern": "^[0-9A-Za-z]{4}-[0-9A-Za-z]{4}$",
"examples": ["6699-AFB5"] }
]
},
"boot_fs_uuid": {
"description": "UUID of the boot filesystem, if /boot is separated",
"type": "string",
"oneOf": [
{ "pattern": "^[0-9A-Za-z]{8}(-[0-9A-Za-z]{4}){3}-[0-9A-Za-z]{12}$",
"examples": ["9c6ae55b-cf88-45b8-84e8-64990759f39d"] },
{ "pattern": "^[0-9A-Za-z]{4}-[0-9A-Za-z]{4}$",
"examples": ["6699-AFB5"] }
]
},
"root_fs_uuid": { "$ref": "#/definitions/uuid" },
"boot_fs_uuid": { "$ref": "#/definitions/uuid" },
"kernel_opts": {
"description": "Additional kernel boot options",
"type": "string",