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

@ -668,7 +668,7 @@ Flasher abstraction. Allowed variables:
$BOOT: Path to the /boot partition
$DTB: Set to "-dtb" if deviceinfo_append_dtb is set, otherwise ""
$FLAVOR: Kernel flavor
$FLAVOR: Backwards compatibility with old mkinitfs (pma#660)
$IMAGE: Path to the combined boot/rootfs image
$IMAGE_SPLIT_BOOT: Path to the (split) boot image
$IMAGE_SPLIT_ROOT: Path to the (split) rootfs image
@ -687,7 +687,7 @@ flashers = {
"flash_rootfs": [["fastboot", "flash", "$PARTITION_SYSTEM",
"$IMAGE"]],
"flash_kernel": [["fastboot", "flash", "$PARTITION_KERNEL",
"$BOOT/boot.img-$FLAVOR"]],
"$BOOT/boot.img$FLAVOR"]],
"flash_vbmeta": [
# Generate vbmeta image with "disable verification" flag
["avbtool", "make_vbmeta_image", "--flags", "2",
@ -699,7 +699,7 @@ flashers = {
"flash_dtbo": [["fastboot", "flash", "$PARTITION_DTBO",
"$BOOT/dtbo.img"]],
"boot": [["fastboot", "--cmdline", "$KERNEL_CMDLINE",
"boot", "$BOOT/boot.img-$FLAVOR"]],
"boot", "$BOOT/boot.img$FLAVOR"]],
},
},
# Some devices provide Fastboot but using Android boot images is not
@ -750,7 +750,7 @@ flashers = {
"flash_kernel": [
["heimdall_wait_for_device.sh"],
["heimdall", "flash", "--$PARTITION_KERNEL",
"$BOOT/boot.img-$FLAVOR"]],
"$BOOT/boot.img$FLAVOR"]],
"flash_vbmeta": [
["avbtool", "make_vbmeta_image", "--flags", "2",
"--padding_size", "$FLASH_PAGESIZE",

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