debian-forge/mounts/org.osbuild.btrfs
Christian Kellner 08c1fbad4b mounts: separate file system mount service
Separate the current `MountService` into the more generic base mount
service and a specialized one for file systems.
2021-10-30 15:32:44 +01:00

48 lines
779 B
Python
Executable file

#!/usr/bin/python3
"""
btrfs mount service
Mount a btrfs filesystem at the given location.
Host commands used: mount
"""
import sys
from typing import Dict
from osbuild import mounts
SCHEMA_2 = """
"additionalProperties": false,
"required": ["name", "type", "source", "target"],
"properties": {
"name": { "type": "string" },
"type": { "type": "string" },
"source": {
"type": "string"
},
"target": {
"type": "string"
},
"options": {
"type": "object",
"additionalProperties": true
}
}
"""
class BtrfsMount(mounts.FileSystemMountService):
def translate_options(self, _options: Dict):
return ["-t", "btrfs"]
def main():
service = BtrfsMount.from_args(sys.argv[1:])
service.main()
if __name__ == '__main__':
main()