pmb/install/recovery: add support for single kernel 'flavor' (MR 2093)

This commit is contained in:
Clayton Craft 2021-08-24 18:00:59 -07:00
parent 05c9fb784f
commit 91bb682755
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
1 changed files with 8 additions and 1 deletions

View File

@ -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: