Comment 8 for bug 1630709

Revision history for this message
Ɓukasz Zemczak (sil2100) wrote :

Looking through the available solutions, I tried out pyparted (python3-parted) and it seems to be sufficient for our usage regarding the GPT. I'll do some tests to see if the generated partition table is the same and compatible as when generated through sgdisk (although I can't think of a reason why not), but creating and modifying the GPT through pyparted is really straightforward. And we won't have to re-invent the wheel here so that's another win.

As for the MBR, well, here sadly I could not really find any existing libraries/tools in Python for modifying the partition tables. There's a lot of different solutions for reading those, yes, so we can use those as an entry point. Still, this means we'll have to write this part of the tooling ourselves from scratch. For our uses this shouldn't be hard since from what I see the format of the resulting MBRs that we generate through sfdisk is really simple.