pmb/config/flashers: add support for single kernel 'flavor' (MR 2093)

This commit is contained in:
Clayton Craft 2021-08-18 18:39:08 -07:00
parent 09794ef832
commit 05c9fb784f
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
2 changed files with 12 additions and 5 deletions

View file

@ -1,5 +1,6 @@
# Copyright 2021 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import pmb.config.pmaports
def variables(args, flavor, method):
@ -43,7 +44,6 @@ def variables(args, flavor, method):
vars = {
"$BOOT": "/mnt/rootfs_" + args.device + "/boot",
"$DTB": _dtb,
"$FLAVOR": flavor if flavor is not None else "",
"$IMAGE_SPLIT_BOOT": "/home/pmos/rootfs/" + args.device + "-boot.img",
"$IMAGE_SPLIT_ROOT": "/home/pmos/rootfs/" + args.device + "-root.img",
"$IMAGE": "/home/pmos/rootfs/" + args.device + ".img",
@ -62,4 +62,11 @@ def variables(args, flavor, method):
"/usr/share/uuu/flash_script.lst"
}
# Backwards compatibility with old mkinitfs (pma#660)
pmaports_cfg = pmb.config.pmaports.read_config(args)
if pmaports_cfg.get("supported_mkinitfs_without_flavors", False):
vars["$FLAVOR"] = ""
else:
vars["$FLAVOR"] = f"-{flavor}" if flavor is not None else "-"
return vars