flasher: fastboot: take depends from pmaports.cfg

Adjust to avbtool now being part of android-tools in alpine edge.
Instead of trying to install both (which fails on edge), take the
dependencies from a new pmaports.cfg variable
supported_fastboot_depends, which only contains android-tools in
pmaports.git master branch.

Related: https://postmarketos.org/pmaports.cfg
This commit is contained in:
Oliver Smith 2022-11-09 08:42:32 +01:00
parent b64641bb1c
commit 30055c14d2
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
2 changed files with 13 additions and 4 deletions

View File

@ -829,7 +829,7 @@ uuu specific: $UUU_SCRIPT
"""
flashers = {
"fastboot": {
"depends": ["android-tools", "avbtool"],
"depends": [], # pmaports.cfg: supported_fastboot_depends
"actions": {
"list_devices": [["fastboot", "devices", "-l"]],
"flash_rootfs": [["fastboot", "flash", "$PARTITION_SYSTEM",

View File

@ -1,7 +1,8 @@
# Copyright 2022 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import pmb.config
import pmb.chroot.apk
import pmb.config
import pmb.config.pmaports
import pmb.helpers.mount
@ -19,8 +20,16 @@ def install_depends(args):
"Make sure, it is packaged for Alpine Linux, or"
" package it yourself, and then add it to"
" pmb/config/__init__.py.")
cfg = pmb.config.flashers[method]
pmb.chroot.apk.install(args, cfg["depends"])
depends = pmb.config.flashers[method]["depends"]
# Depends for some flash methods may be different for various pmaports
# branches, so read them from pmaports.cfg.
if method == "fastboot":
pmaports_cfg = pmb.config.pmaports.read_config(args)
depends = pmaports_cfg.get("supported_fastboot_depends",
"android-tools,avbtool").split(",")
pmb.chroot.apk.install(args, depends)
def init(args):