mounts: use the options object for mountopts

This modification will allow a user to ask to mount the system as read
only for instance. Which would be super useful for image-info who is
progressively using more of OSbuild internals to mount partitions.
This commit is contained in:
Thomas Lavocat 2022-11-24 09:52:47 +01:00 committed by Thomas Lavocat
parent 2e4d610633
commit 5112f72cbf
6 changed files with 161 additions and 12 deletions

View file

@ -26,7 +26,13 @@ SCHEMA_2 = """
},
"options": {
"type": "object",
"additionalProperties": true
"additionalProperties": false,
"properties": {
"readonly": {
"description": "mount the source as a readonly device",
"type": "boolean"
}
}
}
}
"""
@ -34,8 +40,8 @@ SCHEMA_2 = """
class XfsMount(mounts.FileSystemMountService):
def translate_options(self, _options: Dict):
return ["-t", "xfs"]
def translate_options(self, options: Dict):
return ["-t", "xfs"] + super().translate_options(options)
def main():