mirror of
https://github.com/BigfootACA/arch-image-builder.git
synced 2024-11-15 07:03:26 +08:00
12 lines
416 B
Python
12 lines
416 B
Python
from builder.disk.filesystem.creator import FileSystemCreator
|
|
|
|
|
|
class BtrfsCreator(FileSystemCreator):
|
|
def create(self):
|
|
cmds: list[str] = ["mkfs.btrfs"]
|
|
if "fsname" in self.config: cmds.extend(["-L", self.config["fsname"]])
|
|
if "fsuuid" in self.config: cmds.extend(["-U", self.config["fsuuid"]])
|
|
cmds.append(self.device)
|
|
ret = self.ctx.run_external(cmds)
|
|
if ret != 0: raise OSError("mkfs.btrfs failed")
|