def prepare_empty_partition_btrfs(self, rootfs, oe_builddir):
"""
Prepare an empty btrfs partition.
"""
size = self.disk_size
with open(rootfs, 'w') as sparse:
os.ftruncate(sparse.fileno(), size * 1024)
label_str = ""
if self.label:
label_str = "-L %s" % self.label
mkfs_cmd = "sudo mkfs.%s -b %d %s %s" % \
(self.fstype, self.size * 1024, label_str, rootfs)
exec_cmd(mkfs_cmd)
评论列表
文章目录