1
0
Fork 1
mirror of https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git synced 2025-07-13 11:29:46 +03:00

Fix "pmbootstrap build_init" (MR 2386)

Do not fail with:
  ERROR: 'Namespace' object has no attribute 'image'

Adjust the similar check for args.rootfs to be in the same style while
at it.
This commit is contained in:
Oliver Smith 2024-07-28 21:09:43 +02:00
parent 86d38d451b
commit ae4094c1db
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB

View file

@ -65,10 +65,10 @@ def _parse_flavor(device: str, autoinstall=True):
def _parse_suffix(args: PmbArgs) -> Chroot:
deviceinfo = pmb.parse.deviceinfo()
if args.image:
if getattr(args, "image", None):
rootfs = Chroot.native() / f"home/pmos/rootfs/{deviceinfo.codename}.img"
return Chroot(ChrootType.IMAGE, str(rootfs))
if "rootfs" in args and args.rootfs:
if getattr(args, "rootfs", None):
return Chroot(ChrootType.ROOTFS, get_context().config.device)
elif args.buildroot:
if args.buildroot == "device":