forked from Mirror/pmbootstrap
pmb.flasher.init.install_depends: new function
Move logic to install depends into one shared function.
This commit is contained in:
parent
04f8f59208
commit
b64641bb1c
3 changed files with 7 additions and 8 deletions
|
@ -1,6 +1,7 @@
|
||||||
# Copyright 2022 Oliver Smith
|
# Copyright 2022 Oliver Smith
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
from pmb.flasher.init import init
|
from pmb.flasher.init import init
|
||||||
|
from pmb.flasher.init import install_depends
|
||||||
from pmb.flasher.run import run
|
from pmb.flasher.run import run
|
||||||
from pmb.flasher.run import check_partition_blacklist
|
from pmb.flasher.run import check_partition_blacklist
|
||||||
from pmb.flasher.variables import variables
|
from pmb.flasher.variables import variables
|
||||||
|
|
|
@ -88,11 +88,8 @@ def list_devices(args):
|
||||||
|
|
||||||
|
|
||||||
def sideload(args):
|
def sideload(args):
|
||||||
method = args.flash_method or args.deviceinfo["flash_method"]
|
|
||||||
cfg = pmb.config.flashers[method]
|
|
||||||
|
|
||||||
# Install depends
|
# Install depends
|
||||||
pmb.chroot.apk.install(args, cfg["depends"])
|
pmb.flasher.install_depends(args)
|
||||||
|
|
||||||
# Mount the buildroot
|
# Mount the buildroot
|
||||||
suffix = "buildroot_" + args.deviceinfo["arch"]
|
suffix = "buildroot_" + args.deviceinfo["arch"]
|
||||||
|
|
|
@ -5,8 +5,7 @@ import pmb.chroot.apk
|
||||||
import pmb.helpers.mount
|
import pmb.helpers.mount
|
||||||
|
|
||||||
|
|
||||||
def init(args):
|
def install_depends(args):
|
||||||
# Validate method
|
|
||||||
if hasattr(args, 'flash_method'):
|
if hasattr(args, 'flash_method'):
|
||||||
method = args.flash_method or args.deviceinfo["flash_method"]
|
method = args.flash_method or args.deviceinfo["flash_method"]
|
||||||
else:
|
else:
|
||||||
|
@ -21,10 +20,12 @@ def init(args):
|
||||||
" package it yourself, and then add it to"
|
" package it yourself, and then add it to"
|
||||||
" pmb/config/__init__.py.")
|
" pmb/config/__init__.py.")
|
||||||
cfg = pmb.config.flashers[method]
|
cfg = pmb.config.flashers[method]
|
||||||
|
|
||||||
# Install depends
|
|
||||||
pmb.chroot.apk.install(args, cfg["depends"])
|
pmb.chroot.apk.install(args, cfg["depends"])
|
||||||
|
|
||||||
|
|
||||||
|
def init(args):
|
||||||
|
install_depends(args)
|
||||||
|
|
||||||
# Mount folders from host system
|
# Mount folders from host system
|
||||||
for folder in pmb.config.flash_mount_bind:
|
for folder in pmb.config.flash_mount_bind:
|
||||||
pmb.helpers.mount.bind(args, folder, args.work +
|
pmb.helpers.mount.bind(args, folder, args.work +
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue