mirror of
https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git
synced 2025-07-24 13:05:09 +03:00
flasher: variables: rename vars to fvars (MR 2252)
vars is a reserved keyword in python, use fvars instead. Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
parent
852ace63c4
commit
b51d31acab
3 changed files with 14 additions and 14 deletions
|
@ -38,10 +38,10 @@ def run(device: str, deviceinfo: Dict[str, str], action, flavor=None):
|
|||
"Deviceinfo_flash_methods>")
|
||||
|
||||
# Variable setup
|
||||
vars = pmb.flasher.variables(args, flavor, method)
|
||||
fvars = pmb.flasher.variables(args, flavor, method)
|
||||
|
||||
# vbmeta flasher requires vbmeta partition to be explicitly specified
|
||||
if action == "flash_vbmeta" and not vars["$PARTITION_VBMETA"]:
|
||||
if action == "flash_vbmeta" and not fvars["$PARTITION_VBMETA"]:
|
||||
raise RuntimeError("Your device does not have 'vbmeta' partition"
|
||||
" specified; set"
|
||||
" 'deviceinfo_flash_fastboot_partition_vbmeta'"
|
||||
|
@ -51,7 +51,7 @@ def run(device: str, deviceinfo: Dict[str, str], action, flavor=None):
|
|||
"Deviceinfo_reference>")
|
||||
|
||||
# dtbo flasher requires dtbo partition to be explicitly specified
|
||||
if action == "flash_dtbo" and not vars["$PARTITION_DTBO"]:
|
||||
if action == "flash_dtbo" and not fvars["$PARTITION_DTBO"]:
|
||||
raise RuntimeError("Your device does not have 'dtbo' partition"
|
||||
" specified; set"
|
||||
" 'deviceinfo_flash_fastboot_partition_dtbo'"
|
||||
|
@ -70,7 +70,7 @@ def run(device: str, deviceinfo: Dict[str, str], action, flavor=None):
|
|||
# Run the commands of each action
|
||||
for command in cfg["actions"][action]:
|
||||
# Variable replacement
|
||||
for key, value in vars.items():
|
||||
for key, value in fvars.items():
|
||||
for i in range(len(command)):
|
||||
if key in command[i]:
|
||||
if value is None:
|
||||
|
|
|
@ -78,7 +78,7 @@ def variables(args: PmbArgs, flavor, method):
|
|||
if getattr(args,'resume', False):
|
||||
_resume = "--resume"
|
||||
|
||||
vars = {
|
||||
fvars = {
|
||||
"$BOOT": "/mnt/rootfs_" + device + "/boot",
|
||||
"$DTB": _dtb,
|
||||
"$IMAGE_SPLIT_BOOT": "/home/pmos/rootfs/" + device + "-boot.img",
|
||||
|
@ -104,8 +104,8 @@ def variables(args: PmbArgs, flavor, method):
|
|||
# Backwards compatibility with old mkinitfs (pma#660)
|
||||
pmaports_cfg = pmb.config.pmaports.read_config()
|
||||
if pmaports_cfg.get("supported_mkinitfs_without_flavors", False):
|
||||
vars["$FLAVOR"] = ""
|
||||
fvars["$FLAVOR"] = ""
|
||||
else:
|
||||
vars["$FLAVOR"] = f"-{flavor}" if flavor is not None else "-"
|
||||
fvars["$FLAVOR"] = f"-{flavor}" if flavor is not None else "-"
|
||||
|
||||
return vars
|
||||
return fvars
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue