stages/sfdisk: remove unneeded helper functions
This was left over from the old qemu assembler and is not really needed anymore. Also removes some defaults that are not valid according to the new schema of the stage.
This commit is contained in:
parent
21fe0375cd
commit
386ff713cc
1 changed files with 8 additions and 13 deletions
|
|
@ -173,22 +173,17 @@ def partition_from_json(js) -> Partition:
|
|||
return p
|
||||
|
||||
|
||||
def partition_table_from_options(options) -> PartitionTable:
|
||||
ptuuid = options["uuid"]
|
||||
pttype = options.get("label", "dos")
|
||||
partitions = options.get("partitions")
|
||||
|
||||
if pttype == "mbr":
|
||||
pttype = "dos"
|
||||
|
||||
parts = [partition_from_json(p) for p in partitions]
|
||||
return PartitionTable(pttype, ptuuid, parts)
|
||||
|
||||
|
||||
def main(tree, options):
|
||||
filename = options["filename"]
|
||||
ptuuid = options["uuid"]
|
||||
pttype = options["label"]
|
||||
partitions = options.get("partitions")
|
||||
|
||||
dest = os.path.join(tree, filename.lstrip("/"))
|
||||
pt = partition_table_from_options(options)
|
||||
|
||||
parts = [partition_from_json(p) for p in partitions]
|
||||
pt = PartitionTable(pttype, ptuuid, parts)
|
||||
|
||||
pt.write_to(dest)
|
||||
|
||||
subprocess.run(["sfdisk", "--json", dest],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue