arch-image-builder/builder/disk/filesystem/btrfs.py
BigfootACA e6c6ab6bf7 Initial commit
Signed-off-by: BigfootACA <bigfoot@classfun.cn>
2024-05-17 23:04:34 +08:00

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")