builder: disk: filesystem: build.py: allow grow filesystem only when GPT partition table unavailable

Signed-off-by: BigfootACA <bigfoot@classfun.cn>
This commit is contained in:
BigfootACA 2024-05-24 00:42:37 +08:00
parent b5f69b7b08
commit 97bcdf7379

View File

@ -53,7 +53,10 @@ class FileSystemBuilder(ImageContentBuilder):
def proc_grow(self, cfg: dict, mnt: MountPoint):
root = self.builder.ctx.get_rootfs()
if "ptype" not in cfg: raise ArchBuilderConfigError("no ptype set for grow")
if "ptype" not in cfg:
log.warning("no partition type set, grow filesystem only")
mnt.option.append("x-systemd.growfs")
return
ptype = DiskTypesGPT.lookup_one_uuid(cfg["ptype"])
if ptype is None: raise ArchBuilderConfigError(f"unknown type {cfg['ptype']}")
mnt.option.append("x-systemd.growfs")