From 91bb682755cee6879f48765e7813294b34266ad5 Mon Sep 17 00:00:00 2001 From: Clayton Craft Date: Tue, 24 Aug 2021 18:00:59 -0700 Subject: [PATCH] pmb/install/recovery: add support for single kernel 'flavor' (MR 2093) --- pmb/install/recovery.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pmb/install/recovery.py b/pmb/install/recovery.py index 7b04223b..c9eebaed 100644 --- a/pmb/install/recovery.py +++ b/pmb/install/recovery.py @@ -3,6 +3,7 @@ import logging import pmb.chroot +import pmb.config.pmaports import pmb.flasher import pmb.helpers.frontend @@ -30,7 +31,6 @@ def create_zip(args, suffix): # Create config file for the recovery installer options = { "DEVICE": args.device, - "FLAVOR": flavor, "FLASH_KERNEL": args.recovery_flash_kernel, "ISOREC": method == "heimdall-isorec", "KERNEL_PARTLABEL": vars["$PARTITION_KERNEL"], @@ -41,6 +41,13 @@ def create_zip(args, suffix): "FDE": args.full_disk_encryption, } + # Backwards compatibility with old mkinitfs (pma#660) + pmaports_cfg = pmb.config.pmaports.read_config(args) + if pmaports_cfg.get("supported_mkinitfs_without_flavors", False): + options["FLAVOR"] = "" + else: + options["FLAVOR"] = f"-{flavor}" if flavor is not None else "-" + # Write to a temporary file config_temp = args.work + "/chroot_" + suffix + "/tmp/install_options" with open(config_temp, "w") as handle: