parse: deviceinfo: make Deviceinfo a class (MR 2252)

Introduce a Deviceinfo class and use it rather than the dictionary. This
gives us sweet sweet autocomplete, and lays the foundation for having a
proper deviceinfo validator in the future.

Additionally, continue refactoring out args...

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
Caleb Connolly 2024-06-06 15:05:59 +02:00 committed by Oliver Smith
parent b51d31acab
commit 97bd8b96ec
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
27 changed files with 372 additions and 288 deletions

View file

@ -20,7 +20,7 @@ def create_zip(args: PmbArgs, chroot: Chroot, device: str):
rootfs = "/mnt/rootfs_" + device
flavor = pmb.helpers.frontend._parse_flavor(device)
deviceinfo = pmb.parse.deviceinfo()
method = deviceinfo["flash_method"]
method = deviceinfo.flash_method
fvars = pmb.flasher.variables(args, flavor, method)
# Install recovery installer package in buildroot
@ -30,7 +30,7 @@ def create_zip(args: PmbArgs, chroot: Chroot, device: str):
logging.info(f"({chroot}) create recovery zip")
for key in fvars:
pmb.flasher.check_partition_blacklist(args, deviceinfo, key, fvars[key])
pmb.flasher.check_partition_blacklist(deviceinfo, key, fvars[key])
# Create config file for the recovery installer
options = {